1 /******************************************************************************
2 ** File Name: boot_mode.c *
5 ** Copyright: 2002 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the logic interfaces called during boot,*
7 ** including reset mode setting, initialization etc.
8 ******************************************************************************
10 ******************************************************************************
12 ** ------------------------------------------------------------------------- *
13 ** DATE NAME DESCRIPTION *
14 ** 31/08/2010 Jeff.Li Create. *
15 ******************************************************************************/
17 /**---------------------------------------------------------------------------*
19 **---------------------------------------------------------------------------*/
22 #include "chip_internal.h"
23 #include "mocor_boot_mode.h"
25 /**---------------------------------------------------------------------------*
27 **---------------------------------------------------------------------------*/
33 /**---------------------------------------------------------------------------*
35 **---------------------------------------------------------------------------*/
37 /**---------------------------------------------------------------------------*
39 **---------------------------------------------------------------------------*/
40 LOCAL BOOLEAN wdg_debug_mode = SCI_FALSE;
42 /**---------------------------------------------------------------------------*
43 ** Local Function Prototypes *
44 **---------------------------------------------------------------------------*/
46 /**---------------------------------------------------------------------------*
47 ** Function Prototypes *
48 **---------------------------------------------------------------------------*/
49 /*****************************************************************************/
50 // Description: Sets the different kinds of reset modes, used in normal p-
51 // ower up mode, watchdog reset mode and calibration mode etc.
54 /*****************************************************************************/
55 PUBLIC void BOOT_SetRstMode (uint32 val)
57 CHIP_PHY_SetRstMode (val);
60 /*****************************************************************************/
61 // Description: Gets the current reset mode.
64 /*****************************************************************************/
65 PUBLIC uint32 BOOT_GetRstMode (void)
67 return CHIP_PHY_GetRstMode ();
70 /*****************************************************************************/
71 // Description: After normal power on, the HW_RST flag should be reset in
72 // order to judge differrent reset conditions between normal
73 // power on reset and watchdog reset.
76 /*****************************************************************************/
77 PUBLIC void BOOT_ResetHWFlag ()
79 CHIP_PHY_ResetHWFlag (0x1FFF);
82 /*****************************************************************************/
83 // Description: Before watchdog reset, writting HW_RST flag is uesed to j-
84 // udge differrent watchdog reset conditions between MCU reset
88 /*****************************************************************************/
89 PUBLIC void BOOT_SetWDGHWFlag (WDG_HW_FLAG_T type, uint32 val)
91 CHIP_PHY_SetWDGHWFlag (type, val);
94 PUBLIC void BOOT_ResetHWVal(uint32 val)
96 CHIP_PHY_ResetHWFlag (val);
100 /**---------------------------------------------------------------------------*
102 **---------------------------------------------------------------------------*/