]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
MX: serial_mxc: cleanup removing nasty #ifdef
authorStefano Babic <sbabic@denx.de>
Tue, 22 Nov 2011 14:22:39 +0000 (15:22 +0100)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Tue, 6 Dec 2011 22:59:40 +0000 (23:59 +0100)
The serial driver for iMX SOCs is continuosly changed if a
new SOC or not yet used port is used. CONFIG_SYS_<SOC>_<UART Port>
defines were used only to find the base address for the selected UART.
Instead of that, move the base address to the board configuration
file and drop all #ifdef from driver.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Marek Vasut <marek.vasut@gmail.com>
CC: Wolfgang Denk <wd@denx.de>
CC: Fabio Estevam <fabio.estevam@freescale.com>
CC: Helmut Raiger <helmut.raiger@hale.at>
CC: John Rigby <jcrigby@gmail.com>
CC: Matthias Weisser <weisserm@arcor.de>
CC: Jason Liu <jason.hui@linaro.org>
Acked-by: Jason Liu <jason.hui@linaro.org>
26 files changed:
arch/arm/cpu/arm1136/mx31/devices.c
arch/arm/include/asm/arch-mx25/imx-regs.h
arch/arm/include/asm/arch-mx27/imx-regs.h
arch/arm/include/asm/arch-mx31/imx-regs.h
arch/arm/include/asm/arch-mx35/imx-regs.h
arch/arm/include/asm/arch-mx5/imx-regs.h
drivers/serial/serial_mxc.c
include/configs/efikamx.h
include/configs/flea3.h
include/configs/imx27lite-common.h
include/configs/imx31_litekit.h
include/configs/imx31_phycore.h
include/configs/mx25pdk.h
include/configs/mx31ads.h
include/configs/mx31pdk.h
include/configs/mx35pdk.h
include/configs/mx51evk.h
include/configs/mx53ard.h
include/configs/mx53evk.h
include/configs/mx53loco.h
include/configs/mx53smd.h
include/configs/qong.h
include/configs/tt01.h
include/configs/tx25.h
include/configs/vision2.h
include/configs/zmx25.h

index b42dac3fbedc35c1767ac9b676efdcaec81a5374..2ebee2e96028f9b760508e6bf9a0ac51843e6273 100644 (file)
@@ -27,7 +27,6 @@
 #include <asm/arch/imx-regs.h>
 #include <asm/arch/clock.h>
 
-#ifdef CONFIG_SYS_MX31_UART1
 void mx31_uart1_hw_init(void)
 {
        /* setup pins for UART1 */
@@ -36,9 +35,7 @@ void mx31_uart1_hw_init(void)
        mx31_gpio_mux(MUX_RTS1__UART1_RTS_B);
        mx31_gpio_mux(MUX_CTS1__UART1_CTS_B);
 }
-#endif
 
-#ifdef CONFIG_SYS_MX31_UART2
 void mx31_uart2_hw_init(void)
 {
        /* setup pins for UART2 */
@@ -47,7 +44,6 @@ void mx31_uart2_hw_init(void)
        mx31_gpio_mux(MUX_RTS2__UART2_RTS_B);
        mx31_gpio_mux(MUX_CTS2__UART2_CTS_B);
 }
-#endif
 
 #ifdef CONFIG_MXC_SPI
 /*
index eece138b457660dd9dafaaffbad88e5450bc4ec5..7f9449b2d0659a3614b9cadf4a5784e7de554c1f 100644 (file)
@@ -180,8 +180,8 @@ struct aips_regs {
 #define IMX_I2C3_BASE          (0x43F84000)
 #define IMX_CAN1_BASE          (0x43F88000)
 #define IMX_CAN2_BASE          (0x43F8C000)
-#define IMX_UART1_BASE         (0x43F90000)
-#define IMX_UART2_BASE         (0x43F94000)
+#define UART1_BASE             (0x43F90000)
+#define UART2_BASE             (0x43F94000)
 #define IMX_I2C2_BASE          (0x43F98000)
 #define IMX_OWIRE_BASE         (0x43F9C000)
 #define IMX_CSPI1_BASE         (0x43FA4000)
@@ -197,15 +197,15 @@ struct aips_regs {
 /* SPBA */
 #define IMX_SPBA_BASE          (0x50000000)
 #define IMX_CSPI3_BASE         (0x50004000)
