]> git.sur5r.net Git - u-boot/commitdiff
mxc_serial replace platform specific clock
authorJohn Rigby <jcrigby@gmail.com>
Wed, 6 Jan 2010 05:34:10 +0000 (22:34 -0700)
committerWolfgang Denk <wd@denx.de>
Wed, 6 Jan 2010 16:17:05 +0000 (17:17 +0100)
remove ifdef'd clock selection code from
serial_mxc.c and replace with call to imx_get_uartclk

Add definitions for imx_get_uartclk to imx31 and imx27
include files.

This makes it easier to add new imx platforms.

Signed-off-by: John Rigby <jcrigby@gmail.com>
drivers/serial/serial_mxc.c
include/asm-arm/arch-mx27/clock.h
include/asm-arm/arch-mx31/mx31.h

index acc5b7d83bd6aad92a5a5e84ae4744c8a053530e..7dcedf6deefeac08126983e99c08b78a68be0b1e 100644 (file)
@@ -166,11 +166,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 void serial_setbrg (void)
 {
-#ifdef CONFIG_MX31
-       u32 clk = mx31_get_ipg_clk();
-#else
-       u32 clk = imx_get_perclk1();
-#endif
+       u32 clk = imx_get_uartclk();
 
        if (!gd->baudrate)
                gd->baudrate = CONFIG_BAUDRATE;
index 5fc75c5d5c2c38ca2a5907c0562fea7d839e3d16..472e8f2427e9a62e8e3cf446f87d90e42c8eade6 100644 (file)
@@ -36,4 +36,6 @@ ulong imx_get_perclk2(void);
 ulong imx_get_perclk3(void);
 ulong imx_get_ahbclk(void);
 
+#define imx_get_uartclk imx_get_perclk1
+
 #endif /* __ASM_ARCH_CLOCK_H */
index 53b9f27333db9547dd3b59e7852bd0ce9409235c..3cc4b350b6d48b7f15873d67040be2d92ff2ee0f 100644 (file)
@@ -25,6 +25,7 @@
 #define __ASM_ARCH_MX31_H
 
 extern u32 mx31_get_ipg_clk(void);
+#define imx_get_uartclk mx31_get_ipg_clk
 extern void mx31_gpio_mux(unsigned long mode);
 
 enum mx31_gpio_direction {