From 17ed21371bff96e3a81fa761c724a9b283a7297f Mon Sep 17 00:00:00 2001 From: Minkyu Kang Date: Wed, 18 Aug 2010 21:06:53 +0900 Subject: [PATCH] S5P: serial: get_uclk needs the device index Signed-off-by: Minkyu Kang --- arch/arm/cpu/armv7/s5pc1xx/clock.c | 11 ++++++++--- arch/arm/include/asm/arch-s5pc1xx/clk.h | 2 +- drivers/serial/serial_s5p.c | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/arm/cpu/armv7/s5pc1xx/clock.c b/arch/arm/cpu/armv7/s5pc1xx/clock.c index 35288fa..6d0cc74 100644 --- a/arch/arm/cpu/armv7/s5pc1xx/clock.c +++ b/arch/arm/cpu/armv7/s5pc1xx/clock.c @@ -38,7 +38,7 @@ #define CONFIG_SYS_CLK_FREQ_C110 24000000 #endif -unsigned long (*get_uclk)(void); +unsigned long (*get_uclk)(int dev_index); unsigned long (*get_pclk)(void); unsigned long (*get_arm_clk)(void); unsigned long (*get_pll_clk)(int); @@ -298,17 +298,22 @@ static unsigned long s5pc100_get_pclk(void) return get_pclkd1(); } +/* s5pc1xx: return uart clock frequency */ +static unsigned long s5pc1xx_get_uclk(int dev_index) +{ + return get_pclk(); +} + void s5p_clock_init(void) { if (cpu_is_s5pc110()) { get_pll_clk = s5pc110_get_pll_clk; get_arm_clk = s5pc110_get_arm_clk; get_pclk = s5pc110_get_pclk; - get_uclk = s5pc110_get_pclk; /* use PCLK */ } else { get_pll_clk = s5pc100_get_pll_clk; get_arm_clk = s5pc100_get_arm_clk; get_pclk = s5pc100_get_pclk; - get_uclk = s5pc100_get_pclk; /* use PCLK */ } + get_uclk = s5pc1xx_get_uclk; } diff --git a/arch/arm/include/asm/arch-s5pc1xx/clk.h b/arch/arm/include/asm/arch-s5pc1xx/clk.h index f52a76e..b4df07d 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/clk.h +++ b/arch/arm/include/asm/arch-s5pc1xx/clk.h @@ -34,6 +34,6 @@ void s5p_clock_init(void); extern unsigned long (*get_pll_clk)(int pllreg); extern unsigned long (*get_arm_clk)(void); extern unsigned long (*get_pclk)(void); -extern unsigned long (*get_uclk)(void); +extern unsigned long (*get_uclk)(int dev_index); #endif diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c index 4e46902..2b2ec2d 100644 --- a/drivers/serial/serial_s5p.c +++ b/drivers/serial/serial_s5p.c @@ -63,7 +63,7 @@ void serial_setbrg_dev(const int dev_index) { DECLARE_GLOBAL_DATA_PTR; struct s5p_uart *const uart = s5p_get_base_uart(dev_index); - u32 uclk = get_uclk(); + u32 uclk = get_uclk(dev_index); u32 baudrate = gd->baudrate; u32 val; -- 2.7.4