From e4aaf7f27fe9ba1227dd63fa6eeac8c0858a0620 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Sun, 24 Oct 2010 20:51:00 +0200 Subject: ARM i.MX: Add device convenience functions Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/include/mach/devices-imx21.h | 33 +++++++++++++++ arch/arm/mach-imx/include/mach/devices-imx25.h | 38 +++++++++++++++++ arch/arm/mach-imx/include/mach/devices-imx27.h | 54 ++++++++++++++++++++++++ arch/arm/mach-imx/include/mach/devices-imx31.h | 35 ++++++++++++++++ arch/arm/mach-imx/include/mach/devices-imx35.h | 57 ++++++++++++++++++++++++++ arch/arm/mach-imx/include/mach/devices-imx51.h | 53 ++++++++++++++++++++++++ arch/arm/mach-imx/include/mach/devices.h | 17 ++++++++ 7 files changed, 287 insertions(+) create mode 100644 arch/arm/mach-imx/include/mach/devices-imx21.h create mode 100644 arch/arm/mach-imx/include/mach/devices-imx25.h create mode 100644 arch/arm/mach-imx/include/mach/devices-imx27.h create mode 100644 arch/arm/mach-imx/include/mach/devices-imx31.h create mode 100644 arch/arm/mach-imx/include/mach/devices-imx35.h create mode 100644 arch/arm/mach-imx/include/mach/devices-imx51.h create mode 100644 arch/arm/mach-imx/include/mach/devices.h (limited to 'arch/arm/mach-imx/include/mach') diff --git a/arch/arm/mach-imx/include/mach/devices-imx21.h b/arch/arm/mach-imx/include/mach/devices-imx21.h new file mode 100644 index 0000000000..1e1fbbdf4c --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx21.h @@ -0,0 +1,33 @@ + +#include + +static inline struct device_d *imx21_add_uart0(void) +{ + return imx_add_uart((void *)IMX_UART1_BASE, 0); +} + +static inline struct device_d *imx21_add_uart1(void) +{ + return imx_add_uart((void *)IMX_UART2_BASE, 1); +} + +static inline struct device_d *imx21_add_uart2(void) +{ + return imx_add_uart((void *)IMX_UART3_BASE, 2); +} + +static inline struct device_d *imx21_add_uart3(void) +{ + return imx_add_uart((void *)IMX_UART4_BASE, 3); +} + +static inline struct device_d *imx21_add_nand(struct imx_nand_platform_data *pdata) +{ + return imx_add_nand((void *)0xDF003000, pdata); +} + +static inline struct device_d *imx21_add_fb(struct imx_fb_platform_data *pdata) +{ + return imx_add_fb((void *)0x10021000, pdata); +} + diff --git a/arch/arm/mach-imx/include/mach/devices-imx25.h b/arch/arm/mach-imx/include/mach/devices-imx25.h new file mode 100644 index 0000000000..dc7f98f007 --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx25.h @@ -0,0 +1,38 @@ + +#include + +static inline struct device_d *imx25_add_i2c0(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata); +} + +static inline struct device_d *imx25_add_uart0(void) +{ + return imx_add_uart((void *)IMX_UART1_BASE, 0); +} + +static inline struct device_d *imx25_add_uart1(void) +{ + return imx_add_uart((void *)IMX_UART2_BASE, 1); +} + +static inline struct device_d *imx25_add_nand(struct imx_nand_platform_data *pdata) +{ + return imx_add_nand((void *)IMX_NFC_BASE, pdata); +} + +static inline struct device_d *imx25_add_fb(struct imx_fb_platform_data *pdata) +{ + return imx_add_fb((void *)0x53fbc000, pdata); +} + +static inline struct device_d *imx25_add_fec(struct fec_platform_data *pdata) +{ + return imx_add_fec((void *)IMX_FEC_BASE, pdata); +} + +static inline struct device_d *imx25_add_mmc0(void *pdata) +{ + return imx_add_mmc((void *)0x53fb4000, 0, pdata); +} + diff --git a/arch/arm/mach-imx/include/mach/devices-imx27.h b/arch/arm/mach-imx/include/mach/devices-imx27.h new file mode 100644 index 0000000000..0511eb5d21 --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx27.h @@ -0,0 +1,54 @@ + +#include + +static inline struct device_d *imx27_add_spi0(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)IMX_SPI1_BASE, 0, pdata); +} + +static inline struct device_d *imx27_add_i2c0(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata); +} + +static inline struct device_d *imx27_add_uart0(void) +{ + return imx_add_uart((void *)IMX_UART1_BASE, 0); +} + +static inline struct device_d *imx27_add_uart1(void) +{ + return imx_add_uart((void *)IMX_UART2_BASE, 1); +} + +static inline struct device_d *imx27_add_uart2(void) +{ + return imx_add_uart((void *)IMX_UART3_BASE, 2); +} + +static inline struct device_d *imx27_add_uart3(void) +{ + return imx_add_uart((void *)IMX_UART4_BASE, 3); +} + +static inline struct device_d *imx27_add_nand(struct imx_nand_platform_data *pdata) +{ + return imx_add_nand((void *)IMX_NFC_BASE, pdata); +} + +static inline struct device_d *imx27_add_fb(struct imx_fb_platform_data *pdata) +{ + return imx_add_fb((void *)0x10021000, pdata); +} + +static inline struct device_d *imx27_add_fec(struct fec_platform_data *pdata) +{ + return imx_add_fec((void *)IMX_FEC_BASE, pdata); +} + +static inline struct device_d *imx27_add_mmc0(void *pdata) +{ + return imx_add_mmc((void *)0x10014000, 0, pdata); +} + + diff --git a/arch/arm/mach-imx/include/mach/devices-imx31.h b/arch/arm/mach-imx/include/mach/devices-imx31.h new file mode 100644 index 0000000000..1f5a48adc5 --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx31.h @@ -0,0 +1,35 @@ + +#include +#include + +#if 0 +static inline struct device_d *imx31_add_spi0(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)IMX_SPI1_BASE, 0, pdata); +} + +static inline struct device_d *imx31_add_spi1(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)IMX_SPI2_BASE, 1, pdata); +} +#endif + +static inline struct device_d *imx31_add_uart0(void) +{ + return imx_add_uart((void *)IMX_UART1_BASE, 0); +} + +static inline struct device_d *imx31_add_uart1(void) +{ + return imx_add_uart((void *)IMX_UART2_BASE, 1); +} + +static inline struct device_d *imx31_add_nand(struct imx_nand_platform_data *pdata) +{ + return imx_add_nand((void *)0xb8000000, pdata); +} + +static inline struct device_d *imx31_add_fb(struct imx_fb_platform_data *pdata) +{ + return imx_add_ipufb((void *)IPU_BASE, pdata); +} diff --git a/arch/arm/mach-imx/include/mach/devices-imx35.h b/arch/arm/mach-imx/include/mach/devices-imx35.h new file mode 100644 index 0000000000..3b2b1ff429 --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx35.h @@ -0,0 +1,57 @@ + +#include + +static inline struct device_d *imx35_add_i2c0(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)IMX_I2C1_BASE, 0, pdata); +} + +static inline struct device_d *imx35_add_i2c1(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)IMX_I2C2_BASE, 1, pdata); +} + +static inline struct device_d *imx35_add_i2c2(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)IMX_I2C3_BASE, 2, pdata); +} + +static inline struct device_d *imx35_add_uart0(void) +{ + return imx_add_uart((void *)IMX_UART1_BASE, 0); +} + +static inline struct device_d *imx35_add_uart1(void) +{ + return imx_add_uart((void *)IMX_UART2_BASE, 1); +} + +static inline struct device_d *imx35_add_nand(struct imx_nand_platform_data *pdata) +{ + return imx_add_nand((void *)IMX_NFC_BASE, pdata); +} + +static inline struct device_d *imx35_add_fb(struct imx_ipu_fb_platform_data *pdata) +{ + return imx_add_ipufb((void *)IMX_IPU_BASE, pdata); +} + +static inline struct device_d *imx35_add_fec(struct fec_platform_data *pdata) +{ + return imx_add_fec((void *)IMX_FEC_BASE, pdata); +} + +static inline struct device_d *imx35_add_mmc0(void *pdata) +{ + return imx_add_mmc((void *)IMX_SDHC1_BASE, 0, pdata); +} + +static inline struct device_d *imx35_add_mmc1(void *pdata) +{ + return imx_add_mmc((void *)IMX_SDHC2_BASE, 1, pdata); +} + +static inline struct device_d *imx35_add_mmc2(void *pdata) +{ + return imx_add_mmc((void *)IMX_SDHC3_BASE, 2, pdata); +} diff --git a/arch/arm/mach-imx/include/mach/devices-imx51.h b/arch/arm/mach-imx/include/mach/devices-imx51.h new file mode 100644 index 0000000000..ff63fca922 --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices-imx51.h @@ -0,0 +1,53 @@ + +#include + +static inline struct device_d *imx51_add_spi0(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)MX51_CSPI1_BASE_ADDR, 0, pdata); +} + +static inline struct device_d *imx51_add_spi1(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)MX51_CSPI2_BASE_ADDR, 1, pdata); +} + +static inline struct device_d *imx51_add_spi2(struct spi_imx_master *pdata) +{ + return imx_add_spi((void *)MX51_CSPI3_BASE_ADDR, 2, pdata); +} + +static inline struct device_d *imx51_add_i2c0(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)MX51_I2C1_BASE_ADDR, 0, pdata); +} + +static inline struct device_d *imx51_add_i2c1(struct i2c_platform_data *pdata) +{ + return imx_add_i2c((void *)MX51_I2C2_BASE_ADDR, 1, pdata); +} + +static inline struct device_d *imx51_add_uart0(void) +{ + return imx_add_uart((void *)MX51_UART1_BASE_ADDR, 0); +} + +static inline struct device_d *imx51_add_uart1(void) +{ + return imx_add_uart((void *)MX51_UART2_BASE_ADDR, 1); +} + +static inline struct device_d *imx51_add_fec(struct fec_platform_data *pdata) +{ + return imx_add_fec((void *)MX51_MXC_FEC_BASE_ADDR, pdata); +} + +static inline struct device_d *imx51_add_mmc0(void *pdata) +{ + return imx_add_mmc((void *)MX51_MMC_SDHC1_BASE_ADDR, 0, pdata); +} + +static inline struct device_d *imx51_add_mmc1(void *pdata) +{ + return imx_add_mmc((void *)MX51_MMC_SDHC2_BASE_ADDR, 0, pdata); +} + diff --git a/arch/arm/mach-imx/include/mach/devices.h b/arch/arm/mach-imx/include/mach/devices.h new file mode 100644 index 0000000000..677d5b54dc --- /dev/null +++ b/arch/arm/mach-imx/include/mach/devices.h @@ -0,0 +1,17 @@ + +#include +#include +#include +#include +#include +#include + +struct device_d *imx_add_fec(void *base, struct fec_platform_data *pdata); +struct device_d *imx_add_spi(void *base, int id, struct spi_imx_master *pdata); +struct device_d *imx_add_i2c(void *base, int id, struct i2c_platform_data *pdata); +struct device_d *imx_add_uart(void *base, int id); +struct device_d *imx_add_nand(void *base, struct imx_nand_platform_data *pdata); +struct device_d *imx_add_fb(void *base, struct imx_fb_platform_data *pdata); +struct device_d *imx_add_ipufb(void *base, struct imx_ipu_fb_platform_data *pdata); +struct device_d *imx_add_mmc(void *base, int id, void *pdata); + -- cgit v1.2.3