On Fri, May 8, 2009 at 7:10 AM, Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> wrote: > Hi Felipe, > > From: ext Felipe Contreras <felipe.contreras@xxxxxxxxx> > Subject: Re: [PATCH 3/6] omap iommu: omap3 iommu device registration > Date: Thu, 7 May 2009 22:05:00 +0200 > >> On Tue, May 5, 2009 at 3:47 PM, Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> wrote: >> > Signed-off-by: Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> >> > --- >> > >> > arch/arm/mach-omap2/omap3-iommu.c | 105 +++++++++++++++++++++++++++++++++++++ >> > 1 files changed, 105 insertions(+), 0 deletions(-) >> > create mode 100644 arch/arm/mach-omap2/omap3-iommu.c >> > >> > diff --git a/arch/arm/mach-omap2/omap3-iommu.c b/arch/arm/mach-omap2/omap3-iommu.c >> > new file mode 100644 >> > index 0000000..367f36a >> > --- /dev/null >> > +++ b/arch/arm/mach-omap2/omap3-iommu.c >> > @@ -0,0 +1,105 @@ >> > +/* >> > + * omap iommu: omap3 device registration >> > + * >> > + * Copyright (C) 2008-2009 Nokia Corporation >> > + * >> > + * Written by Hiroshi DOYU <Hiroshi.DOYU@xxxxxxxxx> >> > + * >> > + * This program is free software; you can redistribute it and/or modify >> > + * it under the terms of the GNU General Public License version 2 as >> > + * published by the Free Software Foundation. >> > + */ >> > + >> > +#include <linux/platform_device.h> >> > + >> > +#include <mach/iommu.h> >> > + >> > +#define OMAP3_MMU1_BASE 0x480bd400 >> > +#define OMAP3_MMU2_BASE 0x5d000000 >> > +#define OMAP3_MMU1_IRQ 24 >> > +#define OMAP3_MMU2_IRQ 28 >> > + >> > +static struct resource omap3_iommu_res[] = { >> > + { /* Camera ISP MMU */ >> > + .start = OMAP3_MMU1_BASE, >> > + .end = OMAP3_MMU1_BASE + MMU_REG_SIZE - 1, >> > + .flags = IORESOURCE_MEM, >> > + }, >> > + { >> > + .start = OMAP3_MMU1_IRQ, >> > + .flags = IORESOURCE_IRQ, >> > + }, >> > + { /* IVA2.2 MMU */ >> > + .start = OMAP3_MMU2_BASE, >> > + .end = OMAP3_MMU2_BASE + MMU_REG_SIZE - 1, >> > + .flags = IORESOURCE_MEM, >> > + }, >> > + { >> > + .start = OMAP3_MMU2_IRQ, >> > + .flags = IORESOURCE_IRQ, >> > + }, >> > +}; >> > +#define NR_IOMMU_RES (ARRAY_SIZE(omap3_iommu_res) / 2) >> >> <snip/> >> >> > + err = platform_device_add_resources(pdev, >> > + &omap3_iommu_res[2 * i], NR_IOMMU_RES); >> >> This is wrong. In this particular case NR_IOMMU_RES is 2, but not >> because there's 2 resources: MEM and IRQ, but because there's 2 iommu >> devices: isp and iva2. > > Does the following make sense? > > +#define NR_IOMMU_RES 2 > > .... > > + err = platform_device_add_resources(pdev, > + omap3_iommu_res + i * NR_IOMMU_RES, NR_IOMMU_RES); Yeap, also: > + err = platform_device_add_resources(pdev, omap3_iommu_res + i * 2, 2); -- Felipe Contreras -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html