1
0
Fork 0

armv7: s5pc1xx: don't use function pointer for clock functions

Because of the bss area is cleared after relocation, we've lost pointers.
This patch fixed it.

Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
utp
Minkyu Kang 2010-12-27 15:55:48 +09:00 committed by Albert Aribaud
parent 724bd3c50f
commit 3c152165c7
3 changed files with 27 additions and 23 deletions

View File

@ -32,8 +32,6 @@ int arch_cpu_init(void)
{ {
s5p_set_cpu_id(); s5p_set_cpu_id();
s5p_clock_init();
return 0; return 0;
} }
#endif #endif

View File

@ -38,11 +38,6 @@
#define CONFIG_SYS_CLK_FREQ_C110 24000000 #define CONFIG_SYS_CLK_FREQ_C110 24000000
#endif #endif
unsigned long (*get_uart_clk)(int dev_index);
unsigned long (*get_pwm_clk)(void);
unsigned long (*get_arm_clk)(void);
unsigned long (*get_pll_clk)(int);
/* s5pc110: return pll clock frequency */ /* s5pc110: return pll clock frequency */
static unsigned long s5pc100_get_pll_clk(int pllreg) static unsigned long s5pc100_get_pll_clk(int pllreg)
{ {
@ -316,15 +311,28 @@ static unsigned long s5pc1xx_get_pwm_clk(void)
return s5pc100_get_pclk(); return s5pc100_get_pclk();
} }
void s5p_clock_init(void) unsigned long get_pll_clk(int pllreg)
{ {
if (cpu_is_s5pc110()) { if (cpu_is_s5pc110())
get_pll_clk = s5pc110_get_pll_clk; return s5pc110_get_pll_clk(pllreg);
get_arm_clk = s5pc110_get_arm_clk; else
} else { return s5pc100_get_pll_clk(pllreg);
get_pll_clk = s5pc100_get_pll_clk; }
get_arm_clk = s5pc100_get_arm_clk;
} unsigned long get_arm_clk(void)
get_uart_clk = s5pc1xx_get_uart_clk; {
get_pwm_clk = s5pc1xx_get_pwm_clk; if (cpu_is_s5pc110())
return s5pc110_get_arm_clk();
else
return s5pc100_get_arm_clk();
}
unsigned long get_pwm_clk(void)
{
return s5pc1xx_get_pwm_clk();
}
unsigned long get_uart_clk(int dev_index)
{
return s5pc1xx_get_uart_clk(dev_index);
} }

View File

@ -29,11 +29,9 @@
#define HPLL 3 #define HPLL 3
#define VPLL 4 #define VPLL 4
void s5p_clock_init(void); unsigned long get_pll_clk(int pllreg);
unsigned long get_arm_clk(void);
extern unsigned long (*get_pll_clk)(int pllreg); unsigned long get_pwm_clk(void);
extern unsigned long (*get_arm_clk)(void); unsigned long get_uart_clk(int dev_index);
extern unsigned long (*get_pwm_clk)(void);
extern unsigned long (*get_uart_clk)(int dev_index);
#endif #endif