From 862711154339be2af723adcbde217743de781e81 Mon Sep 17 00:00:00 2001 From: Stefano Babic Date: Mon, 14 Mar 2011 15:43:56 +0100 Subject: [PATCH] IMX: MX31: Cleanup include files and drop nasty #ifdef in drivers As exception among the i.MX processors, the i.MX31 has headers without general names (mx31-regs.h, mx31.h instead of imx-regs.h and clock.h). This requires several nasty #ifdef in the drivers to include the correct header. The patch cleans up the driver and renames the header files as for the other i.MX processors. Signed-off-by: Stefano Babic --- arch/arm/cpu/arm1136/mx31/devices.c | 4 ++-- arch/arm/cpu/arm1136/mx31/generic.c | 2 +- arch/arm/cpu/arm1136/mx31/timer.c | 2 +- arch/arm/include/asm/arch-mx31/{mx31.h => clock.h} | 6 +++--- .../include/asm/arch-mx31/{mx31-regs.h => imx-regs.h} | 0 board/davedenx/qong/fpga.c | 4 ++-- board/davedenx/qong/lowlevel_init.S | 2 +- board/davedenx/qong/qong.c | 4 ++-- board/freescale/mx31ads/lowlevel_init.S | 2 +- board/freescale/mx31ads/mx31ads.c | 4 ++-- board/freescale/mx31pdk/lowlevel_init.S | 2 +- board/freescale/mx31pdk/mx31pdk.c | 4 ++-- board/imx31_phycore/imx31_phycore.c | 4 ++-- board/imx31_phycore/lowlevel_init.S | 2 +- board/logicpd/imx31_litekit/imx31_litekit.c | 4 ++-- board/logicpd/imx31_litekit/lowlevel_init.S | 2 +- drivers/gpio/mxc_gpio.c | 5 ----- drivers/i2c/mxc_i2c.c | 7 +------ drivers/serial/serial_mxc.c | 4 ---- drivers/spi/mxc_spi.c | 9 ++------- drivers/usb/host/ehci-mxc.c | 2 +- drivers/video/mx3fb.c | 6 +++--- include/configs/imx31_litekit.h | 2 +- include/configs/mx31ads.h | 2 +- include/configs/mx31pdk.h | 2 +- include/configs/qong.h | 2 +- nand_spl/nand_boot_fsl_nfc.c | 4 ---- 27 files changed, 35 insertions(+), 58 deletions(-) rename arch/arm/include/asm/arch-mx31/{mx31.h => clock.h} (92%) rename arch/arm/include/asm/arch-mx31/{mx31-regs.h => imx-regs.h} (100%) diff --git a/arch/arm/cpu/arm1136/mx31/devices.c b/arch/arm/cpu/arm1136/mx31/devices.c index 1f4ca7eb44..1e7d48f8fb 100644 --- a/arch/arm/cpu/arm1136/mx31/devices.c +++ b/arch/arm/cpu/arm1136/mx31/devices.c @@ -24,8 +24,8 @@ */ #include -#include -#include +#include +#include #ifdef CONFIG_SYS_MX31_UART1 void mx31_uart1_hw_init(void) diff --git a/arch/arm/cpu/arm1136/mx31/generic.c b/arch/arm/cpu/arm1136/mx31/generic.c index 8bd23ee870..fa07fec60d 100644 --- a/arch/arm/cpu/arm1136/mx31/generic.c +++ b/arch/arm/cpu/arm1136/mx31/generic.c @@ -22,7 +22,7 @@ */ #include -#include +#include #include static u32 mx31_decode_pll(u32 reg, u32 infreq) diff --git a/arch/arm/cpu/arm1136/mx31/timer.c b/arch/arm/cpu/arm1136/mx31/timer.c index 27c340fd9e..c4bc3b3521 100644 --- a/arch/arm/cpu/arm1136/mx31/timer.c +++ b/arch/arm/cpu/arm1136/mx31/timer.c @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include #include diff --git a/arch/arm/include/asm/arch-mx31/mx31.h b/arch/arm/include/asm/arch-mx31/clock.h similarity index 92% rename from arch/arm/include/asm/arch-mx31/mx31.h rename to arch/arm/include/asm/arch-mx31/clock.h index a755212f0d..8dc6e82bc6 100644 --- a/arch/arm/include/asm/arch-mx31/mx31.h +++ b/arch/arm/include/asm/arch-mx31/clock.h @@ -21,8 +21,8 @@ * MA 02111-1307 USA */ -#ifndef __ASM_ARCH_MX31_H -#define __ASM_ARCH_MX31_H +#ifndef __ASM_ARCH_CLOCK_H +#define __ASM_ARCH_CLOCK_H extern u32 mx31_get_ipg_clk(void); #define imx_get_uartclk mx31_get_ipg_clk @@ -32,4 +32,4 @@ extern void mx31_set_pad(enum iomux_pins pin, u32 config); void mx31_uart1_hw_init(void); void mx31_spi2_hw_init(void); -#endif /* __ASM_ARCH_MX31_H */ +#endif /* __ASM_ARCH_CLOCK_H */ diff --git a/arch/arm/include/asm/arch-mx31/mx31-regs.h b/arch/arm/include/asm/arch-mx31/imx-regs.h similarity index 100% rename from arch/arm/include/asm/arch-mx31/mx31-regs.h rename to arch/arm/include/asm/arch-mx31/imx-regs.h diff --git a/board/davedenx/qong/fpga.c b/board/davedenx/qong/fpga.c index 656d5cde95..789acf0696 100644 --- a/board/davedenx/qong/fpga.c +++ b/board/davedenx/qong/fpga.c @@ -23,8 +23,8 @@ */ #include -#include -#include +#include +#include #include #include #include diff --git a/board/davedenx/qong/lowlevel_init.S b/board/davedenx/qong/lowlevel_init.S index 80bed92329..85fbfc3646 100644 --- a/board/davedenx/qong/lowlevel_init.S +++ b/board/davedenx/qong/lowlevel_init.S @@ -20,7 +20,7 @@ * MA 02111-1307 USA */ -#include +#include .macro REG reg, val ldr r2, =\reg diff --git a/board/davedenx/qong/qong.c b/board/davedenx/qong/qong.c index 3ace6cdfff..b1238d505a 100644 --- a/board/davedenx/qong/qong.c +++ b/board/davedenx/qong/qong.c @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/board/freescale/mx31ads/lowlevel_init.S b/board/freescale/mx31ads/lowlevel_init.S index e16605836b..5c18bc1964 100644 --- a/board/freescale/mx31ads/lowlevel_init.S +++ b/board/freescale/mx31ads/lowlevel_init.S @@ -17,7 +17,7 @@ * MA 02111-1307 USA */ -#include +#include .macro REG reg, val ldr r2, =\reg diff --git a/board/freescale/mx31ads/mx31ads.c b/board/freescale/mx31ads/mx31ads.c index bc25c6deb5..a298e0530f 100644 --- a/board/freescale/mx31ads/mx31ads.c +++ b/board/freescale/mx31ads/mx31ads.c @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/freescale/mx31pdk/lowlevel_init.S b/board/freescale/mx31pdk/lowlevel_init.S index cd0503ec3a..5b35bb4762 100644 --- a/board/freescale/mx31pdk/lowlevel_init.S +++ b/board/freescale/mx31pdk/lowlevel_init.S @@ -21,7 +21,7 @@ */ #include -#include +#include #include .globl lowlevel_init diff --git a/board/freescale/mx31pdk/mx31pdk.c b/board/freescale/mx31pdk/mx31pdk.c index a9f0fb477a..3f291fc84f 100644 --- a/board/freescale/mx31pdk/mx31pdk.c +++ b/board/freescale/mx31pdk/mx31pdk.c @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/imx31_phycore/imx31_phycore.c b/board/imx31_phycore/imx31_phycore.c index 3d7b7f70ce..82daaa3245 100644 --- a/board/imx31_phycore/imx31_phycore.c +++ b/board/imx31_phycore/imx31_phycore.c @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/imx31_phycore/lowlevel_init.S b/board/imx31_phycore/lowlevel_init.S index c5d6eb05fe..c47137d097 100644 --- a/board/imx31_phycore/lowlevel_init.S +++ b/board/imx31_phycore/lowlevel_init.S @@ -21,7 +21,7 @@ * MA 02111-1307 USA */ -#include +#include .macro REG reg, val ldr r2, =\reg diff --git a/board/logicpd/imx31_litekit/imx31_litekit.c b/board/logicpd/imx31_litekit/imx31_litekit.c index a07ba0efc7..2ed742fb56 100644 --- a/board/logicpd/imx31_litekit/imx31_litekit.c +++ b/board/logicpd/imx31_litekit/imx31_litekit.c @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include DECLARE_GLOBAL_DATA_PTR; diff --git a/board/logicpd/imx31_litekit/lowlevel_init.S b/board/logicpd/imx31_litekit/lowlevel_init.S index 0003a42424..95b0c080c5 100644 --- a/board/logicpd/imx31_litekit/lowlevel_init.S +++ b/board/logicpd/imx31_litekit/lowlevel_init.S @@ -21,7 +21,7 @@ * MA 02111-1307 USA */ -#include +#include .macro REG reg, val ldr r2, =\reg diff --git a/drivers/gpio/mxc_gpio.c b/drivers/gpio/mxc_gpio.c index 53a0673414..103786209c 100644 --- a/drivers/gpio/mxc_gpio.c +++ b/drivers/gpio/mxc_gpio.c @@ -21,12 +21,7 @@ * MA 02111-1307 USA */ #include -#ifdef CONFIG_MX31 -#include -#endif -#if defined(CONFIG_MX51) || defined(CONFIG_MX53) #include -#endif #include #include diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index c5ec486a7b..89d1973bf5 100644 --- a/drivers/i2c/mxc_i2c.c +++ b/drivers/i2c/mxc_i2c.c @@ -27,13 +27,8 @@ #if defined(CONFIG_HARD_I2C) -#if defined(CONFIG_MX31) -#include -#include -#else -#include #include -#endif +#include #define IADR 0x00 #define IFDR 0x04 diff --git a/drivers/serial/serial_mxc.c b/drivers/serial/serial_mxc.c index b9cf9de740..dcb4bd16d8 100644 --- a/drivers/serial/serial_mxc.c +++ b/drivers/serial/serial_mxc.c @@ -19,12 +19,8 @@ #include #include -#ifdef CONFIG_MX31 -#include -#else #include #include -#endif #define __REG(x) (*((volatile u32 *)(x))) diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index 6474eb802d..f909e076ea 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -24,6 +24,8 @@ #include #include #include +#include +#include #ifdef CONFIG_MX27 /* i.MX27 has a completely wrong register layout and register definitions in the @@ -34,8 +36,6 @@ #elif defined(CONFIG_MX31) -#include - #define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_MODE (1 << 1) #define MXC_CSPICTRL_XCH (1 << 2) @@ -63,8 +63,6 @@ static unsigned long spi_bases[] = { #define mxc_get_clock(x) mx31_get_ipg_clk() #elif defined(CONFIG_MX51) -#include -#include #define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_MODE (1 << 1) @@ -97,9 +95,6 @@ static unsigned long spi_bases[] = { #elif defined(CONFIG_MX35) -#include -#include - #define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_MODE (1 << 1) #define MXC_CSPICTRL_XCH (1 << 2) diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index 8d7b3804fa..6af35aba5f 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/video/mx3fb.c b/drivers/video/mx3fb.c index 6dd952cbbe..0c925a03f3 100644 --- a/drivers/video/mx3fb.c +++ b/drivers/video/mx3fb.c @@ -22,8 +22,8 @@ */ #include #include -#include -#include +#include +#include #include DECLARE_GLOBAL_DATA_PTR; @@ -192,7 +192,7 @@ enum ipu_panel { }; /* IPU Common registers */ -/* IPU_CONF and its bits already defined in mx31-regs.h */ +/* IPU_CONF and its bits already defined in imx-regs.h */ #define IPU_CHA_BUF0_RDY (0x04 + IPU_BASE) #define IPU_CHA_BUF1_RDY (0x08 + IPU_BASE) #define IPU_CHA_DB_MODE_SEL (0x0C + IPU_BASE) diff --git a/include/configs/imx31_litekit.h b/include/configs/imx31_litekit.h index 5023638070..9405f562c4 100644 --- a/include/configs/imx31_litekit.h +++ b/include/configs/imx31_litekit.h @@ -28,7 +28,7 @@ #ifndef __CONFIG_H #define __CONFIG_H -#include +#include /* High Level Configuration Options */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ diff --git a/include/configs/mx31ads.h b/include/configs/mx31ads.h index d2798e974b..5ea59b4ab7 100644 --- a/include/configs/mx31ads.h +++ b/include/configs/mx31ads.h @@ -22,7 +22,7 @@ #ifndef __CONFIG_H #define __CONFIG_H -#include +#include /* High Level Configuration Options */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h index 86c758f2ae..d4c6d16102 100644 --- a/include/configs/mx31pdk.h +++ b/include/configs/mx31pdk.h @@ -30,7 +30,7 @@ #ifndef __CONFIG_H #define __CONFIG_H -#include +#include /* High Level Configuration Options */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ diff --git a/include/configs/qong.h b/include/configs/qong.h index 299db5eef9..c61a689e57 100644 --- a/include/configs/qong.h +++ b/include/configs/qong.h @@ -22,7 +22,7 @@ #ifndef __CONFIG_H #define __CONFIG_H -#include +#include /* High Level Configuration Options */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ diff --git a/nand_spl/nand_boot_fsl_nfc.c b/nand_spl/nand_boot_fsl_nfc.c index a3f0f6ba51..d6b0d9b6d1 100644 --- a/nand_spl/nand_boot_fsl_nfc.c +++ b/nand_spl/nand_boot_fsl_nfc.c @@ -26,11 +26,7 @@ #include #include -#ifdef CONFIG_MX31 -#include -#else #include -#endif #include #include -- 2.39.5