]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
serial_mx31: allow it to work with mx27 too and rename to serial_mxc
authorIlya Yanok <yanok@emcraft.com>
Mon, 8 Jun 2009 00:12:46 +0000 (04:12 +0400)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sun, 21 Jun 2009 14:18:13 +0000 (16:18 +0200)
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>
drivers/serial/Makefile
drivers/serial/serial_mxc.c [moved from drivers/serial/serial_mx31.c with 94% similarity]
include/configs/imx31_litekit.h
include/configs/imx31_phycore.h
include/configs/mx31ads.h
include/configs/qong.h

index ab5d5654d62a736641604e0297862d3aa7947a43..64882a2e8efbeb1e439e5a4f2ee58f36c4e281d3 100644 (file)
@@ -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
similarity index 94%
rename from drivers/serial/serial_mx31.c
rename to drivers/serial/serial_mxc.c
index 7c0682ad77737449089a064f0a4fa167430b3249..acc5b7d83bd6aad92a5a5e84ae4744c8a053530e 100644 (file)
  */
 
 #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)))
 
 #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;
index 9ac6eec3b4519b8fe43a7e7c9c3ba1c9ec00c2f9..74f54c0c785a5217b61df56a1fde820fdd978621 100644 (file)
@@ -60,7 +60,7 @@
  * Hardware drivers
  */
 
-#define CONFIG_MX31_UART       1
+#define CONFIG_MXC_UART        1
 #define CONFIG_SYS_MX31_UART1          1
 
 #define CONFIG_HARD_SPI                1
index cbc0b9259a4c93cced3ba2ca2ba9e93d4aeb0cc5..cb42a7cc96bbadbeea7055e8b8c19be3dbb30d7f 100644 (file)
@@ -64,7 +64,7 @@
 #define CONFIG_SYS_I2C_SPEED           100000
 #define CONFIG_SYS_I2C_SLAVE           0xfe
 
-#define CONFIG_MX31_UART       1
+#define CONFIG_MXC_UART        1
 #define CONFIG_SYS_MX31_UART1          1
 
 /* allow to overwrite serial and ethaddr */
index c31c06acc42242a76fc4b623426b80939fe491f5..363ea1ba1fe62b2d5777a2064fee599ae249a223 100644 (file)
@@ -57,7 +57,7 @@
  * Hardware drivers
  */
 
-#define CONFIG_MX31_UART       1
+#define CONFIG_MXC_UART        1
 #define CONFIG_SYS_MX31_UART1          1
 
 #define CONFIG_HARD_SPI                1
index 7e6718503ee9d3673c64ad9233cfa462989c6e63..64d0214e273ba99b75cff77e810b45aa1eb9e1eb 100644 (file)
@@ -49,7 +49,7 @@
  * Hardware drivers
  */
 
-#define CONFIG_MX31_UART       1
+#define CONFIG_MXC_UART        1
 #define CONFIG_SYS_MX31_UART1  1
 
 /* FPGA */