From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilya Yanok Date: Wed, 6 May 2009 22:30:25 +0400 Subject: [U-Boot] [PATCH 02/10] serial_mx31: allow it to work with mx27 too In-Reply-To: <1241634633-13917-1-git-send-email-yanok@emcraft.com> References: <1241634633-13917-1-git-send-email-yanok@emcraft.com> Message-ID: <1241634633-13917-3-git-send-email-yanok@emcraft.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/serial/serial_mx31.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/drivers/serial/serial_mx31.c b/drivers/serial/serial_mx31.c index 7c0682a..acc5b7d 100644 --- a/drivers/serial/serial_mx31.c +++ b/drivers/serial/serial_mx31.c @@ -18,7 +18,12 @@ */ #include +#ifdef CONFIG_MX31 #include +#else +#include +#include +#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; -- 1.6.0.6