Skip to content
Snippets Groups Projects
Commit 47d19da4 authored by Ilya Yanok's avatar Ilya Yanok Committed by Jean-Christophe PLAGNIOL-VILLARD
Browse files

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: default avatarIlya Yanok <yanok@emcraft.com>
parent 1dc4da74
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o ...@@ -41,7 +41,7 @@ COBJS-$(CONFIG_KS8695_SERIAL) += serial_ks8695.o
COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o COBJS-$(CONFIG_LPC2292_SERIAL) += serial_lpc2292.o
COBJS-$(CONFIG_LH7A40X_SERIAL) += serial_lh7a40x.o COBJS-$(CONFIG_LH7A40X_SERIAL) += serial_lh7a40x.o
COBJS-$(CONFIG_MAX3100_SERIAL) += serial_max3100.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_NETARM_SERIAL) += serial_netarm.o
COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o COBJS-$(CONFIG_PL010_SERIAL) += serial_pl01x.o
COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o COBJS-$(CONFIG_PL011_SERIAL) += serial_pl01x.o
......
...@@ -18,7 +18,12 @@ ...@@ -18,7 +18,12 @@
*/ */
#include <common.h> #include <common.h>
#ifdef CONFIG_MX31
#include <asm/arch/mx31.h> #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 __REG(x) (*((volatile u32 *)(x)))
...@@ -32,6 +37,18 @@ ...@@ -32,6 +37,18 @@
#define UART_PHYS 0x43fb0000 #define UART_PHYS 0x43fb0000
#elif defined(CONFIG_SYS_MX31_UART5) #elif defined(CONFIG_SYS_MX31_UART5)
#define UART_PHYS 0x43fb4000 #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 #else
#error "define CONFIG_SYS_MX31_UARTx to use the mx31 UART driver" #error "define CONFIG_SYS_MX31_UARTx to use the mx31 UART driver"
#endif #endif
...@@ -149,7 +166,11 @@ DECLARE_GLOBAL_DATA_PTR; ...@@ -149,7 +166,11 @@ DECLARE_GLOBAL_DATA_PTR;
void serial_setbrg (void) void serial_setbrg (void)
{ {
#ifdef CONFIG_MX31
u32 clk = mx31_get_ipg_clk(); u32 clk = mx31_get_ipg_clk();
#else
u32 clk = imx_get_perclk1();
#endif
if (!gd->baudrate) if (!gd->baudrate)
gd->baudrate = CONFIG_BAUDRATE; gd->baudrate = CONFIG_BAUDRATE;
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
* Hardware drivers * Hardware drivers
*/ */
#define CONFIG_MX31_UART 1 #define CONFIG_MXC_UART 1
#define CONFIG_SYS_MX31_UART1 1 #define CONFIG_SYS_MX31_UART1 1
#define CONFIG_HARD_SPI 1 #define CONFIG_HARD_SPI 1
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#define CONFIG_SYS_I2C_SPEED 100000 #define CONFIG_SYS_I2C_SPEED 100000
#define CONFIG_SYS_I2C_SLAVE 0xfe #define CONFIG_SYS_I2C_SLAVE 0xfe
#define CONFIG_MX31_UART 1 #define CONFIG_MXC_UART 1
#define CONFIG_SYS_MX31_UART1 1 #define CONFIG_SYS_MX31_UART1 1
/* allow to overwrite serial and ethaddr */ /* allow to overwrite serial and ethaddr */
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
* Hardware drivers * Hardware drivers
*/ */
#define CONFIG_MX31_UART 1 #define CONFIG_MXC_UART 1
#define CONFIG_SYS_MX31_UART1 1 #define CONFIG_SYS_MX31_UART1 1
#define CONFIG_HARD_SPI 1 #define CONFIG_HARD_SPI 1
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
* Hardware drivers * Hardware drivers
*/ */
#define CONFIG_MX31_UART 1 #define CONFIG_MXC_UART 1
#define CONFIG_SYS_MX31_UART1 1 #define CONFIG_SYS_MX31_UART1 1
/* FPGA */ /* FPGA */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment