diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-10-24 20:51:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-11-02 18:11:03 +0100 |
commit | e4aaf7f27fe9ba1227dd63fa6eeac8c0858a0620 (patch) | |
tree | badeeef8df34811923112bc5d9117d8828d255eb /arch/arm/mach-imx/include | |
parent | aaf125fa8141249d5e52969ce3d31913fceb6194 (diff) | |
download | barebox-e4aaf7f27fe9ba1227dd63fa6eeac8c0858a0620.tar.gz barebox-e4aaf7f27fe9ba1227dd63fa6eeac8c0858a0620.tar.xz |
ARM i.MX: Add device convenience functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-imx/include')
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx21.h | 33 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx25.h | 38 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx27.h | 54 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx31.h | 35 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx35.h | 57 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices-imx51.h | 53 | ||||
-rw-r--r-- | arch/arm/mach-imx/include/mach/devices.h | 17 |
7 files changed, 287 insertions, 0 deletions
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 <mach/devices.h> + +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 <mach/devices.h> + +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 <mach/devices.h> + +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 <mach/imx-regs.h> +#include <mach/devices.h> + +#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 <mach/devices.h> + +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 <mach/devices.h> + +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 <fec.h> +#include <i2c/i2c.h> +#include <mach/spi.h> +#include <mach/imx-nand.h> +#include <mach/imxfb.h> +#include <mach/imx-ipu-fb.h> + +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); + |