diff options
author | Ilya Yanok <yanok@emcraft.com> | 2009-06-08 04:12:46 +0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2009-06-21 16:18:13 +0200 |
commit | 47d19da4d3f9ac4787abe9dee32406478424be52 (patch) | |
tree | f2d0519baf74499304dbf00dfa2c996d6b3a6413 /drivers | |
parent | 1dc4da749dbde27ec862f5b65703e8e4541fbba3 (diff) | |
download | u-boot-imx-47d19da4d3f9ac4787abe9dee32406478424be52.zip u-boot-imx-47d19da4d3f9ac4787abe9dee32406478424be52.tar.gz u-boot-imx-47d19da4d3f9ac4787abe9dee32406478424be52.tar.bz2 |
serial_mx31: allow it to work with mx27 too and rename to serial_mxc
UART hardware on i.MX27 is the same as on the i.MX31 so we just
need to provide the driver with correct address of the registers.
Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/serial/Makefile | 2 | ||||
-rw-r--r-- | drivers/serial/serial_mxc.c (renamed from drivers/serial/serial_mx31.c) | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile index ab5d565..64882a2 100644 --- a/drivers/serial/Makefile +++ b/drivers/serial/Makefile @@ -41,7 +41,7 @@ COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o COBJS-$(CONFIG_LH7A40X_SERIAL) += serial_lh7a40x.o COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.o -COBJS-$(CONFIG_MX31_UART) += serial_mx31.o +COBJS-$(CONFIG_MXC_UART) += serial_mxc.o COBJS-$(CONFIG_NETARM_SERIAL) += serial_netarm.o COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o diff --git a/drivers/serial/serial_mx31.c b/drivers/serial/serial_mxc.c index 7c0682a..acc5b7d 100644 --- a/drivers/serial/serial_mx31.c +++ b/drivers/serial/serial_mxc.c @@ -18,7 +18,12 @@ */ #include <common.h> +#ifdef CONFIG_MX31 #include <asm/arch/mx31.h> +#else +#include <asm/arch/imx-regs.h> +#include <asm/arch/clock.h> +#endif #define __REG(x) (*((volatile u32 *)(x))) @@ -32,6 +37,18 @@ #define UART_PHYS 0x43fb0000 #elif defined(CONFIG_SYS_MX31_UART5) #define UART_PHYS 0x43fb4000 +#elif defined(CONFIG_SYS_MX27_UART1) +#define UART_PHYS 0x1000a000 +#elif defined(CONFIG_SYS_MX27_UART2) +#define UART_PHYS 0x1000b000 +#elif defined(CONFIG_SYS_MX27_UART3) +#define UART_PHYS 0x1000c000 +#elif defined(CONFIG_SYS_MX27_UART4) +#define UART_PHYS 0x1000d000 +#elif defined(CONFIG_SYS_MX27_UART5) +#define UART_PHYS 0x1001b000 +#elif defined(CONFIG_SYS_MX27_UART6) +#define UART_PHYS 0x1001c000 #else #error "define CONFIG_SYS_MX31_UARTx to use the mx31 UART driver" #endif @@ -149,7 +166,11 @@ DECLARE_GLOBAL_DATA_PTR; void serial_setbrg (void) { +#ifdef CONFIG_MX31 u32 clk = mx31_get_ipg_clk(); +#else + u32 clk = imx_get_perclk1(); +#endif if (!gd->baudrate) gd->baudrate = CONFIG_BAUDRATE; |