Re: [PATCH 3/6] omap iommu: omap3 iommu device registration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

-- 
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

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux