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 "asm/arch/boot_drvapi.h"
24 /**---------------------------------------------------------------------------*
26 **---------------------------------------------------------------------------*/
32 /**---------------------------------------------------------------------------*
34 **---------------------------------------------------------------------------*/
36 /**---------------------------------------------------------------------------*
38 **---------------------------------------------------------------------------*/
39 LOCAL BOOLEAN wdg_debug_mode = SCI_FALSE;
41 /**---------------------------------------------------------------------------*
42 ** Local Function Prototypes *
43 **---------------------------------------------------------------------------*/
45 /**---------------------------------------------------------------------------*
46 ** Function Prototypes *
47 **---------------------------------------------------------------------------*/
48 /*****************************************************************************/
49 // Description: Sets the different kinds of reset modes, used in normal p-
50 // ower up mode, watchdog reset mode and calibration mode etc.
53 /*****************************************************************************/
54 PUBLIC void BOOT_SetRstMode (uint32 val)
56 CHIP_PHY_SetRstMode (val);
59 /*****************************************************************************/
60 // Description: Gets the current reset mode.
63 /*****************************************************************************/
64 PUBLIC uint32 BOOT_GetRstMode (void)
66 return CHIP_PHY_GetRstMode ();
69 /*****************************************************************************/
70 // Description: After normal power on, the HW_RST flag should be reset in
71 // order to judge differrent reset conditions between normal
72 // power on reset and watchdog reset.
75 /*****************************************************************************/
76 PUBLIC void BOOT_ResetHWFlag ()
78 CHIP_PHY_ResetHWFlag (0x1FFF);
81 /*****************************************************************************/
82 // Description: Before watchdog reset, writting HW_RST flag is uesed to j-
83 // udge differrent watchdog reset conditions between MCU reset
87 /*****************************************************************************/
88 PUBLIC void BOOT_SetWDGHWFlag (WDG_HW_FLAG_T type, uint32 val)
90 CHIP_PHY_SetWDGHWFlag (type, val);
93 PUBLIC void BOOT_ResetHWVal(uint32 val)
95 CHIP_PHY_ResetHWFlag (val);
99 /**---------------------------------------------------------------------------*
101 **---------------------------------------------------------------------------*/