diff options
author | Eric Miao <eric.miao@linaro.org> | 2011-08-31 17:41:43 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2011-12-04 22:41:45 +0800 |
commit | 291873abad9476c2a9660c9fa273a4af56b97d2a (patch) | |
tree | f26243657cc213504f4412aa356d5f3c798fde00 /arch | |
parent | 1dc52ba26afd9f68f1b7861bd68bafd2618092e7 (diff) |
iim: add IIM driver support
Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mx5/Kconfig | 2 | ||||
-rw-r--r-- | arch/arm/mach-mx5/devices-imx53.h | 4 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-imx-iim.c | 59 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx53.h | 10 |
7 files changed, 87 insertions, 0 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig index 28334eee50c..81a50fdfc5e 100644 --- a/arch/arm/mach-mx5/Kconfig +++ b/arch/arm/mach-mx5/Kconfig @@ -31,6 +31,7 @@ config SOC_IMX51 select ARCH_MXC_AUDMUX_V2 select ARCH_HAS_CPUFREQ select ARCH_MX51 + select IMX_HAVE_PLATFORM_IMX_IIM config SOC_IMX53 bool @@ -40,6 +41,7 @@ config SOC_IMX53 select ARCH_MXC_IOMUX_V3 select ARCH_HAS_CPUFREQ select ARCH_MX53 + select IMX_HAVE_PLATFORM_IMX_IIM #comment "i.MX50 machines:" diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h index 78803799e89..e9dde1e7db9 100644 --- a/arch/arm/mach-mx5/devices-imx53.h +++ b/arch/arm/mach-mx5/devices-imx53.h @@ -50,3 +50,7 @@ extern struct platform_device *__init imx53_add_ahci_imx(void); extern const struct imx_srtc_data imx53_imx_srtc_data __initconst; #define imx53_add_srtc() \ imx_add_srtc(&imx53_imx_srtc_data) + +extern const struct imx_iim_data imx53_imx_iim_data __initconst; +#define imx53_add_iim(pdata) \ + imx_add_iim(&imx53_imx_iim_data, pdata) diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 6724e8f533e..ac94d9c80e1 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig @@ -83,6 +83,9 @@ config IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX config IMX_HAVE_PLATFORM_SPI_IMX bool +config IMX_HAVE_PLATFORM_IMX_IIM + bool + config IMX_HAVE_PLATFORM_AHCI bool default y if ARCH_MX53 diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index f55484bb69e..ff99eed8f65 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile @@ -27,4 +27,5 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_RTC) += platform-mxc_rtc.o obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_W1) += platform-mxc_w1.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX) += platform-sdhci-esdhc-imx.o obj-$(CONFIG_IMX_HAVE_PLATFORM_SPI_IMX) += platform-spi_imx.o +obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_IIM) += platform-imx-iim.o obj-$(CONFIG_IMX_HAVE_PLATFORM_AHCI) += platform-ahci-imx.o diff --git a/arch/arm/plat-mxc/devices/platform-imx-iim.c b/arch/arm/plat-mxc/devices/platform-imx-iim.c new file mode 100644 index 00000000000..74043ded3c0 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-imx-iim.c @@ -0,0 +1,59 @@ +/* + * Copyright (C) 2011 Freescale Semiconductor, Inc. All Rights Reserved. + */ + +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include <mach/hardware.h> +#include <mach/devices-common.h> + +#define imx5_iim_data_entry_single(soc) \ + { \ + .iobase = soc ## _IIM_BASE_ADDR, \ + .irq = soc ## _INT_IIM, \ + } + +#ifdef CONFIG_SOC_IMX51 +const struct imx_iim_data imx51_imx_iim_data __initconst = + imx5_iim_data_entry_single(MX51); +#endif /* ifdef CONFIG_SOC_IMX51 */ + +#ifdef CONFIG_SOC_IMX53 +const struct imx_iim_data imx53_imx_iim_data __initconst = + imx5_iim_data_entry_single(MX53); +#endif /* ifdef CONFIG_SOC_IMX53 */ + +struct platform_device *__init imx_add_iim( + const struct imx_iim_data *data, + const struct mxc_iim_platform_data *pdata) +{ + struct resource res[] = { + { + .start = data->iobase, + .end = data->iobase + SZ_16 - 1, + .flags = IORESOURCE_MEM, + }, { + .start = data->irq, + .end = data->irq, + .flags = IORESOURCE_IRQ, + }, + }; + + return imx_add_platform_device("mxc_iim", 0, + res, ARRAY_SIZE(res), pdata, sizeof(*pdata)); +} + diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index 9e5d6c3e717..9b40b926e7d 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h @@ -338,3 +338,11 @@ struct imx_srtc_data { }; struct platform_device *__init imx_add_srtc( const struct imx_srtc_data *data); + +struct imx_iim_data { + resource_size_t iobase; + resource_size_t irq; +}; +struct platform_device *__init imx_add_iim( + const struct imx_iim_data *data, + const struct mxc_iim_platform_data *pdata); diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h index a37e8c35399..7d2154dc4e4 100644 --- a/arch/arm/plat-mxc/include/mach/mx53.h +++ b/arch/arm/plat-mxc/include/mach/mx53.h @@ -338,4 +338,14 @@ #define MX53_INT_GPIO7_LOW 107 #define MX53_INT_GPIO7_HIGH 108 +/*! + * IIM bank info + */ +#define MXC_IIM_MX51_BANK_START_ADDR 0x0800 +#define MXC_IIM_MX51_BANK_END_ADDR 0x147c +#define MXC_IIM_MX53_BANK_START_ADDR 0x0800 +#define MXC_IIM_MX53_BANK_END_ADDR 0x183c +#define MXC_IIM_MX53_BANK_AREA_1_OFFSET 0xc00 +#define MXC_IIM_MX53_MAC_ADDR_OFFSET 0x24 + #endif /* ifndef __MACH_MX53_H__ */ |