tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / arch / arm / cpu / armv7 / sc8810 / chip_cfg.c
1 /******************************************************************************
2  ** File Name:      sp7100g_cfg.c                                             *
3  ** Author:         Xueliang.Wang                                             *
4  ** DATE:           08/23/2004                                                *
5  ** Copyright:      2004 Spreatrum, Incoporated. All Rights Reserved.         *
6  ** Description:    This file defines the config information of SP7100G       *
7  **                 project.                                                  *
8  **                                                                           *
9  ******************************************************************************
10
11  ******************************************************************************
12  **                        Edit History                                       *
13  ** ------------------------------------------------------------------------- *
14  ** DATE            NAME            DESCRIPTION                               *
15  ** 08/23/2004      Xueliang.Wang   Create.                                   *
16  ******************************************************************************/
17
18 /**---------------------------------------------------------------------------*
19  **                         Dependencies                                      *
20  **---------------------------------------------------------------------------*/
21 #include "asm/arch/sci_types.h"
22 #include "asm/arch/arm_reg.h"
23 #include "asm/arch/sc_reg.h"
24 #include "asm/arch/sc_reg.h"
25 #include "asm/arch/chng_freq.h"
26 #include "asm/arch/emc_drv.h"
27 #include "asm/arch/chip.h"
28
29 /**---------------------------------------------------------------------------*
30  **                         Compiler Flag                                     *
31  **---------------------------------------------------------------------------*/
32 #ifdef   __cplusplus
33 extern   "C"
34 {
35 #endif
36
37 //-----------------------------------------------------------------------------
38 //
39 //  The initialized frequency when system start up.
40 //
41
42 //-----------------------------------------------------------------------------
43 //Global variable contain system clk config
44 const SYS_CLK_CFG_INFO g_system_clk_cfg =
45 {
46
47 #if  defined PLATFORM_SC6800H
48     MPLL_MN_192M_EX26M,
49     UPLL_MN_192M_EX26M,
50     P192M_ARM192M_AHB96M
51 #elif defined PLATFORM_SC8800H
52     MPLL_MN_164M_EX26M,
53     0,
54     P340M_ARM170M_AHB85M
55 #else
56     0,
57     0,
58     0
59 #endif
60 };
61
62 /*****************************************************************************/
63 //  Description:    This function get system clk config pointer
64 //  Author:         Younger.yang
65 //  Note:
66 /*****************************************************************************/
67 SYS_CLK_CFG_INFO *Get_system_clk_cfg (void)
68 {
69
70     return (SYS_CLK_CFG_INFO *) &g_system_clk_cfg;
71 }
72
73 uint32 FDL_GetBootMode (void)
74 {
75     uint32 bootMode = 0;
76 #ifdef  PLATFORM_SC8800H
77     bootMode = (* (volatile uint32 *) (0x8B000020) >> 8) & 0xff; //read HWRST reg bit[15:8]
78 #endif
79 #ifdef  PLATFORM_SC6800H
80     bootMode = (* (volatile uint32 *) (0x8b00003C) >> 8) & 0xff; //read HWRST reg bit[15:8]
81 #endif
82 #ifdef  PLATFORM_SC8800G
83     bootMode = (* (volatile uint32 *) (0x8b000020) >> 8) & 0xff; //read HWRST reg bit[15:8]
84 #endif
85 #ifdef  CONFIG_SC8810
86     bootMode = (* (volatile uint32 *) (0x8b000020) >> 8) & 0xff; //read HWRST reg bit[15:8]
87 #endif
88 #ifdef  PLATFORM_SC6600L
89     bootMode = (* (volatile uint32 *) (0x8b000020) >> 8) & 0xff; //read HWRST reg bit[15:8]
90 #endif
91     return bootMode;
92 }
93 /**---------------------------------------------------------------------------*
94  **                         Compiler Flag                                     *
95  **---------------------------------------------------------------------------*/
96 #ifdef   __cplusplus
97 }
98 #endif