-#define IMX_UART4_BASE         (0x50008000)
-#define IMX_UART3_BASE         (0x5000C000)
+#define UART4_BASE             (0x50008000)
+#define UART3_BASE             (0x5000C000)
 #define IMX_CSPI2_BASE         (0x50010000)
 #define IMX_SSI2_BASE          (0x50014000)
 #define IMX_ESAI_BASE          (0x50018000)
 #define IMX_ATA_DMA_BASE       (0x50020000)
 #define IMX_SIM1_BASE          (0x50024000)
 #define IMX_SIM2_BASE          (0x50028000)
-#define IMX_UART5_BASE         (0x5002C000)
+#define UART5_BASE             (0x5002C000)
 #define IMX_TSC_BASE           (0x50030000)
 #define IMX_SSI1_BASE          (0x50034000)
 #define IMX_FEC_BASE           (0x50038000)
index 83ab216665c45138b9e170b4dfe0486f4b6a3596..ced5b2a38c20e9261ca480d4db6a38f127fbb075 100644 (file)
@@ -224,10 +224,10 @@ struct fuse_bank0_regs {
 #define IMX_TIM1_BASE          (0x03000 + IMX_IO_BASE)
 #define IMX_TIM2_BASE          (0x04000 + IMX_IO_BASE)
 #define IMX_TIM3_BASE          (0x05000 + IMX_IO_BASE)
-#define IMX_UART1_BASE         (0x0a000 + IMX_IO_BASE)
-#define IMX_UART2_BASE         (0x0b000 + IMX_IO_BASE)
-#define IMX_UART3_BASE         (0x0c000 + IMX_IO_BASE)
-#define IMX_UART4_BASE         (0x0d000 + IMX_IO_BASE)
+#define UART1_BASE             (0x0a000 + IMX_IO_BASE)
+#define UART2_BASE             (0x0b000 + IMX_IO_BASE)
+#define UART3_BASE             (0x0c000 + IMX_IO_BASE)
+#define UART4_BASE             (0x0d000 + IMX_IO_BASE)
 #define IMX_I2C1_BASE          (0x12000 + IMX_IO_BASE)
 #define IMX_GPIO_BASE          (0x15000 + IMX_IO_BASE)
 #define IMX_TIM4_BASE          (0x19000 + IMX_IO_BASE)
index 0147920e4b3797293fd6652b5a027e52e72b472a..6a517ddd931ca0d1e598bd7456c4c611741602eb 100644 (file)
@@ -600,6 +600,12 @@ struct esdc_regs {
 #define WEIM_ESDCFG1   0xB800100C
 #define WEIM_ESDMISC   0xB8001010
 
+#define UART1_BASE     0x43F90000
+#define UART2_BASE     0x43F94000
+#define UART3_BASE     0x5000C000
+#define UART4_BASE     0x43FB0000
+#define UART5_BASE     0x43FB4000
+
 #define ESDCTL_SDE                     (1 << 31)
 #define ESDCTL_CMD_RW                  (0 << 28)
 #define ESDCTL_CMD_PRECHARGE           (1 << 28)
index 25c324eb36f06c5b0b22adc982642d30cca280f6..df74508a93ee87ae986f7c2f48f6c5fb36626070 100644 (file)
@@ -42,8 +42,8 @@
 #define I2C_BASE_ADDR           0x43F80000
 #define I2C3_BASE_ADDR          0x43F84000
 #define ATA_BASE_ADDR           0x43F8C000
-#define UART1_BASE_ADDR         0x43F90000
-#define UART2_BASE_ADDR         0x43F94000
+#define UART1_BASE             0x43F90000
+#define UART2_BASE             0x43F94000
 #define I2C2_BASE_ADDR          0x43F98000
 #define CSPI1_BASE_ADDR         0x43FA4000
 #define IOMUXC_BASE_ADDR        0x43FAC000
@@ -52,7 +52,7 @@
  * SPBA
  */
 #define SPBA_BASE_ADDR          0x50000000
-#define UART3_BASE_ADDR         0x5000C000
+#define UART3_BASE             0x5000C000
 #define CSPI2_BASE_ADDR         0x50010000
 #define ATA_DMA_BASE_ADDR       0x50020000
 #define FEC_BASE_ADDR           0x50038000
index d069209b587e9213961dfae6c521f787ef07d478..0ee88d25b7800ae9e6aed809d02dd19d9cac9c82 100644 (file)
@@ -54,7 +54,7 @@
  */
 #define MMC_SDHC1_BASE_ADDR    (SPBA0_BASE_ADDR + 0x00004000)
 #define MMC_SDHC2_BASE_ADDR    (SPBA0_BASE_ADDR + 0x00008000)
-#define UART3_BASE_ADDR        (SPBA0_BASE_ADDR + 0x0000C000)
+#define UART3_BASE             (SPBA0_BASE_ADDR + 0x0000C000)
 #define CSPI1_BASE_ADDR        (SPBA0_BASE_ADDR + 0x00010000)
 #define SSI2_BASE_ADDR         (SPBA0_BASE_ADDR + 0x00014000)
 #define MMC_SDHC3_BASE_ADDR    (SPBA0_BASE_ADDR + 0x00020000)
@@ -83,8 +83,8 @@
 #define EPIT2_BASE_ADDR                (AIPS1_BASE_ADDR + 0x000B0000)
 #define PWM1_BASE_ADDR         (AIPS1_BASE_ADDR + 0x000B4000)
 #define PWM2_BASE_ADDR         (AIPS1_BASE_ADDR + 0x000B8000)
-#define UART1_BASE_ADDR                (AIPS1_BASE_ADDR + 0x000BC000)
-#define UART2_BASE_ADDR                (AIPS1_BASE_ADDR + 0x000C0000)
+#define UART1_BASE             (AIPS1_BASE_ADDR + 0x000BC000)
+#define UART2_BASE             (AIPS1_BASE_ADDR + 0x000C0000)
 #define SRC_BASE_ADDR          (AIPS1_BASE_ADDR + 0x000D0000)
 #define CCM_BASE_ADDR          (AIPS1_BASE_ADDR + 0x000D4000)
 #define GPC_BASE_ADDR          (AIPS1_BASE_ADDR + 0x000D8000)
index dcb4bd16d812fc6a5155431c8a2fba0c037d7060..af00b9c0ec426856eaf716466d087f9cf270cc72 100644 (file)
 
 #define __REG(x)     (*((volatile u32 *)(x)))
 
-#if defined(CONFIG_SYS_MX31_UART1) || defined(CONFIG_SYS_MX25_UART1)
-#define UART_PHYS 0x43f90000
-#elif defined(CONFIG_SYS_MX31_UART2) || defined(CONFIG_SYS_MX25_UART2)
-#define UART_PHYS 0x43f94000
-#elif defined(CONFIG_SYS_MX31_UART3) || defined(CONFIG_SYS_MX25_UART3)
-#define UART_PHYS 0x5000c000
-#elif defined(CONFIG_SYS_MX31_UART4) || defined(CONFIG_SYS_MX25_UART4)
-#define UART_PHYS 0x43fb0000
-#elif defined(CONFIG_SYS_MX31_UART5) || defined(CONFIG_SYS_MX25_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
-#elif defined(CONFIG_SYS_MX35_UART1) || defined(CONFIG_SYS_MX51_UART1) || \
-       defined(CONFIG_SYS_MX53_UART1)
-#define UART_PHYS UART1_BASE_ADDR
-#elif defined(CONFIG_SYS_MX35_UART2) || defined(CONFIG_SYS_MX51_UART2) || \
-       defined(CONFIG_SYS_MX53_UART2)
-#define UART_PHYS UART2_BASE_ADDR
-#elif defined(CONFIG_SYS_MX35_UART3) || defined(CONFIG_SYS_MX51_UART3) || \
-       defined(CONFIG_SYS_MX53_UART3)
-#define UART_PHYS UART3_BASE_ADDR
-#else
-#error "define CONFIG_SYS_MXxx_UARTx to use the MXC UART driver"
+#ifndef CONFIG_MXC_UART_BASE
+#error "define CONFIG_MXC_UART_BASE to use the MXC UART driver"
 #endif
 
+#define UART_PHYS      CONFIG_MXC_UART_BASE
+
 #ifdef CONFIG_SERIAL_MULTI
 #warning "MXC driver does not support MULTI serials."
 #endif
index a07c8b58e3aeb7514a58adf05c497630e8036c3b..2b069d6b7a3badb74b162b7f001bde6f314c169d 100644 (file)
@@ -85,7 +85,7 @@
  * Hardware drivers
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX51_UART1
+#define CONFIG_MXC_UART_BASE           UART1_BASE
 #define CONFIG_CONS_INDEX              1
 #define CONFIG_BAUDRATE                        115200
 #define CONFIG_SYS_BAUDRATE_TABLE      {9600, 19200, 38400, 57600, 115200}
index d88c578a704df9cfe244e924c2dd719760a5c05e..20100c214831957b8fa94e029cb0bb3d3be0e00d 100644 (file)
@@ -77,7 +77,7 @@
  * UART (console)
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX35_UART3
+#define CONFIG_MXC_UART_BASE   UART3_BASE
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
index 6953a800d5b083f5c7bde8807fc42bb8430d6ebd..2af4e7af3144f211aa2a0e1e971ec9eacdb08285 100644 (file)
  * Serial Driver info
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX27_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
 #define CONFIG_BAUDRATE                115200          /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
index 1455ea247a888aa94838154e86a1c01ce4ba8898..bbcbce1200b1256df1acdc3695f4e98d6f2b5a15 100644 (file)
@@ -63,8 +63,8 @@
  * Hardware drivers
  */
 
-#define CONFIG_MXC_UART        1
-#define CONFIG_SYS_MX31_UART1          1
+#define CONFIG_MXC_UART
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_HARD_SPI                1
index 1b75197c587ec9911d6258d1fb84bcbe75ece15f..3153eb5b396fd94e46153287d6331425373b57c0 100644 (file)
@@ -59,7 +59,7 @@
 #define CONFIG_SYS_I2C_SLAVE           0xfe
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX31_UART1
+#define CONFIG_MXC_UART_BASE           UART1_BASE
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
index 8414376edd9b22d16b5da189394a06faece6eb4c..d1ba02b6eedcd8875572c2f56e93a6cb9f5cd080 100644 (file)
@@ -54,7 +54,7 @@
 
 /* Serial Info */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX25_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_CONS_INDEX      1       /* use UART0 for console */
 #define CONFIG_BAUDRATE                115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
index 7e011aea9df3f4e038d262bbfe7a5c35d4348538..87638a4fa52fa7b87d89140bfd93a32113806e4e 100644 (file)
@@ -60,8 +60,8 @@
  * Hardware drivers
  */
 
-#define CONFIG_MXC_UART        1
-#define CONFIG_SYS_MX31_UART1          1
+#define CONFIG_MXC_UART
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 #define CONFIG_HARD_SPI                1
 #define CONFIG_MXC_SPI         1
index 4253c3e2bcf037188dcedad647b42b9dab9dffdf..4da6020c8cfbac6c1a9c3e1c62b9302365349971 100644 (file)
@@ -61,7 +61,7 @@
  */
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX31_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_HW_WATCHDOG
 #define CONFIG_MXC_GPIO
 
index 32ed6096ae1990c2afacd8104904be3a33da5aa5..0c62b9fdfb3deb2f6f605dd053fcd1c383e60f32 100644 (file)
@@ -85,7 +85,7 @@
  * UART (console)
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX35_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 /* allow to overwrite serial and ethaddr */
 #define CONFIG_ENV_OVERWRITE
index 7c7544f5a83c57b7377d0c0b52d1e38d79418176..dd53f48b9aab4d077cbe1e25ccb522b632887a14 100644 (file)
@@ -59,7 +59,7 @@
  * Hardware drivers
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX51_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_MXC_GPIO
 
 /*
index 15dfcb49ed1b5b173ed49dca29bd75b8a4593b02..f48a41ebc582c092d7d302e99719fbd72d8a4c20 100644 (file)
@@ -44,7 +44,7 @@
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX53_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
index 7c491360f2efc2357676ae746fb1721ff04327c3..11fe6efe626517403cb003374259227b27cd395d 100644 (file)
@@ -47,7 +47,7 @@
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX53_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
index d6990107db43de23734757ae253517a1e6dc9438..537649ee164f0fec1c915177968213ededca7494 100644 (file)
@@ -45,7 +45,7 @@
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX53_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 /* MMC Configs */
 #define CONFIG_FSL_ESDHC
index 48b32ddab689a946acd759ec6bd20a23c20265c8..032f72261e6ae0a8f055cf59dbfad50648e450fa 100644 (file)
@@ -44,7 +44,7 @@
 #define CONFIG_MXC_GPIO
 
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX53_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 /* I2C Configs */
 #define CONFIG_CMD_I2C
index 3346802d13f0f7011a6fb4027242d21a78df2487..3e36bb0788495dfaf9ddfe8df608cd0646c496b8 100644 (file)
@@ -49,8 +49,8 @@
  * Hardware drivers
  */
 
-#define CONFIG_MXC_UART        1
-#define CONFIG_SYS_MX31_UART1  1
+#define CONFIG_MXC_UART
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 
 #define CONFIG_MXC_GPIO
 #define CONFIG_HW_WATCHDOG
index 6ef25cd6477755a94cf63dd3fe25c30ced5530c4..a553712699b6b2a4b6be02c10036785e54cde359 100644 (file)
  * make sure that the transceiver is enabled during PL=1 for testing!
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX31_UART2
+#define CONFIG_MXC_UART_BASE   UART2_BASE
 
 #define CONFIG_MXC_SPI
 #define CONFIG_MXC_GPIO
index f77c546687cee27b4c81d557666c19e53252eaa4..87bd8a6756ca98e2948a6bb2b91182a6b148e559 100644 (file)
@@ -90,7 +90,7 @@
  * Serial Info
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX25_UART1
+#define CONFIG_MXC_UART_BASE   UART1_BASE
 #define CONFIG_CONS_INDEX      1       /* use UART0 for console */
 #define CONFIG_BAUDRATE                115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }
index f321ad2dbc3ff5950c50a583a7440b3a8b9a1324..35b71f79e6320aaaa3588b0c9e57cb0422b8798b 100644 (file)
@@ -54,7 +54,7 @@
  * Hardware drivers
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX51_UART3
+#define CONFIG_MXC_UART_BASE   UART3_BASE
 #define CONFIG_MXC_GPIO
 #define CONFIG_MXC_SPI
 #define CONFIG_HW_WATCHDOG
index 9a7a27ac1d45cfc79ac7d28bdf7c2f0e4bd40686..599d5bb42aacc9f3a9b24106b958f27a763c6acc 100644 (file)
@@ -66,7 +66,7 @@
  * Serial
  */
 #define CONFIG_MXC_UART
-#define CONFIG_SYS_MX25_UART2
+#define CONFIG_MXC_UART_BASE   UART2_BASE
 #define CONFIG_CONS_INDEX      1       /* use UART2 for console */
 #define CONFIG_BAUDRATE                115200  /* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE      { 9600, 19200, 38400, 57600, 115200 }