xref: /utopia/UTPA2-700.0.x/mxlib/include/drvPM.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 //<MStar Software>
2 //******************************************************************************
3 // MStar Software
4 // Copyright (c) 2010 - 2012 MStar Semiconductor, Inc. All rights reserved.
5 // All software, firmware and related documentation herein ("MStar Software") are
6 // intellectual property of MStar Semiconductor, Inc. ("MStar") and protected by
7 // law, including, but not limited to, copyright law and international treaties.
8 // Any use, modification, reproduction, retransmission, or republication of all
9 // or part of MStar Software is expressly prohibited, unless prior written
10 // permission has been granted by MStar.
11 //
12 // By accessing, browsing and/or using MStar Software, you acknowledge that you
13 // have read, understood, and agree, to be bound by below terms ("Terms") and to
14 // comply with all applicable laws and regulations:
15 //
16 // 1. MStar shall retain any and all right, ownership and interest to MStar
17 //    Software and any modification/derivatives thereof.
18 //    No right, ownership, or interest to MStar Software and any
19 //    modification/derivatives thereof is transferred to you under Terms.
20 //
21 // 2. You understand that MStar Software might include, incorporate or be
22 //    supplied together with third party`s software and the use of MStar
23 //    Software may require additional licenses from third parties.
24 //    Therefore, you hereby agree it is your sole responsibility to separately
25 //    obtain any and all third party right and license necessary for your use of
26 //    such third party`s software.
27 //
28 // 3. MStar Software and any modification/derivatives thereof shall be deemed as
29 //    MStar`s confidential information and you agree to keep MStar`s
30 //    confidential information in strictest confidence and not disclose to any
31 //    third party.
32 //
33 // 4. MStar Software is provided on an "AS IS" basis without warranties of any
34 //    kind. Any warranties are hereby expressly disclaimed by MStar, including
35 //    without limitation, any warranties of merchantability, non-infringement of
36 //    intellectual property rights, fitness for a particular purpose, error free
37 //    and in conformity with any international standard.  You agree to waive any
38 //    claim against MStar for any loss, damage, cost or expense that you may
39 //    incur related to your use of MStar Software.
40 //    In no event shall MStar be liable for any direct, indirect, incidental or
41 //    consequential damages, including without limitation, lost of profit or
42 //    revenues, lost or damage of data, and unauthorized system use.
43 //    You agree that this Section 4 shall still apply without being affected
44 //    even if MStar Software has been modified by MStar in accordance with your
45 //    request or instruction for your use, except otherwise agreed by both
46 //    parties in writing.
47 //
48 // 5. If requested, MStar may from time to time provide technical supports or
49 //    services in relation with MStar Software to you for your use of
50 //    MStar Software in conjunction with your or your customer`s product
51 //    ("Services").
52 //    You understand and agree that, except otherwise agreed by both parties in
53 //    writing, Services are provided on an "AS IS" basis and the warranty
54 //    disclaimer set forth in Section 4 above shall apply.
55 //
56 // 6. Nothing contained herein shall be construed as by implication, estoppels
57 //    or otherwise:
58 //    (a) conferring any license or right to use MStar name, trademark, service
59 //        mark, symbol or any other identification;
60 //    (b) obligating MStar or any of its affiliates to furnish any person,
61 //        including without limitation, you and your customers, any assistance
62 //        of any kind whatsoever, or any information; or
63 //    (c) conferring any license or right under any intellectual property right.
64 //
65 // 7. These terms shall be governed by and construed in accordance with the laws
66 //    of Taiwan, R.O.C., excluding its conflict of law rules.
67 //    Any and all dispute arising out hereof or related hereto shall be finally
68 //    settled by arbitration referred to the Chinese Arbitration Association,
69 //    Taipei in accordance with the ROC Arbitration Law and the Arbitration
70 //    Rules of the Association by three (3) arbitrators appointed in accordance
71 //    with the said Rules.
72 //    The place of arbitration shall be in Taipei, Taiwan and the language shall
73 //    be English.
74 //    The arbitration award shall be final and binding to both parties.
75 //
76 //******************************************************************************
77 //<MStar Software>
78 ////////////////////////////////////////////////////////////////////////////////
79 //
80 // Copyright (c) 2008-2009 MStar Semiconductor, Inc.
81 // All rights reserved.
82 //
83 // Unless otherwise stipulated in writing, any and all information contained
84 // herein regardless in any format shall remain the sole proprietary of
85 // MStar Semiconductor Inc. and be kept in strict confidence
86 // ("MStar Confidential Information") by the recipient.
87 // Any unauthorized act including without limitation unauthorized disclosure,
88 // copying, use, reproduction, sale, distribution, modification, disassembling,
89 // reverse engineering and compiling of the contents of MStar Confidential
90 // Information is unlawful and strictly prohibited. MStar hereby reserves the
91 // rights to any and all damages, losses, costs and expenses resulting therefrom.
92 //
93 ////////////////////////////////////////////////////////////////////////////////
94 
95 ///////////////////////////////////////////////////////////////////////////////////////////////////
96 ///
97 /// @file   drvPM.h
98 /// @brief  PM Driver Interface
99 /// @author MStar Semiconductor Inc.
100 ///////////////////////////////////////////////////////////////////////////////////////////////////
101 
102 /*! \defgroup G_PM PM interface
103    *  \ingroup  G_PERIPHERAL
104 
105      \brief
106 
107      Power Management
108 
109      <b>Features</b>
110 
111      - Normal mode:HK is alive
112      - Standby mode:Power down die-domain
113      - Sleep mode:Power down die-domain & turn off 8051 clock,external XTAL is on to provide RTC wake-up
114      - Deep sleep mode:Power down die-domain & turn off 8051 clock & turn off external crystal,Use internal RC (4MHz) only
115 
116      <b>Power Domain Diagram</b> \n
117      \image html drvPM_pic.png
118 
119      <b>PM Power Down Routine</b> \n
120      -# Clock Switch
121      -# Set Power Down Mode: Standby/Sleep
122      -# Enable Isolation link to GPIO_PM[4]
123      -# Enter Password: Lock/Lock3
124      -# Pull GPIO PM4 down (low)
125 
126      <b>PM Power Up Routine</b> \n
127      -# Record wakeup source
128      -# Pull GPIO PM4 Up (high)
129      -# Clear Password: Lock3
130      -# Mask All Wakeup Sources
131      -# Waiting for Power Good
132      -# Clear Passwords: Lock
133      -# Recovery Settings before Power Down
134 
135      \defgroup G_PM_INIT Initialization Task relative
136      \ingroup  G_PM
137      \defgroup G_PM_COMMON Common Task relative
138      \ingroup  G_PM
139      \defgroup G_PM_CONTROL Control relative
140      \ingroup  G_PM
141      *  \defgroup G_PM_RTC RTC Task relative
142      *  \ingroup  G_PM
143      \defgroup G_PM_PWM PWM Task relative
144      \ingroup  G_PM
145      * \defgroup G_PM_STR STR Task relative
146      *  \ingroup  G_PM
147      \defgroup G_PM_OTHER  other relative
148      \ingroup  G_PM
149      * \defgroup G_PM_ToBeModified PM api to be modified
150      *  \ingroup  G_PM
151      \defgroup G_PM_ToBeRemove PM api to be removed
152      \ingroup  G_PM
153 */
154 
155 #ifndef _DRV_PM_H_
156 #define _DRV_PM_H_
157 
158 #ifdef __cplusplus
159 extern "C"
160 {
161 #endif
162 
163 #include "MsTypes.h"
164 
165 //-------------------------------------------------------------------------------------------------
166 //  Driver Capability
167 //-------------------------------------------------------------------------------------------------
168 
169 
170 //-------------------------------------------------------------------------------------------------
171 //  Macro and Define
172 //-------------------------------------------------------------------------------------------------
173 /// define PM library version
174 #define MSIF_PM_LIB_CODE               {'P','M','_','_'}
175 #define MSIF_PM_LIBVER                 {'0','3'}
176 #define MSIF_PM_BUILDNUM               {'0','0'}
177 #define MSIF_PM_CHANGELIST             {'0','0','3','5','2','1','6','3'}
178 #define MSIF_PM_OS                           '0'                  //OS
179 
180 #define PM_DRV_VERSION                 /* Character String for DRV/API version  */  \
181     MSIF_TAG,                           /* 'MSIF' */  \
182     MSIF_CLASS,                         /* '00' */  \
183     MSIF_CUS,                           /* 0x0000 */  \
184     MSIF_MOD,                           /* 0x0000 */  \
185     MSIF_CHIP,                                       \
186     MSIF_CPU,                                        \
187     MSIF_PM_LIB_CODE,                  /* IP__ */  \
188     MSIF_PM_LIBVER,                    /* 0.0 ~ Z.Z */  \
189     MSIF_PM_BUILDNUM,                  /* 00 ~ 99 */  \
190     MSIF_PM_CHANGELIST,                /* CL# */  \
191     MSIF_PM_OS
192 
193 
194 #define PM_MAX_BUF_WAKE_IR             (32) //Both IR and Keypad share this pool
195 #define PM_MAX_BUF_WAKE_IR2            (16) //Only 2nd IR share this pool
196 #define PM_MAX_BUF_WAKE_KEYPAD         (32) //RESERVED
197 #define PM_MAX_BUF_WAKE_MAC_ADDRESS    (6)//For Mac address
198 
199 
200 
201 //-------------------------------------------------------------------------------------------------
202 //  Type and Structure
203 //-------------------------------------------------------------------------------------------------
204 
205 /// PM_CMD opcode
206 #define WRITE_CMD       0
207 #define READ_CMD        1
208 #define SLEEP_CMD       2
209 #define CTRL_WRITE_CMD  3
210 #define CTRL_READ_CMD   4
211 
212 /// select sleep mode
213 #define SLEEP_MODE      0
214 #define DEEP_SLEEP_MODE 1
215 
216 /// enable wakeup source
217 #define IR_WAKEUP       (1<<0)
218 #define CEC_WAKEUP      (1<<1)
219 #define GPIO5_WAKEUP    (1<<2)
220 #define GPIO6_WAKEUP    (1<<3)
221 #define KEYPAD_WAKEUP   (1<<4)
222 #define EASYSYNC_WAKEUP (1<<5)
223 #define SYNC_WAKEUP     (1<<6)
224 #define RTC_WAKEUP      (1<<7)
225 
226 #define DVI_DET_WAKEUP  (1<<10)
227 #define DVI_DET2_WAKEUP (1<<11)
228 
229 /// power off PM4 polarity
230 #define POWER_OFF_HIGH  (1<<15)
231 
232 /// IR types
233 #define IR_TYPE_FULLDECODE_MODE 1
234 #define IR_TYPE_RAWDATA_MODE    2
235 #define IR_TYPE_SWDECODE_MODE   3
236 
237 /// IRQ
238 #define MDRV_IRQ_BEGIN      0x40
239 #define MDRV_IRQ_END        0x7F
240 #define IRQ_PMSLEEP     (MDRV_IRQ_BEGIN + 12)
241 
242 /// Enable GPIO
243 #define ENABLE_GPIO0    (1<<0)
244 #define ENABLE_GPIO1    (1<<1)
245 #define ENABLE_GPIO2    (1<<2)
246 #define ENABLE_GPIO3    (1<<3)  //GPIO 4&5 are reserved
247 #define ENABLE_GPIO6    (1<<6)
248 #define ENABLE_GPIO7    (1<<7)
249 #define ENABLE_GPIO8    (1<<8)
250 #define ENABLE_GPIO9    (1<<9)
251 #define ENABLE_GPIO10   (1<<10)
252 #define ENABLE_GPIO11   (1<<11)
253 #define ENABLE_GPIO12   (1<<12)
254 
255 
256 /// MICOM(PM_SLEEP) DDI Layer Command
257 typedef enum
258 {
259     /// write data from host to PM : direction
260     CP_WRITE_HOST_MEM_TO_MICOM = 0xE0UL,
261 
262     /// write data from host to PM : start
263     CP_WRITE_HOST_MEM_TO_MICOM_START = 0xE1UL,
264 
265     /// write data from host to PM : data content
266     CP_WRITE_HOST_MEM_TO_MICOM_DATA = 0xE2UL,
267 
268     /// write keypad boundary parameter 1 to PM
269     CP_WRITE_KEYPAD_BOUND_1 = 0xE6UL,
270 
271     /// write keypad boundary parameter 2 to PM
272     CP_WRITE_KEYPAD_BOUND_2 = 0xE7UL,
273 
274     /// read data from PM to host : direction
275     CP_READ_MICOM_TO_HOST_MEM = 0xE3UL,
276 
277     /// read data from PM to host : start
278     CP_WRITE_MICOM_TO_HOST_MEM_START = 0xE4UL,
279 
280     /// read data from PM to host : data content
281     CP_READ_MICOM_TO_HOST_MEM_DATA = 0xE5UL,
282 
283     /// no command
284     CP_NO_CMD = 0
285 
286 } DDI_MICOM_CMDTYPE;
287 
288 /// For PM mailbox command header
289 typedef struct
290 {
291     MS_U8 Preamble  : 2;    /// two bits for command index
292     MS_U8 Opcode    : 6;    /// 6 bits for operation codes
293 } PM_Cmd;
294 
295 /// For initializing IR timing configuration
296 typedef struct
297 {
298     MS_S16 s16Time;    /// time
299     MS_S16 s16UpBnd;   /// upper bound
300     MS_S16 s16LowBnd;  /// low bound
301 } PM_IrTimeCfg;
302 
303 /// For initializing IR registers configuration
304 typedef struct
305 {
306     MS_U8  u8IrModeSel;                 /// IR mode selection
307     MS_U8  u8IrCtrl;                    /// IR enable control
308     MS_U8  u8IrHdrCode0;                /// IR header code 0
309     MS_U8  u8IrHdrCode1;                /// IR header code 1
310     MS_U32 u32IrTimOutCyc;              /// IR timerout counter
311     PM_IrTimeCfg tIrHdrCoTim;           /// header code time
312     PM_IrTimeCfg tIrOffCoTim;           /// off code time
313     PM_IrTimeCfg tIrOffCoRpTim;         /// off code repeat time
314     PM_IrTimeCfg tIrLg01HighTim;        /// logical 0/1 high time
315     PM_IrTimeCfg tIrLg0Tim;             /// logical 0 time
316     PM_IrTimeCfg tIrLg1Tim;             /// logical 1 time
317 } PM_IrRegCfg;
318 
319 /// For initializing keypad boundary configuration
320 typedef struct
321 {
322     MS_U8 u8UpBnd;   /// upper bound
323     MS_U8 u8LowBnd;  /// low bound
324 } PM_SarBndCfg;
325 
326 /// For initializing keypad boundary configuration
327 typedef struct
328 {
329     PM_SarBndCfg tSarChan1;          /// Channel 1 interrupt trigger boundary
330     PM_SarBndCfg tSarChan2;          /// Channel 2 interrupt trigger boundary
331     PM_SarBndCfg tSarChan3;          /// Channel 3 interrupt trigger boundary
332     PM_SarBndCfg tSarChan4;          /// Channel 4 interrupt trigger boundary
333 } PM_SarRegCfg;
334 
335 /// For initializing keypad wake-up parameter configuration
336 typedef struct
337 {
338     PM_SarBndCfg tChanMinus;    /// parameter for Channel Minus
339     PM_SarBndCfg tChanPlus;     /// parameter for Channel Plus
340     PM_SarBndCfg tInput;        /// parameter for Input Source
341     PM_SarBndCfg tMenu;         /// parameter for Menu
342     PM_SarBndCfg tOk;           /// parameter for OK
343     PM_SarBndCfg tPower;        /// parameter for Power
344     PM_SarBndCfg tVolumeMinus;  /// parameter for Volume Minus
345     PM_SarBndCfg tVolumePlus;   /// parameter for Volume Plus
346 } PM_SarParamCfg;
347 
348 typedef enum
349 {
350     E_PM_RTC_0=0,
351     E_PM_RTC_2=1,
352 }E_PM_RTC;
353 
354 ///Define PM IRQ Type
355 typedef enum
356 {
357     /// IRQ Type for IR
358     E_PM_IRQ_IR         = 0,
359     /// IRQ Type for CEC Wake-up
360     E_PM_IRQ_CEC_WAKE   = 1,
361     /// IRQ Type for External Interrup
362     E_PM_IRQ_EX_INT     = 2,
363     /// IRQ Type for External Interrup 2
364     E_PM_IRQ_EX_INT2    = 3,
365     /// IRQ Type for SAR(Keypad)
366     E_PM_IRQ_SAR        = 4,
367     /// IRQ Type for Sync Detection
368     E_PM_IRQ_SYNC_DET   = 5,
369     /// IRQ Type for DVI clock Detection
370     E_PM_IRQ_DVICLK_DET = 6,
371     /// IRQ Type for RTC
372     E_PM_IRQ_RTC        = 7,
373     /// IRQ Type for WDT
374     E_PM_IRQ_WDT        = 8,
375     /// IRQ Type for Mail Box 0
376     E_PM_IRQ_MBOX0      = 9,
377     /// IRQ Type for Mail Box 1
378     E_PM_IRQ_MBOX1      = 10,
379     /// IRQ Type for Mail Box 2
380     E_PM_IRQ_MBOX2      = 11,
381     /// IRQ Type for Mail Box 3
382     E_PM_IRQ_MMOX3      = 12,
383     /// Maximum IRQ Type
384     E_PM_IRQ_MAX        = E_PM_IRQ_MMOX3,
385 
386 } PM_IRQ_TYPE;
387 
388 ///Define PM Saved Registers
389 typedef struct
390 {
391     unsigned long   r[32];          /// GPR regs
392 #ifdef __AEONR2__
393     unsigned long   machi2;         // Highest 32-bits of new 32x32=64 multiplier
394 #endif
395     unsigned long   machi;          /// High and low words of
396     unsigned long   maclo;          /// multiply/accumulate reg
397 
398     unsigned long   pc;             /// Program Counter
399 
400     /// Saved only for exceptions, and not restored when continued:
401     /// Effective address of instruction/data access that caused exception
402     unsigned long   eear;           /// Exception effective address reg
403     /// These are only saved for exceptions and interrupts
404     int             vector;         /// Vector number
405     int             sr;             /// Status Reg
406 
407 } PM_SavedRegisters;
408 
409 typedef void (*PM_IsrCb_Type)(PM_SavedRegisters *regs, MS_U32 vector);
410 
411 
412 typedef void ( *IRRecord_Callback ) (MS_VIRT virtSrcAddr, MS_U16 u16DataSize);
413 
414 ///Define PM IRQ Struct
415 typedef struct
416 {
417     PM_IsrCb_Type  isr;     /// PM ISR call back type
418     MS_U32         data;    /// PM ISR data parameter
419 } PM_IrqStruct;
420 
421 
422 
423 
424 
425 ///Define PM debug level
426 typedef enum _PM_DbgLv
427 {
428     E_PM_DBGLV_NONE,          /// no debug message
429     E_PM_DBGLV_ERR_ONLY,      /// show error only
430     E_PM_DBGLV_INFO,          /// show error & informaiton
431     E_PM_DBGLV_ALL,           /// show error, information & funciton name
432 }PM_DbgLv;
433 
434 ///Define PM Return Value
435 typedef enum
436 {
437     /// fail
438     E_PM_FAIL = 0,
439     /// success
440     E_PM_OK = 1,
441 
442 } PM_Result;
443 
444 ///Define PM return to HK PowerOn Mode
445 typedef enum
446 {
447     E_PM_POWERON_STANBY = 1,
448     E_PM_POWERON_SLEEP  = 2,
449     E_PM_POWERON_DEEPSLEEP = 3,
450     E_PM_POWERON_ACON = 0xffUL,
451 
452 } PM_PowerOnMode;
453 
454 typedef enum
455 {
456 	E_PM_WAKEUPSRC_NONE = 0,
457 	E_PM_WAKEUPSRC_IR,
458 	E_PM_WAKEUPSRC_DVI,
459 	E_PM_WAKEUPSRC_DVI2,
460 	E_PM_WAKEUPSRC_CEC,
461 	E_PM_WAKEUPSRC_SAR,
462 	E_PM_WAKEUPSRC_ESYNC,
463 	E_PM_WAKEUPSRC_SYNC,
464 	E_PM_WAKEUPSRC_RTC,
465 	E_PM_WAKEUPSRC_RTC2,
466 	E_PM_WAKEUPSRC_AVLINK,
467 	E_PM_WAKEUPSRC_UART,
468 	E_PM_WAKEUPSRC_GPIO,
469 	E_PM_WAKEUPSRC_MHL,
470 	E_PM_WAKEUPSRC_WOL,
471 
472 } PM_WakeupSource;
473 
474 ///Define PM Acknoledge Flags
475 typedef enum
476 {
477     E_PM_ACKFLG_NULL        = 0,                    /// Ack flag for NULL
478     E_PM_ACKFLG_WAIT_INIT   = (1<<0),               /// Ack flag for Init
479     E_PM_ACKFLG_WAIT_STATUS = (1<<1),               /// Ack flag for Status
480     E_PM_ACKFLG_WAIT_LIBVER = (1<<2),               /// Ack flag for Library version
481     E_PM_ACKFLG_WAIT_POWERDOWN = (1<<3),            /// Ack flag for Power down
482     E_PM_ACKFLG_WAIT_RTCINIT = (1<<4),              /// Ack flag for Rtc Init
483     E_PM_ACKFLG_WAIT_RTCSETCOUNTER = (1<<5),        /// Ack flag for set rtc counter
484     E_PM_ACKFLG_WAIT_RTCGETCOUNTER = (1<<6),        /// Ack flag for get rtc counter
485     E_PM_ACKFLG_WAIT_RTCSETMATCHCOUNTER = (1<<7),   /// Ack flag for set match counter
486     E_PM_ACKFLG_WAIT_RTCGETMATCHCOUNTER = (1<<8),   /// Ack flag for get match counter
487     E_PM_ACKFLG_WAIT_INFO = (1<<9),                 /// Ack flag for Get info
488     E_PM_ACKFLG_WAIT_GETMASTERKEY = (1<<10),        /// Ack flag for Get master key
489     E_PM_ACKFLG_WAIT_GETDEVICEID = (1<<11),         /// Ack flag for Get device ID
490     E_PM_ACKFLG_WAIT_GETCHIPID = (1<<12),           /// Ack flag for Get chip ID
491     E_PM_ACKFLG_WAIT_GPIOINIT = (1<<13),            /// Ack flag for init GPIO
492     E_PM_ACKFLG_WAIT_PWMINIT = (1<<14),             /// Ack flag for PWM init
493     E_PM_ACKFLG_WAIT_PWMCONFIG = (1<<15),           /// Ack flag for PWM config
494     E_PM_ACKFLG_WAIT_GETPMMEMADDR = (1<<16),        /// Ack flag for Get PM mem addr
495     E_PM_ACKFLG_WAIT_GETEXTRASRAMDATA = (1<<17),    /// Ack flag for Get PM extra sram data
496     E_PM_ACKFLG_WAIT_SETEXTRASRAMDATA = (1<<18),    /// Ack flag for Set PM extra sram data
497     E_PM_ACKFLG_WAIT_WDT_KICK   = (1<<19),          /// Ack flag for Wdt kick
498 } PM_AckFlags;
499 
500 ///Define PM PWM Acknowledge Flags
501 typedef enum
502 {
503     E_PM_PWM_ACKFLG_NULL        = 0,                    /// Ack flag for NULL
504     E_PM_PWM_ACKFLG_WAIT_INIT   = (1<<0),               /// Ack flag for Init
505     E_PM_PWM_ACKFLG_WAIT_CONF   = (1<<1),               /// Ack flag for Init
506     E_PM_PWM_ACKFLG_WAIT_IRRECORD_RECIEVE_REQUIRE           = (1<<2),               /// Ack flag for ir recored reciecve require
507     E_PM_PWM_ACKFLG_WAIT_IRRECORD_RECIEVE_COMPLETE          = (1<<3),              /// Ack flag for ir recored reciecve complete
508     E_PM_PWM_ACKFLG_WAIT_IRRECORD_TRANSMIT                 = (1<<4),              /// Ack flag for ir record transmit
509     E_PM_PWM_ACKFLG_WAIT_IRRECORD_SETCALLBACK              = (1<<5),               /// Ack flag for ir record reciecve set call back
510     E_PM_PWM_ACKFLG_WAIT_IRRECORD_RECIEVE_EXIT             = (1<<6),               /// Ack flag for ir record reciecve exit
511     E_PM_PWM_ACKFLG_WAIT_GPIO_PWM_REQUIRE                  = (1<<7),
512 } PM_PWM_AckFlags;
513 
514 #if defined(MSOS_TYPE_ECOS)
515 typedef enum
516 {
517     E_PM_ST_NULL = 0,          /// PM Driver Status is NULL
518     E_PM_ST_BOOTING = 1,       /// PM Driver Status is Booting
519     E_PM_ST_READY = 2,         /// PM Driver Status is Ready
520     E_PM_ST_STANDBY = 3,       /// PM Driver Status is Standby
521     E_PM_ST_PMMODE = 4,        /// PM Driver Status is PmMode
522     E_PM_ST_MAX_STATUS = 255   /// Maximum status for PM Driver Status
523 
524 } __attribute__ ((aligned (4096))) PM_DrvStatus;
525 
526 #else
527 ///Define PM Driver Status
528 typedef enum __attribute__ ((aligned (4096)))
529 {
530     E_PM_ST_NULL = 0,          /// PM Driver Status is NULL
531     E_PM_ST_BOOTING = 1,       /// PM Driver Status is Booting
532     E_PM_ST_READY = 2,         /// PM Driver Status is Ready
533     E_PM_ST_STANDBY = 3,       /// PM Driver Status is Standby
534     E_PM_ST_PMMODE = 4,        /// PM Driver Status is PmMode
535     E_PM_ST_MAX_STATUS = 255   /// Maximum status for PM Driver Status
536 
537 } PM_DrvStatus;
538 #endif
539 
540 ///Define PM Power Down Mode
541 #define E_PM_STANDBY     0      /// PM Power Down Mode is Standby
542 #define E_PM_SLEEP      1       /// PM Power Down Mode is Sleep
543 #define E_PM_DEEP_SLEEP 2       /// PM Power Down Mode is Deep Sleep
544 #define E_PM_NORMAL     3
545 
546 ///Define PM WakeUp Mode
547 #define E_PM_WAKE_ZERO  0       /// PM Wakeup Mode is zero
548 #define E_PM_WAKE_LAST  1       /// PM Wakeup Mode is last
549 #define E_PM_ZERO_TWOSTAGE_POWERDOWN    2
550 #define E_PM_LAST_TWOSTAGE_POWERDOWN    3
551 
552 ///Define PM Command Index
553 typedef enum
554 {
555     //Aeon-->51 Command Index
556     PM_CMDIDX_INIT = 0x01UL,                  /// PM Command Index is INIT
557     PM_CMDIDX_GET_STATUS = 0x02UL,            /// PM Command Index is GET STATUS
558     PM_CMDIDX_GET_LIBVER = 0x03UL,            /// PM Command Index is GET LIBVER
559     PM_CMDIDX_POWER_DOWN = 0x04UL,            /// PM Command Index is POWER DOWN
560     PM_CMDIDX_RTC_INIT = 0x05UL,              /// PM Command Index is RTC INIT
561     PM_CMDIDX_RTC_SETCOUNTER = 0x06UL,        /// PM Command Index is SET COUNTER
562     PM_CMDIDX_RTC_GETCOUNTER = 0x07UL,        /// PM Command Index is GET COUNTER
563     PM_CMDIDX_RTC_SETMATCHCOUNTER = 0x08UL,   /// PM Command Index is SET MATCH COUNTER
564     PM_CMDIDX_RTC_GETMATCHCOUNTER = 0x09UL,   /// PM Command Index is GET MATCH COUNTER
565     PM_CMDIDX_GET_INFO = 0x0AUL,              /// PM Command Index is GET INFO
566     PM_CMDIDX_GET_MASTERKEY = 0x0BUL,
567     PM_CMDIDX_GET_DEVICEID = 0x0CUL,
568     PM_CMDIDX_GET_CHIPID = 0x0DUL,
569     PM_CMDIDX_GPIO_INIT = 0x0EUL,
570     PM_CMDIDX_PWM_INIT =0x0FUL,
571     PM_CMDIDX_PWM_CONFIG =0x10UL,
572 
573     PM_CMDIDX_PWM_IRRECORD_RECEIVED_SETCALLBACK = 0x11UL,
574     PM_CMDIDX_PWM_IRRECORD_RECEIVED_REQUIRE = 0x12UL,
575     PM_CMDIDX_PWM_IRRECORD_RECEIVED_COMPLETE = 0x13UL,
576     PM_CMDIDX_PWM_IRRECORD_TRANSMIT = 0x14UL,
577     PM_CMDIDX_PWM_IRRECORD_RECEIVED_EXIT = 0x15UL,
578     PM_CMDIDX_GETEXTRASRAMDATA = 0x16UL,
579     PM_CMDIDX_SETEXTRASRAMDATA = 0x17UL,
580     PM_CMDIDX_SET_ONBOARD_LED = 0x18UL,             // Control On Board LED
581     PM_CMDIDX_SET_POWER_LED_N_PROGRAM_TIMER_LED = 0x19UL,
582 
583     PM_CMDIDX_LED_FLASH     = 0x20UL,             // PM Command Index is LED Start        //@@++-- 20110329 Arki
584     PM_CMDIDX_GLOBAL_CHIP_RESET = 0x21UL,
585     PM_CMDIDX_GET_PM_MEMADDR = 0x22UL,
586     PM_CMDIDX_GET_SYSTEM_ALIVE_STATUS    = 0x23UL,
587     PM_CMDIDX_WDT_STATUS  = 0x24UL,
588     PM_CMDIDX_UPATE_POWER_LED_STATUS = 0x25UL,
589     PM_CMDIDX_LED_FLASH_TOGGLE     = 0x28UL,             // facory LED toggle
590     PM_CMDIDX_POWER_ON_TIME_RECORD     = 0x29UL,  // PM Command Index is record AC and DC on time  Kenny
591 
592     PM_CMDIDX_ACK_51ToAEON = 0x30UL,          /// PM Command Index is ACK 51 To AEON
593     PM_CMDIDX_WDT_KICK = 0x40UL,
594 #if defined(UFO_PM_BACKLIGHT_CTRL)
595     PM_CMDIDX_LED = 0x42,
596     PM_CMDIDX_START_BACKLIGHT_PROCESSING = 0x44,
597     PM_CMDIDX_SET_BACKLIGHT_CTRL_MODE = 0x45,   //PM command idx is set BL control mode
598     PM_CMDIDX_SET_BACKLIGHT_CTRL_ON_OFF = 0x46, //PM command idx is control BL on/off
599     PM_CMDIDX_SET_SOURCE_SIGNAL_CTRL_MODE = 0x47,   //PM command idx is set BL control mode
600     PM_CMDIDX_SET_OFL_STB = 0x48,
601 #endif
602     PM_CMDIDX_SN_INIT_ACK   =  0x50UL,        /// to inform PM SN is start up
603     PM_CMDIDX_PWM_GPIO_REQUIRE = 0x60UL,
604     //51->Aeon Command Index
605     PM_CMDIDX_ACK_AEONTo51 = 0xA0UL,          /// PM Command Index is ACK AEON To 51
606 
607 } PM_CmdIndex;
608 
609 typedef enum
610 {
611     E_WDT_NOT_ENABLE,
612     E_WDT_REFRESH,
613     E_WDT_STOP_REFRESH,
614     E_WDT_RESET_SYSTEM_IMMEDIATE,
615 } WDT_STATUS;
616 
617 
618 
619 typedef enum
620 {
621     E_ON_BOARD_LED_OFF= 0,
622     E_ON_BOARD_LED_PATTERN_1 = 1,
623     E_ON_BOARD_LED_PATTERN_2 = 2,
624     E_ON_BOARD_LED_PATTERN_3 = 3,
625     E_ON_BOARD_LED_PATTERN_4 = 4,
626     E_ON_BOARD_LED_PATTERN_5 = 5,
627     E_ON_BOARD_LED_ON= 255,
628 } USB_LED_PATTERN;
629 
630 typedef enum
631 {
632     E_ON_BOARD_LED_STAGE_BIST= 0,
633     E_ON_BOARD_LED_STAGE_MBOOT_SUCCESS=1,
634     E_ON_BOARD_LED_STAGE_APL_SUCCESS= 2,
635     E_ON_BOARD_LED_STAGE_UPDATE_SW= 3,
636 } ON_BOARD_LED_STAGE;
637 
638 
639 typedef enum
640 {
641     E_PROGRAM_TIMER_IS_SET= 0,
642     E_PROGRAM_TIMER_IS_REMINDING= 1,
643     E_PROGRAM_TIMER_IS_RECORDING=2,
644     E_PROGRAM_TIMER_IS_NOT_SET= 3,
645 } PROGRAM_TIMER_LED_STATUS;
646 
647 typedef enum
648 {
649     E_SW_UPDATE_NOT_IN_PROGRESS= 0,
650     E_SW_UPDATE_IN_PROGRESS= 1,
651     E_SW_UPDATE_FAILED= 2,
652     E_SW_UPDATE_SUCCESSFUL= 3,
653     E_SW_UPDATE_FAN_ERROR=4,
654     E_SW_UPDATE_FAN_ERROR_RECOVER=5,
655 } SW_UPDATE_STATUS;
656 
657 typedef enum
658 {
659     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE1= 1,
660     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE2= 2,
661     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE3= 3,
662     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE4= 4,
663     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE5= 5,
664     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE6= 6,
665     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE7= 7,
666     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE8= 8,
667     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE9= 9,
668     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE10= 10,
669     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE11= 11,
670     E_POWER_LED_N_PROGRAM_TIMER_LED_MODE12= 12,
671 } POWER_LED_N_PROGRAM_TIMER_LED_MODE;
672 
673 typedef enum
674 {
675     E_POWER_LED_KEEP= 0,
676     E_POWER_LED_GREEN,
677     E_POWER_LED_RED,
678     E_POWER_LED_ORANGE,
679 } UPATE_POWER_LED_PATTERN;
680 
681 
682 ///Define PM STR Mode enum
683 typedef enum
684 {
685     E_PM_NON_STR=0,           /// non-str dc on
686     E_PM_NON_STR_AC,        /// non-str ac on
687     E_PM_STR,               /// str
688     E_PM_STR_CRC,           /// str and crc
689 }PM_STRMode;
690 
691 /// Define PM Wake-up Configuration
692 #define CRC_KERNEL_BUF                 (3)
693 typedef struct __attribute__ ((aligned (4096)))
694 {
695     MS_U8 bPmWakeEnableIR         : 1;/// For PM IR Wake-up
696     MS_U8 bPmWakeEnableSAR        : 1;/// For PM SAR Wake-up
697     MS_U8 bPmWakeEnableGPIO0      : 1;/// For PM GPIO0 Wake-up
698     MS_U8 bPmWakeEnableGPIO1      : 1;/// For PM GPIO1 Wake-up
699     MS_U8 bPmWakeEnableUART1      : 1;  /// For PM UART1 Wake-up
700     MS_U8 bPmWakeEnableSYNC       : 1;/// For PM SYNC Wake-up
701     MS_U8 bPmWakeEnableESYNC      : 1;/// For PM EasySYNC Wake-up
702 
703     MS_U8 bPmWakeEnableRTC0       : 1;/// For PM RTC0 Wake-up
704     MS_U8 bPmWakeEnableRTC1       : 1;/// For PM RTC1 Wake-up
705     MS_U8 bPmWakeEnableDVI0       : 1;/// For PM DVI0 Wake-up
706     MS_U8 bPmWakeEnableDVI2       : 1;/// For PM DVI1 Wake-up
707     MS_U8 bPmWakeEnableCEC        : 1;/// For PM CEC Wake-up
708     MS_U8 bPmWakeEnableAVLINK     : 1;/// For PM AVLINK Wake-up
709     MS_U8 bPmWakeEnableMHL        : 1;/// For PM MHL Wake-up
710     MS_U8 bPmWakeEnableWOL        : 1;/// For PM WOL Wake-up
711 
712     MS_U8 u8PmWakeIR[PM_MAX_BUF_WAKE_IR];///For PM IR Wake-up key define
713     MS_U8 u8PmWakeIR2[PM_MAX_BUF_WAKE_IR2];///For PM IR Wake-up key define
714     MS_U8 u8PmWakeMACAddress[PM_MAX_BUF_WAKE_MAC_ADDRESS];///For PM WOL Wake-up Mac define
715 
716     MS_U8 u8PmStrMode;
717     MS_BOOL bLxCRCMiu[CRC_KERNEL_BUF];
718     MS_U32 u32LxCRCAddress[CRC_KERNEL_BUF];
719     MS_U32 u32LxCRCSize[CRC_KERNEL_BUF];
720     MS_U8 u8PmWakeEnableWOWLAN;
721     MS_U8 u8PmWakeWOWLANPol;
722 } PM_WakeCfg;
723 
724 /// Define PWM  simaulator IR mode
725 typedef struct __attribute__ ((aligned (4096)))
726 {
727     MS_U8 u8IREncodeMode;
728     MS_U8 u8Customercode1;
729     MS_U8 u8Customercode2;
730     MS_U8 u8IRKeycode;
731     MS_U8 u8IRRepeat;
732     MS_U8 u8Reserved0;              /// Reserved
733     MS_U8 u8Reserved1;              /// Reserved
734     MS_U8 u8Reserved2;              /// Reserved
735 } PWMSimIR_CFG;
736 
737 typedef struct __attribute__ ((aligned (4096)))
738 {
739     //MS_U32 u32RtcCounter;
740     //MS_U8 u8WakeupSource;
741     MS_U16 u16Offset;
742     MS_U16 u16DataLen;
743     MS_U8  u8ExtraSramData[]; //Max size 512 bytes
744 } PM_ExtraSramData;
745 
746 /// Define PM Power Down Modes
747 typedef struct __attribute__ ((aligned (4096)))
748 {
749     MS_U8 u8PowerDownMode;        /// Power Down Mode
750     MS_U8 u8WakeAddress;
751 
752 } PM_PowerDownCfg;
753 
754 /// Define PM RTC Parameters
755 typedef struct __attribute__ ((aligned (4096)))
756 {
757     MS_U32 u32RtcCtrlWord;          /// Define PM RTC Control Word
758     MS_U32 u32RtcSetMatchCounter;   /// Define PM RTC for Set Match Counter
759     MS_U32 u32RtcGetMatchCounter;   /// Define PM RTC for Get Match Counter
760     MS_U32 u32RtcSetCounter;        /// Define PM RTC for Set Counter
761     MS_U32 u32RtcGetCounter;        /// Define PM RTC for Get Counter
762     MS_U8 u8PmRtcIndex;             /// Define PM RTC Index
763     MS_U8 u8Reserved0;              /// Reserved
764     MS_U8 u8Reserved1;              /// Reserved
765     MS_U8 u8Reserved2;              /// Reserved
766 
767 } PM_RtcParam;
768 
769 /// Define PM Driver Information
770 typedef struct __attribute__ ((aligned (4096)))
771 {
772     MS_U8 u8PmSupSleepMode; /// Spuuort PM Sleep Mode
773     MS_U8 u8PmSupRtcIdxMax; /// Support RTC Index Max
774 
775 }PM_DrvInfo;
776 
777 typedef struct
778 {
779     MS_U8 u8Reserved[16]; ///Dummy Write for MIU FIFO
780 
781 }PM_Dummy;
782 
783 
784 //-------------------------------------------------------------------------------------------------
785 //  Function and Variable
786 //-------------------------------------------------------------------------------------------------
787 //-------------------------------------------------------------------------------------------------
788 /// MOBF Encrypt
789 /// @ingroup G_PM_ToBeRemove
790 /// @param u32Key \b IN: Key
791 /// @param bEnable \b IN: TRUE/FLASE
792 /// @return DRVAESDMA_OK : Success
793 /// @return Others : Fail
794 //-------------------------------------------------------------------------------------------------
795 MS_BOOL MDrv_PM_isRunning(void);
796 //-------------------------------------------------------------------------------------------------
797 /// MOBF Encrypt
798 /// @ingroup G_PM_ToBeRemove
799 /// @param u32Key \b IN: Key
800 /// @param bEnable \b IN: TRUE/FLASE
801 /// @return DRVAESDMA_OK : Success
802 /// @return Others : Fail
803 //-------------------------------------------------------------------------------------------------
804 void MDrv_PM_InterruptRequest( void );
805 void MDrv_PM_LoadFw( MS_U8 *pPmCode, MS_U16 u16Len );
806 //-------------------------------------------------------------------------------------------------
807 /// MOBF Encrypt
808 /// @ingroup G_PM_ToBeRemove
809 /// @param u32Key \b IN: Key
810 /// @param bEnable \b IN: TRUE/FLASE
811 /// @return DRVAESDMA_OK : Success
812 /// @return Others : Fail
813 //-------------------------------------------------------------------------------------------------
814 MS_BOOL MDrv_PM_RegWrite( MS_U16 u16Addr, MS_U8 u8Data );
815 //-------------------------------------------------------------------------------------------------
816 /// MOBF Encrypt
817 /// @ingroup G_PM_ToBeRemove
818 /// @param u32Key \b IN: Key
819 /// @param bEnable \b IN: TRUE/FLASE
820 /// @return DRVAESDMA_OK : Success
821 /// @return Others : Fail
822 //-------------------------------------------------------------------------------------------------
823 MS_U8 MDrv_PM_RegRead( MS_U16 u16Addr );
824 //-------------------------------------------------------------------------------------------------
825 /// MOBF Encrypt
826 /// @ingroup G_PM_ToBeRemove
827 /// @param u32Key \b IN: Key
828 /// @param bEnable \b IN: TRUE/FLASE
829 /// @return DRVAESDMA_OK : Success
830 /// @return Others : Fail
831 //-------------------------------------------------------------------------------------------------
832 void MDrv_PM_RegWriteBit(MS_U16 u16Addr, MS_U8 bBit, MS_U8 u8BitPos );
833 //-------------------------------------------------------------------------------------------------
834 /// MOBF Encrypt
835 /// @ingroup G_PM_ToBeRemove
836 /// @param u32Key \b IN: Key
837 /// @param bEnable \b IN: TRUE/FLASE
838 /// @return DRVAESDMA_OK : Success
839 /// @return Others : Fail
840 //-------------------------------------------------------------------------------------------------
841 MS_U8 MDrv_PM_RegReadBit(MS_U16 u16Addr, MS_U8 u8BitPos);
842 //-------------------------------------------------------------------------------------------------
843 /// MOBF Encrypt
844 /// @ingroup G_PM_ToBeRemove
845 /// @param u32Key \b IN: Key
846 /// @param bEnable \b IN: TRUE/FLASE
847 /// @return DRVAESDMA_OK : Success
848 /// @return Others : Fail
849 //-------------------------------------------------------------------------------------------------
850 void MDrv_PM_RegWrite2byte( MS_U16 u16RegIndex, MS_U16 u16Value );
851 //-------------------------------------------------------------------------------------------------
852 /// MOBF Encrypt
853 /// @ingroup G_PM_ToBeRemove
854 /// @param u32Key \b IN: Key
855 /// @param bEnable \b IN: TRUE/FLASE
856 /// @return DRVAESDMA_OK : Success
857 /// @return Others : Fail
858 //-------------------------------------------------------------------------------------------------
859 void MDrv_PM_RegWrite3byte( MS_U16 u16Regndex, MS_U32 u32Value );
860 //-------------------------------------------------------------------------------------------------
861 /// MOBF Encrypt
862 /// @ingroup G_PM_CONTROL
863 /// @param u32Key \b IN: Key
864 /// @param bEnable \b IN: TRUE/FLASE
865 /// @return DRVAESDMA_OK : Success
866 /// @return Others : Fail
867 //-------------------------------------------------------------------------------------------------
868 MS_BOOL MDrv_PM_Control( MS_U8 u8opcode, MS_U8 u8Data, MS_U16 u16Data );
869 //-------------------------------------------------------------------------------------------------
870 /// MOBF Encrypt
871 /// @ingroup G_PM_CONTROL
872 /// @param u32Key \b IN: Key
873 /// @param bEnable \b IN: TRUE/FLASE
874 /// @return DRVAESDMA_OK : Success
875 /// @return Others : Fail
876 //-------------------------------------------------------------------------------------------------
877 MS_BOOL MDrv_PM_CtrlWrite( MS_U8 u8Opcode, MS_U8 u8CmdType, MS_U8 u8DataNum, MS_U8 *pu8Data );
878 //-------------------------------------------------------------------------------------------------
879 /// MOBF Encrypt
880 /// @ingroup G_PM_CONTROL
881 /// @param u32Key \b IN: Key
882 /// @param bEnable \b IN: TRUE/FLASE
883 /// @return DRVAESDMA_OK : Success
884 /// @return Others : Fail
885 //-------------------------------------------------------------------------------------------------
886 MS_BOOL MDrv_PM_CtrlRead( MS_U8 u8Opcode, MS_U8 u8CmdType, MS_U8 u8DataNum, MS_U8 *pu8Data );
887 //-------------------------------------------------------------------------------------------------
888 /// MOBF Encrypt
889 /// @ingroup G_PM_CONTROL
890 /// @param u32Key \b IN: Key
891 /// @param bEnable \b IN: TRUE/FLASE
892 /// @return DRVAESDMA_OK : Success
893 /// @return Others : Fail
894 //-------------------------------------------------------------------------------------------------
895 MS_BOOL MDrv_PM_MemoryWrite(MS_U8 *pu8Data, MS_U16 u16MemLen);
896 //-------------------------------------------------------------------------------------------------
897 /// MOBF Encrypt
898 /// @ingroup G_PM_CONTROL
899 /// @param u32Key \b IN: Key
900 /// @param bEnable \b IN: TRUE/FLASE
901 /// @return DRVAESDMA_OK : Success
902 /// @return Others : Fail
903 //-------------------------------------------------------------------------------------------------
904 MS_BOOL MDrv_PM_MemoryRead(MS_U8 *pu8Data, MS_U16 u16MemLen);
905 //-------------------------------------------------------------------------------------------------
906 /// MOBF Encrypt
907 /// @ingroup G_PM_RTC
908 /// @param u32Key \b IN: Key
909 /// @param bEnable \b IN: TRUE/FLASE
910 /// @return DRVAESDMA_OK : Success
911 /// @return Others : Fail
912 //-------------------------------------------------------------------------------------------------
913 void MDrv_PM_RTCEnableInterrupt(MS_BOOL bEnable);
914 //-------------------------------------------------------------------------------------------------
915 /// MOBF Encrypt
916 /// @ingroup G_PM_RTC
917 /// @param u32Key \b IN: Key
918 /// @param bEnable \b IN: TRUE/FLASE
919 /// @return DRVAESDMA_OK : Success
920 /// @return Others : Fail
921 //-------------------------------------------------------------------------------------------------
922 void MDrv_PM_RTC2EnableInterrupt(MS_BOOL bEnable);
923 //-------------------------------------------------------------------------------------------------
924 /// MOBF Encrypt
925 /// @ingroup G_PM_RTC
926 /// @param u32Key \b IN: Key
927 /// @param bEnable \b IN: TRUE/FLASE
928 /// @return DRVAESDMA_OK : Success
929 /// @return Others : Fail
930 //-------------------------------------------------------------------------------------------------
931 void MDrv_PM_RTC2SetMatchTime(MS_U32 u32PmSysTime);
932 /*add by owen.qin end*/
933 //-------------------------------------------------------------------------------------------------
934 /// MOBF Encrypt
935 /// @ingroup G_PM_RTC
936 /// @param u32Key \b IN: Key
937 /// @param bEnable \b IN: TRUE/FLASE
938 /// @return DRVAESDMA_OK : Success
939 /// @return Others : Fail
940 //-------------------------------------------------------------------------------------------------
941 void MDrv_PM_RTCSetMatchTime(MS_U32 u32PmSysTime);
942 //-------------------------------------------------------------------------------------------------
943 /// MOBF Encrypt
944 /// @ingroup G_PM_RTC
945 /// @param u32Key \b IN: Key
946 /// @param bEnable \b IN: TRUE/FLASE
947 /// @return DRVAESDMA_OK : Success
948 /// @return Others : Fail
949 //-------------------------------------------------------------------------------------------------
950 MS_U32 MDrv_PM_RTCGetMatchTime(void);
951 //-------------------------------------------------------------------------------------------------
952 /// MOBF Encrypt
953 /// @ingroup G_PM_RTC
954 /// @param u32Key \b IN: Key
955 /// @param bEnable \b IN: TRUE/FLASE
956 /// @return DRVAESDMA_OK : Success
957 /// @return Others : Fail
958 //-------------------------------------------------------------------------------------------------
959 void MDrv_PM_RTCSetSystemTime(MS_U32 u32PmSysTime);
960 //-------------------------------------------------------------------------------------------------
961 /// MOBF Encrypt
962 /// @ingroup G_PM_RTC
963 /// @param u32Key \b IN: Key
964 /// @param bEnable \b IN: TRUE/FLASE
965 /// @return DRVAESDMA_OK : Success
966 /// @return Others : Fail
967 //-------------------------------------------------------------------------------------------------
968 MS_U32 MDrv_PM_RTCGetSystemTime(void);
969 //-------------------------------------------------------------------------------------------------
970 /// MOBF Encrypt
971 /// @ingroup G_PM_RTC
972 /// @param u32Key \b IN: Key
973 /// @param bEnable \b IN: TRUE/FLASE
974 /// @return DRVAESDMA_OK : Success
975 /// @return Others : Fail
976 //-------------------------------------------------------------------------------------------------
977 void MDrv_PM_RTCInit(MS_U32 u32CtrlWord);
978 //-------------------------------------------------------------------------------------------------
979 /// MOBF Encrypt
980 /// @ingroup G_PM_CONTROL
981 /// @param u32Key \b IN: Key
982 /// @param bEnable \b IN: TRUE/FLASE
983 /// @return DRVAESDMA_OK : Success
984 /// @return Others : Fail
985 //-------------------------------------------------------------------------------------------------
986 void MDrv_PM_IRInit(MS_U8 irclk_mhz, PM_IrRegCfg *irRegCfg);
987 //-------------------------------------------------------------------------------------------------
988 /// MOBF Encrypt
989 /// @ingroup G_PM_CONTROL
990 /// @param u32Key \b IN: Key
991 /// @param bEnable \b IN: TRUE/FLASE
992 /// @return DRVAESDMA_OK : Success
993 /// @return Others : Fail
994 //-------------------------------------------------------------------------------------------------
995 void MDrv_PM_KeypadInit(PM_SarRegCfg *sarRegCfg, PM_SarParamCfg *sarParamCfg);
996 //-------------------------------------------------------------------------------------------------
997 /// MOBF Encrypt
998 /// @ingroup G_PM_CONTROL
999 /// @param u32Key \b IN: Key
1000 /// @param bEnable \b IN: TRUE/FLASE
1001 /// @return DRVAESDMA_OK : Success
1002 /// @return Others : Fail
1003 //-------------------------------------------------------------------------------------------------
1004 void MDrv_PM_CalibrateRC(void);
1005 //-------------------------------------------------------------------------------------------------
1006 /// MOBF Encrypt
1007 /// @ingroup G_PM_ToBeRemove
1008 /// @param u32Key \b IN: Key
1009 /// @param bEnable \b IN: TRUE/FLASE
1010 /// @return DRVAESDMA_OK : Success
1011 /// @return Others : Fail
1012 //-------------------------------------------------------------------------------------------------
1013 MS_BOOL MDrv_PM_isDownloaded(void);
1014 //-------------------------------------------------------------------------------------------------
1015 /// MOBF Encrypt
1016 /// @ingroup G_PM_ToBeRemove
1017 /// @param u32Key \b IN: Key
1018 /// @param bEnable \b IN: TRUE/FLASE
1019 /// @return DRVAESDMA_OK : Success
1020 /// @return Others : Fail
1021 //-------------------------------------------------------------------------------------------------
1022 void MDrv_PM_Set_Download(void);
1023 //-------------------------------------------------------------------------------------------------
1024 /// MOBF Encrypt
1025 /// @ingroup G_PM_ToBeRemove
1026 /// @param u32Key \b IN: Key
1027 /// @param bEnable \b IN: TRUE/FLASE
1028 /// @return DRVAESDMA_OK : Success
1029 /// @return Others : Fail
1030 //-------------------------------------------------------------------------------------------------
1031 void MDrv_PM_IrqAttach(PM_IRQ_TYPE irq, PM_IsrCb_Type isr, MS_U32 data);
1032 //-------------------------------------------------------------------------------------------------
1033 /// MOBF Encrypt
1034 /// @ingroup G_PM_ToBeRemove
1035 /// @param u32Key \b IN: Key
1036 /// @param bEnable \b IN: TRUE/FLASE
1037 /// @return DRVAESDMA_OK : Success
1038 /// @return Others : Fail
1039 //-------------------------------------------------------------------------------------------------
1040 void MDrv_PM_IrqDetach(PM_IRQ_TYPE irq);
1041 //-------------------------------------------------------------------------------------------------
1042 /// MOBF Encrypt
1043 /// @ingroup G_PM_ToBeRemove
1044 /// @param u32Key \b IN: Key
1045 /// @param bEnable \b IN: TRUE/FLASE
1046 /// @return DRVAESDMA_OK : Success
1047 /// @return Others : Fail
1048 //-------------------------------------------------------------------------------------------------
1049 void MDrv_PM_IrqUnmask(PM_IRQ_TYPE irq);
1050 //-------------------------------------------------------------------------------------------------
1051 /// MOBF Encrypt
1052 /// @ingroup G_PM_ToBeRemove
1053 /// @param u32Key \b IN: Key
1054 /// @param bEnable \b IN: TRUE/FLASE
1055 /// @return DRVAESDMA_OK : Success
1056 /// @return Others : Fail
1057 //-------------------------------------------------------------------------------------------------
1058 void MDrv_PM_IrqMask(PM_IRQ_TYPE irq);
1059 //-------------------------------------------------------------------------------------------------
1060 /// MOBF Encrypt
1061 /// @ingroup G_PM_ToBeRemove
1062 /// @param u32Key \b IN: Key
1063 /// @param bEnable \b IN: TRUE/FLASE
1064 /// @return DRVAESDMA_OK : Success
1065 /// @return Others : Fail
1066 //-------------------------------------------------------------------------------------------------
1067 void MDrv_PM_IrqMaskAll(void);
1068 
1069 //-------------------------------------------------------------------------------------------------
1070 /// MOBF Encrypt
1071 /// @ingroup G_PM_CONTROL
1072 /// @param u32Key \b IN: Key
1073 /// @param bEnable \b IN: TRUE/FLASE
1074 /// @return DRVAESDMA_OK : Success
1075 /// @return Others : Fail
1076 //-------------------------------------------------------------------------------------------------
1077 PM_Result MDrv_PM_ActiveStandbyMode(MS_BOOL bTrigger);
1078 //-------------------------------------------------------------------------------------------------
1079 /// MOBF Encrypt
1080 /// @ingroup G_PM_CONTROL
1081 /// @param u32Key \b IN: Key
1082 /// @param bEnable \b IN: TRUE/FLASE
1083 /// @return DRVAESDMA_OK : Success
1084 /// @return Others : Fail
1085 //-------------------------------------------------------------------------------------------------
1086 PM_Result MDrv_PM_IsActiveStandbyMode(MS_BOOL *bActive);
1087 
1088 //-------------------------------------------------------------------------------------------------
1089 /// MOBF Encrypt
1090 /// @ingroup G_PM_INIT
1091 /// @param u32Key \b IN: Key
1092 /// @param bEnable \b IN: TRUE/FLASE
1093 /// @return DRVAESDMA_OK : Success
1094 /// @return Others : Fail
1095 //-------------------------------------------------------------------------------------------------
1096 PM_Result MDrv_PM_Init(PM_WakeCfg *pPmWakeCfg);
1097 //-------------------------------------------------------------------------------------------------
1098 /// MOBF Encrypt
1099 /// @ingroup G_PM_COMMON
1100 /// @param u32Key \b IN: Key
1101 /// @param bEnable \b IN: TRUE/FLASE
1102 /// @return DRVAESDMA_OK : Success
1103 /// @return Others : Fail
1104 //-------------------------------------------------------------------------------------------------
1105 PM_Result MDrv_PM_GetStatus(PM_DrvStatus *pDrvStatus);
1106 //-------------------------------------------------------------------------------------------------
1107 /// MOBF Encrypt
1108 /// @ingroup G_PM_COMMON
1109 /// @param u32Key \b IN: Key
1110 /// @param bEnable \b IN: TRUE/FLASE
1111 /// @return DRVAESDMA_OK : Success
1112 /// @return Others : Fail
1113 //-------------------------------------------------------------------------------------------------
1114 PM_Result MDrv_PM_GetLibVer(const MSIF_Version **ppVersion);
1115 //-------------------------------------------------------------------------------------------------
1116 /// MOBF Encrypt
1117 /// @ingroup G_PM_COMMON
1118 /// @param u32Key \b IN: Key
1119 /// @param bEnable \b IN: TRUE/FLASE
1120 /// @return DRVAESDMA_OK : Success
1121 /// @return Others : Fail
1122 //-------------------------------------------------------------------------------------------------
1123 PM_Result MDrv_PM_PowerDown(PM_PowerDownCfg *pPmPowerDownCfg);
1124 //-------------------------------------------------------------------------------------------------
1125 /// MOBF Encrypt
1126 /// @ingroup G_PM_COMMON
1127 /// @param u32Key \b IN: Key
1128 /// @param bEnable \b IN: TRUE/FLASE
1129 /// @return DRVAESDMA_OK : Success
1130 /// @return Others : Fail
1131 //-------------------------------------------------------------------------------------------------
1132 PM_Result MDrv_PM_GetMasterKey(MS_U8 *pPmPowerDownCfg);
1133 //-------------------------------------------------------------------------------------------------
1134 /// MOBF Encrypt
1135 /// @ingroup G_PM_ToBeRemove
1136 /// @param u32Key \b IN: Key
1137 /// @param bEnable \b IN: TRUE/FLASE
1138 /// @return DRVAESDMA_OK : Success
1139 /// @return Others : Fail
1140 //-------------------------------------------------------------------------------------------------
1141 PM_Result MDrv_PM_GetDeviceID(MS_U8 *DeviceID);
1142 //-------------------------------------------------------------------------------------------------
1143 /// MOBF Encrypt
1144 /// @ingroup G_PM_ToBeRemove
1145 /// @param u32Key \b IN: Key
1146 /// @param bEnable \b IN: TRUE/FLASE
1147 /// @return DRVAESDMA_OK : Success
1148 /// @return Others : Fail
1149 //-------------------------------------------------------------------------------------------------
1150 PM_Result MDrv_PM_GetChipID(MS_U8 *ChipParam);
1151 //-------------------------------------------------------------------------------------------------
1152 /// MOBF Encrypt
1153 /// @ingroup G_PM_COMMON
1154 /// @param u32Key \b IN: Key
1155 /// @param bEnable \b IN: TRUE/FLASE
1156 /// @return DRVAESDMA_OK : Success
1157 /// @return Others : Fail
1158 //-------------------------------------------------------------------------------------------------
1159 PM_Result MDrv_PM_GetPMMemAddr(MS_U8 *PmMemAddr);
1160 //-------------------------------------------------------------------------------------------------
1161 /// MOBF Encrypt
1162 /// @ingroup G_PM_COMMON
1163 /// @param u32Key \b IN: Key
1164 /// @param bEnable \b IN: TRUE/FLASE
1165 /// @return DRVAESDMA_OK : Success
1166 /// @return Others : Fail
1167 //--------------------------------------------------------------------------------------------------
1168 const PM_DrvInfo* MDrv_PM_GetInfo(void);
1169 //-------------------------------------------------------------------------------------------------
1170 /// MOBF Encrypt
1171 /// @ingroup G_PM_INIT
1172 /// @param u32Key \b IN: Key
1173 /// @param bEnable \b IN: TRUE/FLASE
1174 /// @return DRVAESDMA_OK : Success
1175 /// @return Others : Fail
1176 //-------------------------------------------------------------------------------------------------
1177 PM_Result MDrv_PM_GPIOInit(MS_U16 u16GPIOIndex);
1178 //-------------------------------------------------------------------------------------------------
1179 /// MOBF Encrypt
1180 /// @ingroup G_PM_COMMON
1181 /// @param u32Key \b IN: Key
1182 /// @param bEnable \b IN: TRUE/FLASE
1183 /// @return DRVAESDMA_OK : Success
1184 /// @return Others : Fail
1185 //-------------------------------------------------------------------------------------------------
1186 PM_Result MDrv_PM_SetDbgLevel(PM_DbgLv eLevel);
1187 //-------------------------------------------------------------------------------------------------
1188 /// MOBF Encrypt
1189 /// @ingroup G_PM_INIT
1190 /// @param u32Key \b IN: Key
1191 /// @param bEnable \b IN: TRUE/FLASE
1192 /// @return DRVAESDMA_OK : Success
1193 /// @return Others : Fail
1194 //-------------------------------------------------------------------------------------------------
1195 PM_Result MDrv_PM_RtcInit(PM_RtcParam *pPmRtcParam);
1196 //-------------------------------------------------------------------------------------------------
1197 /// MOBF Encrypt
1198 /// @ingroup G_PM_ToBeRemove
1199 /// @param u32Key \b IN: Key
1200 /// @param bEnable \b IN: TRUE/FLASE
1201 /// @return DRVAESDMA_OK : Success
1202 /// @return Others : Fail
1203 //-------------------------------------------------------------------------------------------------
1204 void MDrv_PM_Rtc_DisableInit(E_PM_RTC eRtc);
1205 //-------------------------------------------------------------------------------------------------
1206 /// MOBF Encrypt
1207 /// @ingroup G_PM_RTC
1208 /// @param u32Key \b IN: Key
1209 /// @param bEnable \b IN: TRUE/FLASE
1210 /// @return DRVAESDMA_OK : Success
1211 /// @return Others : Fail
1212 //-------------------------------------------------------------------------------------------------
1213 PM_Result MDrv_PM_RtcSetCounter(PM_RtcParam *pPmRtcParam);
1214 //-------------------------------------------------------------------------------------------------
1215 /// MOBF Encrypt
1216 /// @ingroup G_PM_RTC
1217 /// @param u32Key \b IN: Key
1218 /// @param bEnable \b IN: TRUE/FLASE
1219 /// @return DRVAESDMA_OK : Success
1220 /// @return Others : Fail
1221 //-------------------------------------------------------------------------------------------------
1222 PM_Result MDrv_PM_RtcGetCounter(PM_RtcParam *pPmRtcParam);
1223 //-------------------------------------------------------------------------------------------------
1224 /// MOBF Encrypt
1225 /// @ingroup G_PM_RTC
1226 /// @param u32Key \b IN: Key
1227 /// @param bEnable \b IN: TRUE/FLASE
1228 /// @return DRVAESDMA_OK : Success
1229 /// @return Others : Fail
1230 //-------------------------------------------------------------------------------------------------
1231 PM_Result MDrv_PM_RtcSetMatchCounter(PM_RtcParam *pPmRtcParam);
1232 //-------------------------------------------------------------------------------------------------
1233 /// MOBF Encrypt
1234 /// @ingroup G_PM_RTC
1235 /// @param u32Key \b IN: Key
1236 /// @param bEnable \b IN: TRUE/FLASE
1237 /// @return DRVAESDMA_OK : Success
1238 /// @return Others : Fail
1239 //-------------------------------------------------------------------------------------------------
1240 PM_Result MDrv_PM_RtcGetMatchCounter(PM_RtcParam *pPmRtcParam);
1241 //-------------------------------------------------------------------------------------------------
1242 /// MOBF Encrypt
1243 /// @ingroup G_PM_COMMON
1244 /// @param u32Key \b IN: Key
1245 /// @param bEnable \b IN: TRUE/FLASE
1246 /// @return DRVAESDMA_OK : Success
1247 /// @return Others : Fail
1248 //-------------------------------------------------------------------------------------------------
1249 PM_Result MDrv_PM_GetExtraSramData(PM_ExtraSramData *pPmExtraSramData);
1250 //-------------------------------------------------------------------------------------------------
1251 /// MOBF Encrypt
1252 /// @ingroup G_PM_COMMON
1253 /// @param u32Key \b IN: Key
1254 /// @param bEnable \b IN: TRUE/FLASE
1255 /// @return DRVAESDMA_OK : Success
1256 /// @return Others : Fail
1257 //-------------------------------------------------------------------------------------------------
1258 PM_Result MDrv_PM_SetExtraSramData(PM_ExtraSramData *pPmExtraSramData);
1259 
1260 //-------------------------------------------------------------------------------------------------
1261 /// MOBF Encrypt
1262 /// @ingroup G_PM_OTHER
1263 /// @param u32Key \b IN: Key
1264 /// @param bEnable \b IN: TRUE/FLASE
1265 /// @return DRVAESDMA_OK : Success
1266 /// @return Others : Fail
1267 //-------------------------------------------------------------------------------------------------
1268 void MDrv_PM_SetSPIOffsetForMCU(MS_U32 BANK);
1269 //-------------------------------------------------------------------------------------------------
1270 /// MOBF Encrypt
1271 /// @ingroup G_PM_OTHER
1272 /// @param u32Key \b IN: Key
1273 /// @param bEnable \b IN: TRUE/FLASE
1274 /// @return DRVAESDMA_OK : Success
1275 /// @return Others : Fail
1276 //-------------------------------------------------------------------------------------------------
1277 void MDrv_PM_SetSRAMOffsetForMCU(void);
1278 //-------------------------------------------------------------------------------------------------
1279 /// MOBF Encrypt
1280 /// @ingroup G_PM_OTHER
1281 /// @param u32Key \b IN: Key
1282 /// @param bEnable \b IN: TRUE/FLASE
1283 /// @return DRVAESDMA_OK : Success
1284 /// @return Others : Fail
1285 //-------------------------------------------------------------------------------------------------
1286 MS_BOOL MDrv_PM_SetDRAMOffsetForMCU(MS_U32 u32Offset);
1287 //-------------------------------------------------------------------------------------------------
1288 /// MOBF Encrypt
1289 /// @ingroup G_PM_COMMON
1290 /// @param u32Key \b IN: Key
1291 /// @param bEnable \b IN: TRUE/FLASE
1292 /// @return DRVAESDMA_OK : Success
1293 /// @return Others : Fail
1294 //-------------------------------------------------------------------------------------------------
1295 PM_PowerOnMode MDrv_PM_PowerOnMode(void);
1296 //-------------------------------------------------------------------------------------------------
1297 /// MOBF Encrypt
1298 /// @ingroup G_PM_COMMON
1299 /// @param u32Key \b IN: Key
1300 /// @param bEnable \b IN: TRUE/FLASE
1301 /// @return DRVAESDMA_OK : Success
1302 /// @return Others : Fail
1303 //-------------------------------------------------------------------------------------------------
1304 PM_WakeupSource MDrv_PM_GetWakeupSource(void);
1305 //-------------------------------------------------------------------------------------------------
1306 /// MOBF Encrypt
1307 /// @ingroup G_PM_COMMON
1308 /// @param u32Key \b IN: Key
1309 /// @param bEnable \b IN: TRUE/FLASE
1310 /// @return DRVAESDMA_OK : Success
1311 /// @return Others : Fail
1312 //-------------------------------------------------------------------------------------------------
1313 MS_U8 MDrv_PM_GetWakeupKey(void);
1314 //-------------------------------------------------------------------------------------------------
1315 /// MOBF Encrypt
1316 /// @ingroup G_PM_COMMON
1317 /// @param u32Key \b IN: Key
1318 /// @param bEnable \b IN: TRUE/FLASE
1319 /// @return DRVAESDMA_OK : Success
1320 /// @return Others : Fail
1321 //-------------------------------------------------------------------------------------------------
1322 PM_Result MDrv_PM_Disable51(void);
1323 //-------------------------------------------------------------------------------------------------
1324 /// MOBF Encrypt
1325 /// @ingroup G_PM_ToBeRemove
1326 /// @param u32Key \b IN: Key
1327 /// @param bEnable \b IN: TRUE/FLASE
1328 /// @return DRVAESDMA_OK : Success
1329 /// @return Others : Fail
1330 //-------------------------------------------------------------------------------------------------
1331 PM_Result MDrv_PM_GPIO4_SetPower(MS_BOOL bOn);
1332 //-------------------------------------------------------------------------------------------------
1333 /// MOBF Encrypt
1334 /// @ingroup G_PM_PWM
1335 /// @param u32Key \b IN: Key
1336 /// @param bEnable \b IN: TRUE/FLASE
1337 /// @return DRVAESDMA_OK : Success
1338 /// @return Others : Fail
1339 //-------------------------------------------------------------------------------------------------
1340 PM_Result MDrv_PM_PWM_Init(MS_U8 u8PWM);
1341 //-------------------------------------------------------------------------------------------------
1342 /// MOBF Encrypt
1343 /// @ingroup G_PM_PWM
1344 /// @param u32Key \b IN: Key
1345 /// @param bEnable \b IN: TRUE/FLASE
1346 /// @return DRVAESDMA_OK : Success
1347 /// @return Others : Fail
1348 //-------------------------------------------------------------------------------------------------
1349 PM_Result MDrv_PM_PWM_Config(PWMSimIR_CFG *pPmPWMCfg);
1350 //-------------------------------------------------------------------------------------------------
1351 /// MOBF Encrypt
1352 /// @ingroup G_PM_PWM
1353 /// @param u32Key \b IN: Key
1354 /// @param bEnable \b IN: TRUE/FLASE
1355 /// @return DRVAESDMA_OK : Success
1356 /// @return Others : Fail
1357 //-------------------------------------------------------------------------------------------------
1358 PM_Result MDrv_PM_PWM_IRRecord_Init(void);
1359 //-------------------------------------------------------------------------------------------------
1360 /// MOBF Encrypt
1361 /// @ingroup G_PM_PWM
1362 /// @param u32Key \b IN: Key
1363 /// @param bEnable \b IN: TRUE/FLASE
1364 /// @return DRVAESDMA_OK : Success
1365 /// @return Others : Fail
1366 //-------------------------------------------------------------------------------------------------
1367 PM_Result MDrv_PM_PWM_IRRecord_Receive_Complete(MS_U32 u32BufferAddr,MS_U16 u16BufferSize);
1368 //-------------------------------------------------------------------------------------------------
1369 /// MOBF Encrypt
1370 /// @ingroup G_PM_PWM
1371 /// @param u32Key \b IN: Key
1372 /// @param bEnable \b IN: TRUE/FLASE
1373 /// @return DRVAESDMA_OK : Success
1374 /// @return Others : Fail
1375 //-------------------------------------------------------------------------------------------------
1376 PM_Result MDrv_PM_PWM_IRRecord_Receive_Require(MS_U32 u32BufferAddr,MS_U16 u16BufferSize);
1377 //-------------------------------------------------------------------------------------------------
1378 /// MOBF Encrypt
1379 /// @ingroup G_PM_PWM
1380 /// @param u32Key \b IN: Key
1381 /// @param bEnable \b IN: TRUE/FLASE
1382 /// @return DRVAESDMA_OK : Success
1383 /// @return Others : Fail
1384 //-------------------------------------------------------------------------------------------------
1385 PM_Result MDrv_PM_PWM_IRRecord_Transmit(MS_U32 u32BufferAddr,MS_U16 u16BufferSize);
1386 //-------------------------------------------------------------------------------------------------
1387 /// MOBF Encrypt
1388 /// @ingroup G_PM_PWM
1389 /// @param u32Key \b IN: Key
1390 /// @param bEnable \b IN: TRUE/FLASE
1391 /// @return DRVAESDMA_OK : Success
1392 /// @return Others : Fail
1393 //-------------------------------------------------------------------------------------------------
1394 PM_Result MDrv_PM_PWM_IRRecord_SetCallBackFunction(IRRecord_Callback pCallback);
1395 //-------------------------------------------------------------------------------------------------
1396 /// MOBF Encrypt
1397 /// @ingroup G_PM_PWM
1398 /// @param u32Key \b IN: Key
1399 /// @param bEnable \b IN: TRUE/FLASE
1400 /// @return DRVAESDMA_OK : Success
1401 /// @return Others : Fail
1402 //-------------------------------------------------------------------------------------------------
1403 PM_Result MDrv_PM_PWM_IRRecord_Receive_Exit(void);
1404 //-------------------------------------------------------------------------------------------------
1405 /// MOBF Encrypt
1406 /// @ingroup G_PM_RTPM
1407 /// @param u32Key \b IN: Key
1408 /// @param bEnable \b IN: TRUE/FLASE
1409 /// @return DRVAESDMA_OK : Success
1410 /// @return Others : Fail
1411 //-------------------------------------------------------------------------------------------------
1412 void MDrv_PM_RunTimePM_Disable_PassWord(void);
1413 //-------------------------------------------------------------------------------------------------
1414 /// MOBF Encrypt
1415 /// @ingroup G_PM_RTPM
1416 /// @param u32Key \b IN: Key
1417 /// @param bEnable \b IN: TRUE/FLASE
1418 /// @return DRVAESDMA_OK : Success
1419 /// @return Others : Fail
1420 //-------------------------------------------------------------------------------------------------
1421 PM_Result MDrv_PM_WDT_Kick(MS_U8 u8Kick);
1422 //-------------------------------------------------------------------------------------------------
1423 /// MOBF Encrypt
1424 /// @ingroup G_PM_STR
1425 /// @param u32Key \b IN: Key
1426 /// @param bEnable \b IN: TRUE/FLASE
1427 /// @return DRVAESDMA_OK : Success
1428 /// @return Others : Fail
1429 //-------------------------------------------------------------------------------------------------
1430 void MDrv_PM_STR_CheckFactoryPowerOnModePassword(void);
1431 //-------------------------------------------------------------------------------------------------
1432 /// MOBF Encrypt
1433 /// @ingroup G_PM_STR
1434 /// @param u32Key \b IN: Key
1435 /// @param bEnable \b IN: TRUE/FLASE
1436 /// @return DRVAESDMA_OK : Success
1437 /// @return Others : Fail
1438 //-------------------------------------------------------------------------------------------------
1439 PM_Result MDrv_PM_STR_CheckFactoryPowerOnMode_Second(MS_BOOL bCheck);
1440 //-------------------------------------------------------------------------------------------------
1441 /// MOBF Encrypt
1442 /// @ingroup G_PM_COMMON
1443 /// @param u32Key \b IN: Key
1444 /// @param bEnable \b IN: TRUE/FLASE
1445 /// @return DRVAESDMA_OK : Success
1446 /// @return Others : Fail
1447 //-------------------------------------------------------------------------------------------------
1448 PM_Result MDrv_PM_Check_Version(MS_BOOL bCheck);
1449 //-------------------------------------------------------------------------------------------------
1450 /// MOBF Encrypt
1451 /// @ingroup G_PM_COMMON
1452 /// @param u32Key \b IN: Key
1453 /// @param bEnable \b IN: TRUE/FLASE
1454 /// @return DRVAESDMA_OK : Success
1455 /// @return Others : Fail
1456 //-------------------------------------------------------------------------------------------------
1457 MS_U16 MDrv_PM_GetSRAMSize(void);
1458 //-------------------------------------------------------------------------------------------------
1459 /// MOBF Encrypt
1460 /// @ingroup G_PM_COMMON
1461 /// @param u32Key \b IN: Key
1462 /// @param bEnable \b IN: TRUE/FLASE
1463 /// @return DRVAESDMA_OK : Success
1464 /// @return Others : Fail
1465 //-------------------------------------------------------------------------------------------------
1466 MS_U8 MDrv_PM_GetIRPowerOnKey(void);
1467 void MDrv_PM_GetRT51Status(void);
1468 //-------------------------------------------------------------------------------------------------
1469 /// MOBF Encrypt
1470 /// @ingroup G_PM_COMMON
1471 /// @param u8cfg \b IN: Pin Config
1472 /// @param u8step \b IN: Period
1473 /// @return DRVAESDMA_OK : Success
1474 /// @return Others : Fail
1475 //-------------------------------------------------------------------------------------------------
1476 PM_Result MDrv_PM_PWM_Duty(MS_U8 u8cfg,MS_U8 u8step);
1477 #ifdef MSOS_TYPE_LINUX
1478 PM_Result MDrv_PM_IO_INIT(void);
1479 PM_Result MDrv_PM_WriteDramInfo_Data(MS_U32 u32Addr, MS_U32 u32Size);
1480 PM_Result MDrv_PM_WriteDramInfo_Code(MS_U32 u32Addr, MS_U32 u32Size);
1481 #endif
1482 #if defined(UFO_PM_BACKLIGHT_CTRL)
1483   PM_Result MDrv_PM_LED(MS_U8 u8Status);
1484   PM_Result MDrv_PM_Backlight_Processing(void);
1485   PM_Result MDrv_PM_Backlight_OnOff(MS_U8 eStatus, MS_U8 u8BacklightDuty);
1486   PM_Result MDrv_PM_Backlight_Ctrl_Mode(MS_U8 eBLCtrlMode, MS_U8 u8BacklightDuty);
1487   PM_Result MDrv_PM_Backlight_Operation(MS_U8 u8status);
1488 #endif
1489 PM_Result MDrv_PM_STR_CRC_Check(MS_U16 u16CRCChecksum);
1490 #ifdef __cplusplus
1491 }
1492 #endif
1493 
1494 #endif // _DRV_PM_H_
1495 
1496