* [PATCH resent v2 0/2] ARM/mxs : add GPMI-NAND support for imx23/imx28 @ 2012-01-19 7:53 Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 2/2] ARM: mxs: add GPMI-NAND support for imx23/imx28 Huang Shijie 0 siblings, 2 replies; 10+ messages in thread From: Huang Shijie @ 2012-01-19 7:53 UTC (permalink / raw) To: linux-arm-kernel This patch set has two patches: [1] Add a new DEFINE_RES_DMA_SIZE_NAMED macro which used by the dma resource that has more then one dma source. [2] add GPMI-NAND support for imx23/imx28 Huang Shijie (2): ioport : add DEFINE_RES_DMA_SIZE_NAMED macro ARM: mxs: add GPMI-NAND support for imx23/imx28 arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 79 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 +++ include/linux/ioport.h | 4 +- 9 files changed, 106 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 7:53 [PATCH resent v2 0/2] ARM/mxs : add GPMI-NAND support for imx23/imx28 Huang Shijie @ 2012-01-19 7:53 ` Huang Shijie 2012-01-19 8:14 ` Shawn Guo 2012-02-05 11:53 ` Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 2/2] ARM: mxs: add GPMI-NAND support for imx23/imx28 Huang Shijie 1 sibling, 2 replies; 10+ messages in thread From: Huang Shijie @ 2012-01-19 7:53 UTC (permalink / raw) To: linux-arm-kernel Some DMA resource does have the range more then ones. Signed-off-by: Huang Shijie <b32955@freescale.com> --- include/linux/ioport.h | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 9d57a71..9ea5de4 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -134,8 +134,10 @@ struct resource_list { #define DEFINE_RES_IRQ(_irq) \ DEFINE_RES_IRQ_NAMED((_irq), NULL) +#define DEFINE_RES_DMA_SIZE_NAMED(_dma, _size, _name) \ + DEFINE_RES_NAMED((_dma), (_size), (_name), IORESOURCE_DMA) #define DEFINE_RES_DMA_NAMED(_dma, _name) \ - DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) + DEFINE_RES_DMA_SIZE_NAMED((_dma), 1, (_name)) #define DEFINE_RES_DMA(_dma) \ DEFINE_RES_DMA_NAMED((_dma), NULL) -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 7:53 ` [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro Huang Shijie @ 2012-01-19 8:14 ` Shawn Guo 2012-01-19 8:23 ` Huang Shijie 2012-02-05 11:53 ` Huang Shijie 1 sibling, 1 reply; 10+ messages in thread From: Shawn Guo @ 2012-01-19 8:14 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 19, 2012 at 03:53:39PM +0800, Huang Shijie wrote: > Some DMA resource does have the range more then ones. > I'm not sure the patch is welcomed. You may want to just use DEFINE_RES_NAMED for such cases. Regards, Shawn > Signed-off-by: Huang Shijie <b32955@freescale.com> > --- > include/linux/ioport.h | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/include/linux/ioport.h b/include/linux/ioport.h > index 9d57a71..9ea5de4 100644 > --- a/include/linux/ioport.h > +++ b/include/linux/ioport.h > @@ -134,8 +134,10 @@ struct resource_list { > #define DEFINE_RES_IRQ(_irq) \ > DEFINE_RES_IRQ_NAMED((_irq), NULL) > > +#define DEFINE_RES_DMA_SIZE_NAMED(_dma, _size, _name) \ > + DEFINE_RES_NAMED((_dma), (_size), (_name), IORESOURCE_DMA) > #define DEFINE_RES_DMA_NAMED(_dma, _name) \ > - DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) > + DEFINE_RES_DMA_SIZE_NAMED((_dma), 1, (_name)) > #define DEFINE_RES_DMA(_dma) \ > DEFINE_RES_DMA_NAMED((_dma), NULL) > > -- > 1.7.0.4 ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 8:14 ` Shawn Guo @ 2012-01-19 8:23 ` Huang Shijie 2012-01-19 8:27 ` Huang Shijie 0 siblings, 1 reply; 10+ messages in thread From: Huang Shijie @ 2012-01-19 8:23 UTC (permalink / raw) To: linux-arm-kernel Hi Shawn: > I'm not sure the patch is welcomed. You may want to just use > DEFINE_RES_NAMED for such cases. I ever wanted to use DEFINE_RES_NAMED. But it seems i have to change some other code(/arch/arm/plat-samsung/devs.c). Anyway, if someone do not like this macro. I can change it too. Best Regards Huang Shijie ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 8:23 ` Huang Shijie @ 2012-01-19 8:27 ` Huang Shijie 2012-01-19 8:55 ` Shawn Guo 0 siblings, 1 reply; 10+ messages in thread From: Huang Shijie @ 2012-01-19 8:27 UTC (permalink / raw) To: linux-arm-kernel > Hi Shawn: >> I'm not sure the patch is welcomed. You may want to just use >> DEFINE_RES_NAMED for such cases. > I ever wanted to use DEFINE_RES_NAMED. sorry. I misunderstood your meaning. I think it's better to add a new macro. use DEFINE_RES_NAMED is not proper. Best Regards Huang Shijie > But it seems i have to change some other > code(/arch/arm/plat-samsung/devs.c). > > Anyway, if someone do not like this macro. I can change it too. > > Best Regards > Huang Shijie > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 8:27 ` Huang Shijie @ 2012-01-19 8:55 ` Shawn Guo 0 siblings, 0 replies; 10+ messages in thread From: Shawn Guo @ 2012-01-19 8:55 UTC (permalink / raw) To: linux-arm-kernel On Thu, Jan 19, 2012 at 04:27:59PM +0800, Huang Shijie wrote: > > >Hi Shawn: > >>I'm not sure the patch is welcomed. You may want to just use > >>DEFINE_RES_NAMED for such cases. > >I ever wanted to use DEFINE_RES_NAMED. > sorry. I misunderstood your meaning. > > I think it's better to add a new macro. use DEFINE_RES_NAMED is not proper. > In that case, I can not apply the patch #2 until #1 hits mainline, so remember to ping me for applying patch #2 when the first one gets merged. -- Regards, Shawn ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-01-19 7:53 ` [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro Huang Shijie 2012-01-19 8:14 ` Shawn Guo @ 2012-02-05 11:53 ` Huang Shijie 2012-02-05 12:34 ` Russell King - ARM Linux 1 sibling, 1 reply; 10+ messages in thread From: Huang Shijie @ 2012-02-05 11:53 UTC (permalink / raw) To: linux-arm-kernel Does any one have any comments about this patch? thanks. On Thu, Jan 19, 2012 at 3:53 PM, Huang Shijie <b32955@freescale.com> wrote: > Some DMA resource does have the range more then ones. > > Signed-off-by: Huang Shijie <b32955@freescale.com> > --- > ?include/linux/ioport.h | ? ?4 +++- > ?1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/include/linux/ioport.h b/include/linux/ioport.h > index 9d57a71..9ea5de4 100644 > --- a/include/linux/ioport.h > +++ b/include/linux/ioport.h > @@ -134,8 +134,10 @@ struct resource_list { > ?#define DEFINE_RES_IRQ(_irq) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ > ? ? ? ?DEFINE_RES_IRQ_NAMED((_irq), NULL) > > +#define DEFINE_RES_DMA_SIZE_NAMED(_dma, _size, _name) ? ? ? ? ? ? ? ? ?\ > + ? ? ? DEFINE_RES_NAMED((_dma), (_size), (_name), IORESOURCE_DMA) > ?#define DEFINE_RES_DMA_NAMED(_dma, _name) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > - ? ? ? DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA) > + ? ? ? DEFINE_RES_DMA_SIZE_NAMED((_dma), 1, (_name)) > ?#define DEFINE_RES_DMA(_dma) ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ > ? ? ? ?DEFINE_RES_DMA_NAMED((_dma), NULL) > > -- > 1.7.0.4 > > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at ?http://vger.kernel.org/majordomo-info.html > Please read the FAQ at ?http://www.tux.org/lkml/ ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-02-05 11:53 ` Huang Shijie @ 2012-02-05 12:34 ` Russell King - ARM Linux 2012-02-05 16:22 ` Huang Shijie 0 siblings, 1 reply; 10+ messages in thread From: Russell King - ARM Linux @ 2012-02-05 12:34 UTC (permalink / raw) To: linux-arm-kernel On Sun, Feb 05, 2012 at 07:53:31PM +0800, Huang Shijie wrote: > Does any one have any comments about this patch? Yes. Having a flat numberspace for DMAs invites the same problems that we have with the flat IRQ numberspace when it comes to having multiple DMA controllers. With DMA engine drivers, channels are allocated using a match function and unspecified match data. While a linear numberspace can be used, that sets itself up for clashing between different DMA controllers especially if the numberspace overlaps. What's missing from this patch set is an illustration of how this will be used. Another issue here is that having the peripheral drivers know about the exact match function and what data the DMA engines require ties the periperal drivers to their respective DMA engine. One of the points of DMA engine is to separate that knowledge, so that the same peripheral IP can be re-used with different DMA engines. To encode knowledge of the DMA engine into the peripheral driver basically destroys the purpose of having a DMA engine API. So, I believe that _if_ we are going down the path of using the DMA engine API for our SoCs, we really don't want to invent a linear DMA numberspace by putting DMA numbers into resources. ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro 2012-02-05 12:34 ` Russell King - ARM Linux @ 2012-02-05 16:22 ` Huang Shijie 0 siblings, 0 replies; 10+ messages in thread From: Huang Shijie @ 2012-02-05 16:22 UTC (permalink / raw) To: linux-arm-kernel On Sun, Feb 5, 2012 at 8:34 PM, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Sun, Feb 05, 2012 at 07:53:31PM +0800, Huang Shijie wrote: >> Does any one have any comments about this patch? > > Yes. ?Having a flat numberspace for DMAs invites the same problems that > we have with the flat IRQ numberspace when it comes to having multiple > DMA controllers. > > With DMA engine drivers, channels are allocated using a match function > and unspecified match data. ?While a linear numberspace can be used, > that sets itself up for clashing between different DMA controllers > especially if the numberspace overlaps. > > What's missing from this patch set is an illustration of how this will > be used. > > Another issue here is that having the peripheral drivers know about the > exact match function and what data the DMA engines require ties the > periperal drivers to their respective DMA engine. ?One of the points of > DMA engine is to separate that knowledge, so that the same peripheral IP > can be re-used with different DMA engines. > > To encode knowledge of the DMA engine into the peripheral driver basically > destroys the purpose of having a DMA engine API. > > So, I believe that _if_ we are going down the path of using the DMA engine > API for our SoCs, we really don't want to invent a linear DMA numberspace > by putting DMA numbers into resources. ok. thanks. Huang Shijie ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH resent v2 2/2] ARM: mxs: add GPMI-NAND support for imx23/imx28 2012-01-19 7:53 [PATCH resent v2 0/2] ARM/mxs : add GPMI-NAND support for imx23/imx28 Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro Huang Shijie @ 2012-01-19 7:53 ` Huang Shijie 1 sibling, 0 replies; 10+ messages in thread From: Huang Shijie @ 2012-01-19 7:53 UTC (permalink / raw) To: linux-arm-kernel add GPMI-NAND support for imx23 and imx28. Signed-off-by: Huang Shijie <b32955@freescale.com> --- arch/arm/mach-mxs/clock-mx23.c | 1 + arch/arm/mach-mxs/clock-mx28.c | 1 + arch/arm/mach-mxs/devices-mx23.h | 4 + arch/arm/mach-mxs/devices-mx28.h | 4 + arch/arm/mach-mxs/devices/Kconfig | 3 + arch/arm/mach-mxs/devices/Makefile | 1 + arch/arm/mach-mxs/devices/platform-gpmi-nand.c | 79 +++++++++++++++++++++++ arch/arm/mach-mxs/include/mach/devices-common.h | 10 +++ 8 files changed, 103 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-mxs/devices/platform-gpmi-nand.c diff --git a/arch/arm/mach-mxs/clock-mx23.c b/arch/arm/mach-mxs/clock-mx23.c index e12e112..aec3471 100644 --- a/arch/arm/mach-mxs/clock-mx23.c +++ b/arch/arm/mach-mxs/clock-mx23.c @@ -456,6 +456,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("mxs-pwm.3", NULL, pwm_clk) _REGISTER_CLOCK("mxs-pwm.4", NULL, pwm_clk) _REGISTER_CLOCK("imx23-fb", NULL, lcdif_clk) + _REGISTER_CLOCK("imx23-gpmi-nand", NULL, gpmi_clk) }; static int clk_misc_init(void) diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c index 5d68e41..8dd7b02 100644 --- a/arch/arm/mach-mxs/clock-mx28.c +++ b/arch/arm/mach-mxs/clock-mx28.c @@ -643,6 +643,7 @@ static struct clk_lookup lookups[] = { _REGISTER_CLOCK("duart", NULL, uart_clk) _REGISTER_CLOCK("imx28-fec.0", NULL, fec_clk) _REGISTER_CLOCK("imx28-fec.1", NULL, fec_clk) + _REGISTER_CLOCK("imx28-gpmi-nand", NULL, gpmi_clk) _REGISTER_CLOCK("mxs-auart.0", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.1", NULL, uart_clk) _REGISTER_CLOCK("mxs-auart.2", NULL, uart_clk) diff --git a/arch/arm/mach-mxs/devices-mx23.h b/arch/arm/mach-mxs/devices-mx23.h index 3fa651d..4d1329d 100644 --- a/arch/arm/mach-mxs/devices-mx23.h +++ b/arch/arm/mach-mxs/devices-mx23.h @@ -21,6 +21,10 @@ extern const struct mxs_auart_data mx23_auart_data[] __initconst; #define mx23_add_auart0() mx23_add_auart(0) #define mx23_add_auart1() mx23_add_auart(1) +extern const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst; +#define mx23_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx23_gpmi_nand_data) + extern const struct mxs_mxs_mmc_data mx23_mxs_mmc_data[] __initconst; #define mx23_add_mxs_mmc(id, pdata) \ mxs_add_mxs_mmc(&mx23_mxs_mmc_data[id], pdata) diff --git a/arch/arm/mach-mxs/devices-mx28.h b/arch/arm/mach-mxs/devices-mx28.h index 4f50094..9dbeae1 100644 --- a/arch/arm/mach-mxs/devices-mx28.h +++ b/arch/arm/mach-mxs/devices-mx28.h @@ -34,6 +34,10 @@ extern const struct mxs_flexcan_data mx28_flexcan_data[] __initconst; #define mx28_add_flexcan0(pdata) mx28_add_flexcan(0, pdata) #define mx28_add_flexcan1(pdata) mx28_add_flexcan(1, pdata) +extern const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst; +#define mx28_add_gpmi_nand(pdata) \ + mxs_add_gpmi_nand(pdata, &mx28_gpmi_nand_data) + extern const struct mxs_mxs_i2c_data mx28_mxs_i2c_data[] __initconst; #define mx28_add_mxs_i2c(id) mxs_add_mxs_i2c(&mx28_mxs_i2c_data[id]) diff --git a/arch/arm/mach-mxs/devices/Kconfig b/arch/arm/mach-mxs/devices/Kconfig index 18b6bf5..b8913df 100644 --- a/arch/arm/mach-mxs/devices/Kconfig +++ b/arch/arm/mach-mxs/devices/Kconfig @@ -12,6 +12,9 @@ config MXS_HAVE_PLATFORM_FLEXCAN select HAVE_CAN_FLEXCAN if CAN bool +config MXS_HAVE_PLATFORM_GPMI_NAND + bool + config MXS_HAVE_PLATFORM_MXS_I2C bool diff --git a/arch/arm/mach-mxs/devices/Makefile b/arch/arm/mach-mxs/devices/Makefile index f52e3e5..c8f5c95 100644 --- a/arch/arm/mach-mxs/devices/Makefile +++ b/arch/arm/mach-mxs/devices/Makefile @@ -3,6 +3,7 @@ obj-$(CONFIG_MXS_HAVE_PLATFORM_AUART) += platform-auart.o obj-y += platform-dma.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FEC) += platform-fec.o obj-$(CONFIG_MXS_HAVE_PLATFORM_FLEXCAN) += platform-flexcan.o +obj-$(CONFIG_MXS_HAVE_PLATFORM_GPMI_NAND) += platform-gpmi-nand.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_I2C) += platform-mxs-i2c.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_MMC) += platform-mxs-mmc.o obj-$(CONFIG_MXS_HAVE_PLATFORM_MXS_PWM) += platform-mxs-pwm.o diff --git a/arch/arm/mach-mxs/devices/platform-gpmi-nand.c b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c new file mode 100644 index 0000000..a9298ac --- /dev/null +++ b/arch/arm/mach-mxs/devices/platform-gpmi-nand.c @@ -0,0 +1,79 @@ +/* + * 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 <asm/sizes.h> +#include <mach/mx23.h> +#include <mach/mx28.h> +#include <mach/devices-common.h> +#include <linux/dma-mapping.h> + +#ifdef CONFIG_SOC_IMX23 +const struct mxs_gpmi_nand_data mx23_gpmi_nand_data __initconst = { + .devid = "imx23-gpmi-nand", + .res = { + /* GPMI */ + DEFINE_RES_MEM_NAMED(MX23_GPMI_BASE_ADDR, SZ_8K, + GPMI_NAND_GPMI_REGS_ADDR_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_ATTENTION, + GPMI_NAND_GPMI_INTERRUPT_RES_NAME), + /* BCH */ + DEFINE_RES_MEM_NAMED(MX23_BCH_BASE_ADDR, SZ_8K, + GPMI_NAND_BCH_REGS_ADDR_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX23_INT_BCH, + GPMI_NAND_BCH_INTERRUPT_RES_NAME), + /* DMA */ + DEFINE_RES_DMA_SIZE_NAMED(MX23_DMA_GPMI0, + MX23_DMA_GPMI3 - MX23_DMA_GPMI0 + 1, + GPMI_NAND_DMA_CHANNELS_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX23_INT_GPMI_DMA, + GPMI_NAND_DMA_INTERRUPT_RES_NAME), + }, +}; +#endif + +#ifdef CONFIG_SOC_IMX28 +const struct mxs_gpmi_nand_data mx28_gpmi_nand_data __initconst = { + .devid = "imx28-gpmi-nand", + .res = { + /* GPMI */ + DEFINE_RES_MEM_NAMED(MX28_GPMI_BASE_ADDR, SZ_8K, + GPMI_NAND_GPMI_REGS_ADDR_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI, + GPMI_NAND_GPMI_INTERRUPT_RES_NAME), + /* BCH */ + DEFINE_RES_MEM_NAMED(MX28_BCH_BASE_ADDR, SZ_8K, + GPMI_NAND_BCH_REGS_ADDR_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX28_INT_BCH, + GPMI_NAND_BCH_INTERRUPT_RES_NAME), + /* DMA */ + DEFINE_RES_DMA_SIZE_NAMED(MX28_DMA_GPMI0, + MX28_DMA_GPMI7 - MX28_DMA_GPMI0 + 1, + GPMI_NAND_DMA_CHANNELS_RES_NAME), + DEFINE_RES_IRQ_NAMED(MX28_INT_GPMI_DMA, + GPMI_NAND_DMA_INTERRUPT_RES_NAME), + }, +}; +#endif + +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data) +{ + return mxs_add_platform_device_dmamask(data->devid, -1, + data->res, GPMI_NAND_RES_SIZE, + pdata, sizeof(*pdata), DMA_BIT_MASK(32)); +} diff --git a/arch/arm/mach-mxs/include/mach/devices-common.h b/arch/arm/mach-mxs/include/mach/devices-common.h index dc369c1..f2e3839 100644 --- a/arch/arm/mach-mxs/include/mach/devices-common.h +++ b/arch/arm/mach-mxs/include/mach/devices-common.h @@ -66,6 +66,16 @@ struct platform_device *__init mxs_add_flexcan( const struct mxs_flexcan_data *data, const struct flexcan_platform_data *pdata); +/* gpmi-nand */ +#include <linux/mtd/gpmi-nand.h> +struct mxs_gpmi_nand_data { + const char *devid; + const struct resource res[GPMI_NAND_RES_SIZE]; +}; +struct platform_device *__init +mxs_add_gpmi_nand(const struct gpmi_nand_platform_data *pdata, + const struct mxs_gpmi_nand_data *data); + /* i2c */ struct mxs_mxs_i2c_data { int id; -- 1.7.0.4 ^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-02-05 16:22 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-01-19 7:53 [PATCH resent v2 0/2] ARM/mxs : add GPMI-NAND support for imx23/imx28 Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 1/2] ioport : add DEFINE_RES_DMA_SIZE_NAMED macro Huang Shijie 2012-01-19 8:14 ` Shawn Guo 2012-01-19 8:23 ` Huang Shijie 2012-01-19 8:27 ` Huang Shijie 2012-01-19 8:55 ` Shawn Guo 2012-02-05 11:53 ` Huang Shijie 2012-02-05 12:34 ` Russell King - ARM Linux 2012-02-05 16:22 ` Huang Shijie 2012-01-19 7:53 ` [PATCH resent v2 2/2] ARM: mxs: add GPMI-NAND support for imx23/imx28 Huang Shijie
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).