Commit 86271115 authored by Stefano Babic's avatar Stefano Babic Committed by Albert ARIBAUD

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: default avatarStefano Babic <sbabic@denx.de>
parent dcd441c3
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
*/ */
#include <common.h> #include <common.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#ifdef CONFIG_SYS_MX31_UART1 #ifdef CONFIG_SYS_MX31_UART1
void mx31_uart1_hw_init(void) void mx31_uart1_hw_init(void)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
#include <common.h> #include <common.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/io.h> #include <asm/io.h>
static u32 mx31_decode_pll(u32 reg, u32 infreq) static u32 mx31_decode_pll(u32 reg, u32 infreq)
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
#include <common.h> #include <common.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <div64.h> #include <div64.h>
#include <watchdog.h> #include <watchdog.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#ifndef __ASM_ARCH_MX31_H #ifndef __ASM_ARCH_CLOCK_H
#define __ASM_ARCH_MX31_H #define __ASM_ARCH_CLOCK_H
extern u32 mx31_get_ipg_clk(void); extern u32 mx31_get_ipg_clk(void);
#define imx_get_uartclk mx31_get_ipg_clk #define imx_get_uartclk mx31_get_ipg_clk
...@@ -32,4 +32,4 @@ extern void mx31_set_pad(enum iomux_pins pin, u32 config); ...@@ -32,4 +32,4 @@ extern void mx31_set_pad(enum iomux_pins pin, u32 config);
void mx31_uart1_hw_init(void); void mx31_uart1_hw_init(void);
void mx31_spi2_hw_init(void); void mx31_spi2_hw_init(void);
#endif /* __ASM_ARCH_MX31_H */ #endif /* __ASM_ARCH_CLOCK_H */
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
*/ */
#include <common.h> #include <common.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <mxc_gpio.h> #include <mxc_gpio.h>
#include <fpga.h> #include <fpga.h>
#include <lattice.h> #include <lattice.h>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
.macro REG reg, val .macro REG reg, val
ldr r2, =\reg ldr r2, =\reg
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <common.h> #include <common.h>
#include <netdev.h> #include <netdev.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/io.h> #include <asm/io.h>
#include <nand.h> #include <nand.h>
#include <fsl_pmic.h> #include <fsl_pmic.h>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
.macro REG reg, val .macro REG reg, val
ldr r2, =\reg ldr r2, =\reg
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
#include <common.h> #include <common.h>
#include <netdev.h> #include <netdev.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
*/ */
#include <config.h> #include <config.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/macro.h> #include <asm/macro.h>
.globl lowlevel_init .globl lowlevel_init
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
#include <common.h> #include <common.h>
#include <netdev.h> #include <netdev.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
......
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include <common.h> #include <common.h>
#include <s6e63d6.h> #include <s6e63d6.h>
#include <netdev.h> #include <netdev.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
.macro REG reg, val .macro REG reg, val
ldr r2, =\reg ldr r2, =\reg
......
...@@ -24,8 +24,8 @@ ...@@ -24,8 +24,8 @@
#include <common.h> #include <common.h>
#include <netdev.h> #include <netdev.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
.macro REG reg, val .macro REG reg, val
ldr r2, =\reg ldr r2, =\reg
......
...@@ -21,12 +21,7 @@ ...@@ -21,12 +21,7 @@
* MA 02111-1307 USA * MA 02111-1307 USA
*/ */
#include <common.h> #include <common.h>
#ifdef CONFIG_MX31
#include <asm/arch/mx31-regs.h>
#endif
#if defined(CONFIG_MX51) || defined(CONFIG_MX53)
#include <asm/arch/imx-regs.h> #include <asm/arch/imx-regs.h>
#endif
#include <asm/io.h> #include <asm/io.h>
#include <mxc_gpio.h> #include <mxc_gpio.h>
......
...@@ -27,13 +27,8 @@ ...@@ -27,13 +27,8 @@
#if defined(CONFIG_HARD_I2C) #if defined(CONFIG_HARD_I2C)
#if defined(CONFIG_MX31)
#include <asm/arch/mx31.h>
#include <asm/arch/mx31-regs.h>
#else
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>
#endif #include <asm/arch/imx-regs.h>
#define IADR 0x00 #define IADR 0x00
#define IFDR 0x04 #define IFDR 0x04
......
...@@ -19,12 +19,8 @@ ...@@ -19,12 +19,8 @@
#include <common.h> #include <common.h>
#include <watchdog.h> #include <watchdog.h>
#ifdef CONFIG_MX31
#include <asm/arch/mx31.h>
#else
#include <asm/arch/imx-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>
#endif
#define __REG(x) (*((volatile u32 *)(x))) #define __REG(x) (*((volatile u32 *)(x)))
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/io.h> #include <asm/io.h>
#include <mxc_gpio.h> #include <mxc_gpio.h>
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
#ifdef CONFIG_MX27 #ifdef CONFIG_MX27
/* i.MX27 has a completely wrong register layout and register definitions in the /* i.MX27 has a completely wrong register layout and register definitions in the
...@@ -34,8 +36,6 @@ ...@@ -34,8 +36,6 @@
#elif defined(CONFIG_MX31) #elif defined(CONFIG_MX31)
#include <asm/arch/mx31.h>
#define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_EN (1 << 0)
#define MXC_CSPICTRL_MODE (1 << 1) #define MXC_CSPICTRL_MODE (1 << 1)
#define MXC_CSPICTRL_XCH (1 << 2) #define MXC_CSPICTRL_XCH (1 << 2)
...@@ -63,8 +63,6 @@ static unsigned long spi_bases[] = { ...@@ -63,8 +63,6 @@ static unsigned long spi_bases[] = {
#define mxc_get_clock(x) mx31_get_ipg_clk() #define mxc_get_clock(x) mx31_get_ipg_clk()
#elif defined(CONFIG_MX51) #elif defined(CONFIG_MX51)
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
#define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_EN (1 << 0)
#define MXC_CSPICTRL_MODE (1 << 1) #define MXC_CSPICTRL_MODE (1 << 1)
...@@ -97,9 +95,6 @@ static unsigned long spi_bases[] = { ...@@ -97,9 +95,6 @@ static unsigned long spi_bases[] = {
#elif defined(CONFIG_MX35) #elif defined(CONFIG_MX35)
#include <asm/arch/imx-regs.h>
#include <asm/arch/clock.h>
#define MXC_CSPICTRL_EN (1 << 0) #define MXC_CSPICTRL_EN (1 << 0)
#define MXC_CSPICTRL_MODE (1 << 1) #define MXC_CSPICTRL_MODE (1 << 1)
#define MXC_CSPICTRL_XCH (1 << 2) #define MXC_CSPICTRL_XCH (1 << 2)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <common.h> #include <common.h>
#include <usb.h> #include <usb.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <usb/ehci-fsl.h> #include <usb/ehci-fsl.h>
#include <errno.h> #include <errno.h>
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
*/ */
#include <common.h> #include <common.h>
#include <lcd.h> #include <lcd.h>
#include <asm/arch/mx31.h> #include <asm/arch/clock.h>
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
#include <asm/errno.h> #include <asm/errno.h>
DECLARE_GLOBAL_DATA_PTR; DECLARE_GLOBAL_DATA_PTR;
...@@ -192,7 +192,7 @@ enum ipu_panel { ...@@ -192,7 +192,7 @@ enum ipu_panel {
}; };
/* IPU Common registers */ /* 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_BUF0_RDY (0x04 + IPU_BASE)
#define IPU_CHA_BUF1_RDY (0x08 + IPU_BASE) #define IPU_CHA_BUF1_RDY (0x08 + IPU_BASE)
#define IPU_CHA_DB_MODE_SEL (0x0C + IPU_BASE) #define IPU_CHA_DB_MODE_SEL (0x0C + IPU_BASE)
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#ifndef __CONFIG_H #ifndef __CONFIG_H
#define __CONFIG_H #define __CONFIG_H
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
/* High Level Configuration Options */ /* High Level Configuration Options */
#define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#ifndef __CONFIG_H #ifndef __CONFIG_H
#define __CONFIG_H #define __CONFIG_H
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
/* High Level Configuration Options */ /* High Level Configuration Options */
#define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#ifndef __CONFIG_H #ifndef __CONFIG_H
#define __CONFIG_H #define __CONFIG_H
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
/* High Level Configuration Options */ /* High Level Configuration Options */
#define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#ifndef __CONFIG_H #ifndef __CONFIG_H
#define __CONFIG_H #define __CONFIG_H
#include <asm/arch/mx31-regs.h> #include <asm/arch/imx-regs.h>
/* High Level Configuration Options */ /* High Level Configuration Options */
#define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */ #define CONFIG_ARM1136 1 /* This is an arm1136 CPU core */
......
...@@ -26,11 +26,7 @@ ...@@ -26,11 +26,7 @@
#include <common.h> #include <common.h>
#include <nand.h> #include <nand.h>
#ifdef CONFIG_MX31
#include <asm/arch/mx31-regs.h>
#else
#include <asm/arch/imx-regs.h> #include <asm/arch/imx-regs.h>
#endif
#include <asm/io.h> #include <asm/io.h>
#include <fsl_nfc.h> #include <fsl_nfc.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment