Skip to contentSkip to conversation

Clean up amba/primecell bus support

PATCH New Russell King - ARM Linux 12 participants 69 messages Jan 20, 2012 – Jan 26, 2012

Subsystems (14)
lore
Share & tools
lore
#0 lore raw

cover Clean up amba/primecell bus support

This patch set cleans up the AMBA/Primecell bus support. Contained within this set are:

1. Patches 1-5 - Allocation APIs
It seems several places in the kernel want to allocate and register amba_device structures. Let's make this official, and common code. So we introduce amba_device_alloc(), amba_device_add(), and amba_device_put() APIs, which provide the necessary support safely for this.

Convert the DT, ux500, Integrator/AP and mxs code to use these APIs rather than their private version.

2. Patches 6-17 - NO_IRQ cleanup
Making IRQ number 0 mean 'no irq' for the AMBA drivers and bus layer. We get rid of NO_IRQ initializers in this across various platforms, and make the bus layer warn if '-1' is passed in a device as an IRQ. This prevents new occurances of NO_IRQ initializers for this bus type going by unspotted.

3. Patches 18-31 - static initializers
Provide a standardized set of initializers for statically declared AMBA devices. We provide two - one for the simpler APB devices, and one for AHB devices. The major difference between these two is the setting of the DMA mask - APB peripherals do not have DMA capability themselves.

While updating (3), I came across new additions in Spear3xx and the Samsung directories which added AMBA devices, which are declared globally. The Spear3xx devices are used in other files, so that's fine.

Samsung devices don't seem to be - and that needs fixing (did someone not run checkpatch or sparse on these changes?) Please send fixes.

Acks for these patches are welcome.

 arch/arm/mach-bcmring/core.c                   |   23 +-----
 arch/arm/mach-ep93xx/core.c                    |   46 ++---------
 arch/arm/mach-exynos/dma.c                     |   38 ++-------
 arch/arm/mach-integrator/core.c                |   70 +++-------------
 arch/arm/mach-integrator/impd1.c               |    9 +--
 arch/arm/mach-integrator/integrator_cp.c       |   49 ++---------
 arch/arm/mach-lpc32xx/phy3250.c                |   32 +------
 arch/arm/mach-mxs/devices.c                    |    8 +-
 arch/arm/mach-mxs/devices/amba-duart.c         |    2 +-
 arch/arm/mach-netx/fb.c                        |   13 +---
 arch/arm/mach-nomadik/board-nhk8815.c          |   17 +---
 arch/arm/mach-nomadik/cpu-8815.c               |    9 +--
 arch/arm/mach-omap2/emu.c                      |   26 +------
 arch/arm/mach-realview/core.h                  |   20 +----
 arch/arm/mach-realview/realview_eb.c           |   78 +++++++++---------
 arch/arm/mach-realview/realview_pb1176.c       |   78 +++++++++---------
 arch/arm/mach-realview/realview_pb11mp.c       |   78 +++++++++---------
 arch/arm/mach-realview/realview_pba8.c         |   78 +++++++++---------
 arch/arm/mach-realview/realview_pbx.c          |   78 +++++++++---------
 arch/arm/mach-s5p64x0/dma.c                    |   22 +----
 arch/arm/mach-s5pc100/dma.c                    |   38 ++-------
 arch/arm/mach-s5pv210/dma.c                    |   38 ++-------
 arch/arm/mach-spear3xx/spear300.c              |   14 +---
 arch/arm/mach-spear3xx/spear3xx.c              |   27 +-----
 arch/arm/mach-spear6xx/spear6xx.c              |   10 +-
 arch/arm/mach-u300/core.c                      |   85 ++++----------------
 arch/arm/mach-ux500/devices-common.c           |   13 +--
 arch/arm/mach-versatile/core.c                 |   70 ++++++++--------
 arch/arm/mach-versatile/core.h                 |   20 +----
 arch/arm/mach-versatile/versatile_pb.c         |   18 ++--
 arch/arm/mach-vexpress/core.h                  |   17 ----
 arch/arm/mach-vexpress/ct-ca9x4.c              |    8 +-
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h |    2 +-
 arch/arm/mach-vexpress/v2m.c                   |   20 ++--
 drivers/amba/bus.c                             |  105 ++++++++++++++++++------
 drivers/mmc/host/mmci.c                        |    2 +-
 drivers/of/platform.c                          |    6 +-
 include/linux/amba/bus.h                       |   36 ++++++++
 38 files changed, 488 insertions(+), 815 deletions(-)
#1 lore raw

PATCH 1/31 ARM: amba: add amba_device allocation/add/put functions

Add functions to allocate and initialize AMBA device structures, and add them to the Linux device manager. This allows us to kill this type of operation from individual platforms, moving it to core code.

---
 drivers/amba/bus.c       |  100 ++++++++++++++++++++++++++++++++++-----------
 include/linux/amba/bus.h |    3 +
 2 files changed, 78 insertions(+), 25 deletions(-)
drivers/amba/bus.c +75 -25
index 54eaf96..82b65e1 100644
@@ -497,38 +497,20 @@ static void amba_device_release(struct device *dev)
 }
 
 /**
- *	amba_device_register - register an AMBA device
- *	@dev: AMBA device to register
- *	@parent: parent memory resource
+ *	amba_device_add - add a previously allocated AMBA device structure
+ *	@dev: AMBA device allocated by amba_device_alloc
+ *	@parent: resource parent for this devices resources
  *
- *	Setup the AMBA device, reading the cell ID if present.
- *	Claim the resource, and register the AMBA device with
- *	the Linux device manager.
+ *	Claim the resource, and read the device cell ID if not already
+ *	initialized.  Register the AMBA device with the Linux device
+ *	manager.
  */
-int amba_device_register(struct amba_device *dev, struct resource *parent)
+int amba_device_add(struct amba_device *dev, struct resource *parent)
 {
 	u32 size;
 	void __iomem *tmp;
 	int i, ret;
 
-	device_initialize(&dev->dev);
-
-	/*
-	 * Copy from device_add
-	 */
-	if (dev->dev.init_name) {
-		dev_set_name(&dev->dev, "%s", dev->dev.init_name);
-		dev->dev.init_name = NULL;
-	}
-
-	dev->dev.release = amba_device_release;
-	dev->dev.bus = &amba_bustype;
-	dev->dev.dma_mask = &dev->dma_mask;
-	dev->res.name = dev_name(&dev->dev);
-
-	if (!dev->dev.coherent_dma_mask && dev->dma_mask)
-		dev_warn(&dev->dev, "coherent dma mask is unset\n");
-
 	ret = request_resource(parent, &dev->res);
 	if (ret)
 		goto err_out;
@@ -596,6 +578,74 @@ int amba_device_register(struct amba_device *dev, struct resource *parent)
  err_out:
 	return ret;
 }
+EXPORT_SYMBOL_GPL(amba_device_add);
+
+static void amba_device_initialize(struct amba_device *dev, const char *name)
+{
+	device_initialize(&dev->dev);
+	if (name)
+		dev_set_name(&dev->dev, "%s", name);
+	dev->dev.release = amba_device_release;
+	dev->dev.bus = &amba_bustype;
+	dev->dev.dma_mask = &dev->dma_mask;
+	dev->res.name = dev_name(&dev->dev);
+}
+
+/**
+ *	amba_device_alloc - allocate an AMBA device
+ *	@name: sysfs name of the AMBA device
+ *	@base: base of AMBA device
+ *	@size: size of AMBA device
+ *
+ *	Allocate and initialize an AMBA device structure.  Returns %NULL
+ *	on failure.
+ */
+struct amba_device *amba_device_alloc(const char *name, resource_size_t base,
+	size_t size)
+{
+	struct amba_device *dev;
+
+	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	if (dev) {
+		amba_device_initialize(dev, name);
+		dev->res.start = base;
+		dev->res.end = base + size - 1;
+		dev->res.flags = IORESOURCE_MEM;
+	}
+
+	return dev;
+}
+EXPORT_SYMBOL_GPL(amba_device_alloc);
+
+/**
+ *	amba_device_register - register an AMBA device
+ *	@dev: AMBA device to register
+ *	@parent: parent memory resource
+ *
+ *	Setup the AMBA device, reading the cell ID if present.
+ *	Claim the resource, and register the AMBA device with
+ *	the Linux device manager.
+ */
+int amba_device_register(struct amba_device *dev, struct resource *parent)
+{
+	amba_device_initialize(dev, dev->dev.init_name);
+	dev->dev.init_name = NULL;
+
+	if (!dev->dev.coherent_dma_mask && dev->dma_mask)
+		dev_warn(&dev->dev, "coherent dma mask is unset\n");
+
+	return amba_device_add(dev, parent);
+}
+
+/**
+ *	amba_device_put - put an AMBA device
+ *	@dev: AMBA device to put
+ */
+void amba_device_put(struct amba_device *dev)
+{
+	put_device(&dev->dev);
+}
+EXPORT_SYMBOL_GPL(amba_device_put);
 
 /**
  *	amba_device_unregister - unregister an AMBA device
include/linux/amba/bus.h +3 -0
index 724c69c..e192962 100644
@@ -60,6 +60,9 @@ extern struct bus_type amba_bustype;
 
 int amba_driver_register(struct amba_driver *);
 void amba_driver_unregister(struct amba_driver *);
+struct amba_device *amba_device_alloc(const char *, resource_size_t, size_t);
+void amba_device_put(struct amba_device *);
+int amba_device_add(struct amba_device *, struct resource *);
 int amba_device_register(struct amba_device *, struct resource *);
 void amba_device_unregister(struct amba_device *);
 struct amba_device *amba_find_device(const char *, struct device *, unsigned int, unsigned int);
Signature · 1 line
1.7.4.4
#2 lore raw

PATCH 2/31 ARM: amba: of: convert to use amba_device_alloc

In reply to Russell King - ARM Linux

Convert DT code to use the new amba_device_alloc APIs.

---
 drivers/of/platform.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/of/platform.c +3 -3
index 63b3ec4..cae9477 100644
@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (!of_device_is_available(node))
 		return NULL;
 
-	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	dev = amba_device_alloc(NULL, 0, 0);
 	if (!dev)
 		return NULL;
 
@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (ret)
 		goto err_free;
 
-	ret = amba_device_register(dev, &iomem_resource);
+	ret = amba_device_add(dev, &iomem_resource);
 	if (ret)
 		goto err_free;
 
 	return dev;
 
 err_free:
-	kfree(dev);
+	amba_device_put(dev);
 	return NULL;
 }
 #else /* CONFIG_ARM_AMBA */
Signature · 1 line
1.7.4.4
#3 lore raw

PATCH 2/31 ARM: amba: of: convert to use amba_device_alloc

Quoted 3 lines · Russell King - ARM Linux

Convert DT code to use the new amba_device_alloc APIs.

Quoted 34 lines
---
 drivers/of/platform.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/of/platform.c +3 -3
index 63b3ec4..cae9477 100644
@@ -253,7 +253,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (!of_device_is_available(node))
 		return NULL;
 
-	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
+	dev = amba_device_alloc(NULL, 0, 0);
 	if (!dev)
 		return NULL;
 
@@ -283,14 +283,14 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
 	if (ret)
 		goto err_free;
 
-	ret = amba_device_register(dev, &iomem_resource);
+	ret = amba_device_add(dev, &iomem_resource);
 	if (ret)
 		goto err_free;
 
 	return dev;
 
 err_free:
-	kfree(dev);
+	amba_device_put(dev);
 	return NULL;
 }
 #else /* CONFIG_ARM_AMBA */
#4 lore raw

PATCH 3/31 ARM: amba: ux500: convert to use amba_device_alloc

In reply to Russell King - ARM Linux

Convert ux500 to use the new amba_device_alloc APIs.

---
 arch/arm/mach-ux500/devices-common.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
arch/arm/mach-ux500/devices-common.c +3 -9
index c563e54..e8c34fa 100644
@@ -26,16 +26,10 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 	struct amba_device *dev;
 	int ret;
 
-	dev = kzalloc(sizeof *dev, GFP_KERNEL);
+	dev = amba_device_alloc(name, base, SZ_4K);
 	if (!dev)
 		return ERR_PTR(-ENOMEM);
 
-	dev->dev.init_name = name;
-
-	dev->res.start = base;
-	dev->res.end = base + SZ_4K - 1;
-	dev->res.flags = IORESOURCE_MEM;
-
 	dev->dma_mask = DMA_BIT_MASK(32);
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
@@ -46,9 +40,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 
 	dev->dev.platform_data = pdata;
 
-	ret = amba_device_register(dev, &iomem_resource);
+	ret = amba_device_add(dev, &iomem_resource);
 	if (ret) {
-		kfree(dev);
+		amba_device_put(dev);
 		return ERR_PTR(ret);
 	}
 
Signature · 1 line
1.7.4.4
#5 lore raw

PATCH 3/31 ARM: amba: ux500: convert to use amba_device_alloc

Quoted 3 lines · Russell King - ARM Linux

Convert ux500 to use the new amba_device_alloc APIs.

Quoted 41 lines
---
 arch/arm/mach-ux500/devices-common.c |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
arch/arm/mach-ux500/devices-common.c +3 -9
index c563e54..e8c34fa 100644
@@ -26,16 +26,10 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 	struct amba_device *dev;
 	int ret;
 
-	dev = kzalloc(sizeof *dev, GFP_KERNEL);
+	dev = amba_device_alloc(name, base, SZ_4K);
 	if (!dev)
 		return ERR_PTR(-ENOMEM);
 
-	dev->dev.init_name = name;
-
-	dev->res.start = base;
-	dev->res.end = base + SZ_4K - 1;
-	dev->res.flags = IORESOURCE_MEM;
-
 	dev->dma_mask = DMA_BIT_MASK(32);
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
@@ -46,9 +40,9 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 
 	dev->dev.platform_data = pdata;
 
-	ret = amba_device_register(dev, &iomem_resource);
+	ret = amba_device_add(dev, &iomem_resource);
 	if (ret) {
-		kfree(dev);
+		amba_device_put(dev);
 		return ERR_PTR(ret);
 	}
 
Signature · 1 line
1.7.4.4
#7 lore raw

PATCH 4/31 ARM: amba: integrator: convert to use amba_device_alloc

In reply to Russell King - ARM Linux

Convert Integrator IM/PD-1 to use the new amba_device_alloc APIs.

---
 arch/arm/mach-integrator/impd1.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
arch/arm/mach-integrator/impd1.c +3 -6
index 8cbb75a..3e538da 100644
@@ -401,24 +401,21 @@ static int impd1_probe(struct lm_device *dev)
 
 		pc_base = dev->resource.start + idev->offset;
 
-		d = kzalloc(sizeof(struct amba_device), GFP_KERNEL);
+		d = amba_device_alloc(NULL, pc_base, SZ_4K);
 		if (!d)
 			continue;
 
 		dev_set_name(&d->dev, "lm%x:%5.5lx", dev->id, idev->offset >> 12);
 		d->dev.parent	= &dev->dev;
-		d->res.start	= dev->resource.start + idev->offset;
-		d->res.end	= d->res.start + SZ_4K - 1;
-		d->res.flags	= IORESOURCE_MEM;
 		d->irq[0]	= dev->irq;
 		d->irq[1]	= dev->irq;
 		d->periphid	= idev->id;
 		d->dev.platform_data = idev->platform_data;
 
-		ret = amba_device_register(d, &dev->resource);
+		ret = amba_device_add(d, &dev->resource);
 		if (ret) {
 			dev_err(&d->dev, "unable to register device: %d\n", ret);
-			kfree(d);
+			amba_device_put(d);
 		}
 	}
 
Signature · 1 line
1.7.4.4
#8 lore raw

PATCH 5/31 ARM: amba: mxs: convert to use amba_device_alloc

In reply to Russell King - ARM Linux

Convert MXS to use the new amba_device_alloc APIs.

---
 arch/arm/mach-mxs/devices.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-mxs/devices.c +5 -3
index fe3e847..052d8dd 100644
@@ -77,16 +77,18 @@ struct platform_device *__init mxs_add_platform_device_dmamask(
 
 int __init mxs_add_amba_device(const struct amba_device *dev)
 {
-	struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+	struct amba_device *adev = amba_device_alloc(dev->init_name,
+		dev->res.start, resource_size(&dev->res));
 
 	if (!adev) {
 		pr_err("%s: failed to allocate memory", __func__);
 		return -ENOMEM;
 	}
 
-	*adev = *dev;
+	adev->irq[0] = dev->irq[0];
+	adev->irq[1] = dev->irq[1];
 
-	return amba_device_register(adev, &iomem_resource);
+	return amba_device_add(adev, &iomem_resource);
 }
 
 struct device mxs_apbh_bus = {
Signature · 1 line
1.7.4.4
#9 lore raw

PATCH 5/31 ARM: amba: mxs: convert to use amba_device_alloc

Quoted 12 lines · Russell King - ARM Linux

Convert MXS to use the new amba_device_alloc APIs.

---
 arch/arm/mach-mxs/devices.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-mxs/devices.c +0 -0
index fe3e847..052d8dd 100644

arch/arm/mach-mxs/devices.c struct platform_device *__init mxs_add_platform_device_dmamask( · line 80

Quoted 5 lines
arch/arm/mach-mxs/devices.c +1 -1
@@ -77,16 +77,18 @@ struct platform_device *__init mxs_add_platform_device_dmamask(
 
 int __init mxs_add_amba_device(const struct amba_device *dev)
 {
-	struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+	struct amba_device *adev = amba_device_alloc(dev->init_name,

The 'dev->init_name' needs to be 'dev->dev.init_name'. Otherwise, we see the compile error below.

CC arch/arm/mach-mxs/devices.o
arch/arm/mach-mxs/devices.c: In function ‘mxs_add_amba_device’:
arch/arm/mach-mxs/devices.c:80:50: error: ‘const struct amba_device’ has no member named ‘init_name’

Other than that,

Regards,
Shawn

Quoted 17 lines
arch/arm/mach-mxs/devices.c +4 -2
+		dev->res.start, resource_size(&dev->res));
 
 	if (!adev) {
 		pr_err("%s: failed to allocate memory", __func__);
 		return -ENOMEM;
 	}
 
-	*adev = *dev;
+	adev->irq[0] = dev->irq[0];
+	adev->irq[1] = dev->irq[1];
 
-	return amba_device_register(adev, &iomem_resource);
+	return amba_device_add(adev, &iomem_resource);
 }
 
 struct device mxs_apbh_bus = {
#10 lore raw

PATCH 5/31 ARM: amba: mxs: convert to use amba_device_alloc

Quoted 14 lines · Shawn Guo
Quoted 13 lines · Russell King - ARM Linux

Convert MXS to use the new amba_device_alloc APIs.

---
 arch/arm/mach-mxs/devices.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/mach-mxs/devices.c +0 -0
index fe3e847..052d8dd 100644
@@ -77,16 +77,18 @@ struct platform_device *__init mxs_add_platform_device_dmamask(
 
Quoted 7 lines

arch/arm/mach-mxs/devices.c struct platform_device *__init mxs_add_platform_device_dmamask( · line 80

Quoted 4 lines
arch/arm/mach-mxs/devices.c +1 -1
 int __init mxs_add_amba_device(const struct amba_device *dev)
 {
-	struct amba_device *adev = kmalloc(sizeof(*adev), GFP_KERNEL);
+	struct amba_device *adev = amba_device_alloc(dev->init_name,

The 'dev->init_name' needs to be 'dev->dev.init_name'. Otherwise, we see the compile error below.

Good catch, fixed, and ack added, thanks.

#11 lore raw

PATCH 6/31 ARM: amba: make irq 0 invalid

In reply to Russell King - ARM Linux

Fix core bus and MMCI such that irq 0 means that there is no IRQ attached.

---
 drivers/amba/bus.c      |    4 ++--
 drivers/mmc/host/mmci.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/amba/bus.c +2 -2
index 82b65e1..d15acbb 100644
@@ -564,9 +564,9 @@ int amba_device_add(struct amba_device *dev, struct resource *parent)
 	if (ret)
 		goto err_release;
 
-	if (dev->irq[0] != NO_IRQ)
+	if (dev->irq[0] && dev->irq[0] != NO_IRQ)
 		ret = device_create_file(&dev->dev, &dev_attr_irq0);
-	if (ret == 0 && dev->irq[1] != NO_IRQ)
+	if (ret == 0 && dev->irq[1] && dev->irq[1] != NO_IRQ)
 		ret = device_create_file(&dev->dev, &dev_attr_irq1);
 	if (ret == 0)
 		return ret;
drivers/mmc/host/mmci.c +1 -1
index 0d955ff..304f2f9 100644
@@ -1325,7 +1325,7 @@ static int __devinit mmci_probe(struct amba_device *dev,
 	if (ret)
 		goto unmap;
 
-	if (dev->irq[1] == NO_IRQ)
+	if (dev->irq[1] == NO_IRQ || !dev->irq[1])
 		host->singleirq = true;
 	else {
 		ret = request_irq(dev->irq[1], mmci_pio_irq, IRQF_SHARED,
Signature · 1 line
1.7.4.4
#12 lore raw

PATCH 7/31 ARM: amba: ux500: get rid of NO_IRQ

In reply to Russell King - ARM Linux

irq 0 now means no irq, so get rid of this unnecessary initializer.

---
 arch/arm/mach-ux500/devices-common.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/devices-common.c +0 -1
index e8c34fa..898a645 100644
@@ -34,7 +34,6 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
 	dev->irq[0] = irq;
-	dev->irq[1] = NO_IRQ;
 
 	dev->periphid = periphid;
 
Signature · 1 line
1.7.4.4
#13 lore raw

PATCH 7/31 ARM: amba: ux500: get rid of NO_IRQ

Quoted 12 lines · Russell King - ARM Linux

irq 0 now means no irq, so get rid of this unnecessary initializer.

---
 arch/arm/mach-ux500/devices-common.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
arch/arm/mach-ux500/devices-common.c +0 -0
index e8c34fa..898a645 100644

arch/arm/mach-ux500/devices-common.c dbx500_add_amba_device(const char *name, resource_size_t base, · line 37

Quoted 4 lines
arch/arm/mach-ux500/devices-common.c +0 -1
@@ -34,7 +34,6 @@ dbx500_add_amba_device(const char *name, resource_size_t base,
 	dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
 	dev->irq[0] = irq;
-	dev->irq[1] = NO_IRQ;
#15 lore raw

PATCH 8/31 ARM: amba: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-ep93xx/core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-ep93xx/core.c +3 -3
index 24203f9..1a8397a 100644
@@ -289,7 +289,7 @@ static struct amba_device uart1_device = {
 		.end	= EP93XX_UART1_PHYS_BASE + 0x0fff,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_EP93XX_UART1, NO_IRQ },
+	.irq		= { IRQ_EP93XX_UART1 },
 	.periphid	= 0x00041010,
 };
 
@@ -303,7 +303,7 @@ static struct amba_device uart2_device = {
 		.end	= EP93XX_UART2_PHYS_BASE + 0x0fff,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_EP93XX_UART2, NO_IRQ },
+	.irq		= { IRQ_EP93XX_UART2 },
 	.periphid	= 0x00041010,
 };
 
@@ -317,7 +317,7 @@ static struct amba_device uart3_device = {
 		.end	= EP93XX_UART3_PHYS_BASE + 0x0fff,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_EP93XX_UART3, NO_IRQ },
+	.irq		= { IRQ_EP93XX_UART3 },
 	.periphid	= 0x00041010,
 };
 
Signature · 1 line
1.7.4.4
#16 lore raw

PATCH 9/31 ARM: amba: samsung: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-exynos/dma.c  |    4 ++--
 arch/arm/mach-s5p64x0/dma.c |    2 +-
 arch/arm/mach-s5pc100/dma.c |    4 ++--
 arch/arm/mach-s5pv210/dma.c |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-exynos/dma.c +2 -2
index b10fcd2..8d681bf 100644
@@ -86,7 +86,7 @@ struct amba_device exynos4_device_pdma0 = {
 		.end = EXYNOS4_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -135,7 +135,7 @@ struct amba_device exynos4_device_pdma1 = {
 		.end = EXYNOS4_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5p64x0/dma.c +1 -1
index f820c07..99049aa 100644
@@ -119,7 +119,7 @@ struct amba_device s5p64x0_device_pdma = {
 		.end = S5P64X0_PA_PDMA + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_DMA0, NO_IRQ},
+	.irq = {IRQ_DMA0},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5pc100/dma.c +2 -2
index c841f4d3..ac08d7e 100644
@@ -85,7 +85,7 @@ struct amba_device s5pc100_device_pdma0 = {
 		.end = S5PC100_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -139,7 +139,7 @@ struct amba_device s5pc100_device_pdma1 = {
 		.end = S5PC100_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5pv210/dma.c +2 -2
index a6113e0..8602fa5 100644
@@ -83,7 +83,7 @@ struct amba_device s5pv210_device_pdma0 = {
 		.end = S5PV210_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -139,7 +139,7 @@ struct amba_device s5pv210_device_pdma1 = {
 		.end = S5PV210_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
Signature · 1 line
1.7.4.4
#17 lore raw

PATCH 9/31 ARM: amba: samsung: get rid of NO_IRQ initializers

Quoted 2 lines · Russell King

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 88 lines
---
 arch/arm/mach-exynos/dma.c  |    4 ++--
 arch/arm/mach-s5p64x0/dma.c |    2 +-
 arch/arm/mach-s5pc100/dma.c |    4 ++--
 arch/arm/mach-s5pv210/dma.c |    4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-exynos/dma.c +2 -2
index b10fcd2..8d681bf 100644
@@ -86,7 +86,7 @@ struct amba_device exynos4_device_pdma0 = {
 		.end = EXYNOS4_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -135,7 +135,7 @@ struct amba_device exynos4_device_pdma1 = {
 		.end = EXYNOS4_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5p64x0/dma.c +1 -1
index f820c07..99049aa 100644
@@ -119,7 +119,7 @@ struct amba_device s5p64x0_device_pdma = {
 		.end = S5P64X0_PA_PDMA + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_DMA0, NO_IRQ},
+	.irq = {IRQ_DMA0},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5pc100/dma.c +2 -2
index c841f4d3..ac08d7e 100644
@@ -85,7 +85,7 @@ struct amba_device s5pc100_device_pdma0 = {
 		.end = S5PC100_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -139,7 +139,7 @@ struct amba_device s5pc100_device_pdma1 = {
 		.end = S5PC100_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
arch/arm/mach-s5pv210/dma.c +2 -3
index a6113e0..8602fa5 100644
@@ -83,7 +83,7 @@ struct amba_device s5pv210_device_pdma0 = {
 		.end = S5PV210_PA_PDMA0 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA0, NO_IRQ},
+	.irq = {IRQ_PDMA0},
 	.periphid = 0x00041330,
 };
 
@@ -139,7 +139,7 @@ struct amba_device s5pv210_device_pdma1 = {
 		.end = S5PV210_PA_PDMA1 + SZ_4K,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_PDMA1, NO_IRQ},
+	.irq = {IRQ_PDMA1},
 	.periphid = 0x00041330,
 };
 
--

1.7.4.4

#18 lore raw

PATCH 10/31 ARM: amba: integrator/realview/versatile/vexpress: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-integrator/core.c                |   10 +++---
 arch/arm/mach-integrator/integrator_cp.c       |    4 +-
 arch/arm/mach-realview/realview_eb.c           |   40 ++++++++++++------------
 arch/arm/mach-realview/realview_pb1176.c       |   40 ++++++++++++------------
 arch/arm/mach-realview/realview_pb11mp.c       |   40 ++++++++++++------------
 arch/arm/mach-realview/realview_pba8.c         |   40 ++++++++++++------------
 arch/arm/mach-realview/realview_pbx.c          |   40 ++++++++++++------------
 arch/arm/mach-versatile/core.c                 |   34 ++++++++++----------
 arch/arm/mach-versatile/versatile_pb.c         |    8 ++--
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h |    2 +-
 10 files changed, 129 insertions(+), 129 deletions(-)
arch/arm/mach-integrator/core.c +5 -5
index 019f0ab..29baef9 100644
@@ -44,7 +44,7 @@ static struct amba_device rtc_device = {
 		.end	= INTEGRATOR_RTC_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_RTCINT, NO_IRQ },
+	.irq		= { IRQ_RTCINT },
 };
 
 static struct amba_device uart0_device = {
@@ -57,7 +57,7 @@ static struct amba_device uart0_device = {
 		.end	= INTEGRATOR_UART0_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_UARTINT0, NO_IRQ },
+	.irq		= { IRQ_UARTINT0 },
 };
 
 static struct amba_device uart1_device = {
@@ -70,7 +70,7 @@ static struct amba_device uart1_device = {
 		.end	= INTEGRATOR_UART1_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_UARTINT1, NO_IRQ },
+	.irq		= { IRQ_UARTINT1 },
 };
 
 static struct amba_device kmi0_device = {
@@ -82,7 +82,7 @@ static struct amba_device kmi0_device = {
 		.end	= KMI0_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_KMIINT0, NO_IRQ },
+	.irq		= { IRQ_KMIINT0 },
 };
 
 static struct amba_device kmi1_device = {
@@ -94,7 +94,7 @@ static struct amba_device kmi1_device = {
 		.end	= KMI1_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_KMIINT1, NO_IRQ },
+	.irq		= { IRQ_KMIINT1 },
 };
 
 static struct amba_device *amba_devs[] __initdata = {
arch/arm/mach-integrator/integrator_cp.c +2 -2
index a8b6aa6..ecc08ed 100644
@@ -370,7 +370,7 @@ static struct amba_device aaci_device = {
 		.end	= INTEGRATOR_CP_AACI_BASE + SZ_4K - 1,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { IRQ_CP_AACIINT, NO_IRQ },
+	.irq		= { IRQ_CP_AACIINT },
 	.periphid	= 0,
 };
 
@@ -437,7 +437,7 @@ static struct amba_device clcd_device = {
 		.flags	= IORESOURCE_MEM,
 	},
 	.dma_mask	= ~0,
-	.irq		= { IRQ_CP_CLCDCINT, NO_IRQ },
+	.irq		= { IRQ_CP_CLCDCINT },
 	.periphid	= 0,
 };
 
arch/arm/mach-realview/realview_eb.c +20 -20
index e629621..5c810e5 100644
@@ -140,40 +140,40 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 /*
  * These devices are connected via the core APB bridge
  */
-#define GPIO2_IRQ	{ IRQ_EB_GPIO2, NO_IRQ }
-#define GPIO3_IRQ	{ IRQ_EB_GPIO3, NO_IRQ }
+#define GPIO2_IRQ	{ IRQ_EB_GPIO2 }
+#define GPIO3_IRQ	{ IRQ_EB_GPIO3 }
 
-#define AACI_IRQ	{ IRQ_EB_AACI, NO_IRQ }
+#define AACI_IRQ	{ IRQ_EB_AACI }
 #define MMCI0_IRQ	{ IRQ_EB_MMCI0A, IRQ_EB_MMCI0B }
-#define KMI0_IRQ	{ IRQ_EB_KMI0, NO_IRQ }
-#define KMI1_IRQ	{ IRQ_EB_KMI1, NO_IRQ }
+#define KMI0_IRQ	{ IRQ_EB_KMI0 }
+#define KMI1_IRQ	{ IRQ_EB_KMI1 }
 
 /*
  * These devices are connected directly to the multi-layer AHB switch
  */
-#define EB_SMC_IRQ	{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ	{ NO_IRQ, NO_IRQ }
-#define EB_CLCD_IRQ	{ IRQ_EB_CLCD, NO_IRQ }
-#define DMAC_IRQ	{ IRQ_EB_DMA, NO_IRQ }
+#define EB_SMC_IRQ	{ }
+#define MPMC_IRQ	{ }
+#define EB_CLCD_IRQ	{ IRQ_EB_CLCD }
+#define DMAC_IRQ	{ IRQ_EB_DMA }
 
 /*
  * These devices are connected via the core APB bridge
  */
-#define SCTL_IRQ	{ NO_IRQ, NO_IRQ }
-#define EB_WATCHDOG_IRQ	{ IRQ_EB_WDOG, NO_IRQ }
-#define EB_GPIO0_IRQ	{ IRQ_EB_GPIO0, NO_IRQ }
-#define GPIO1_IRQ	{ IRQ_EB_GPIO1, NO_IRQ }
-#define EB_RTC_IRQ	{ IRQ_EB_RTC, NO_IRQ }
+#define SCTL_IRQ	{ }
+#define EB_WATCHDOG_IRQ	{ IRQ_EB_WDOG }
+#define EB_GPIO0_IRQ	{ IRQ_EB_GPIO0 }
+#define GPIO1_IRQ	{ IRQ_EB_GPIO1 }
+#define EB_RTC_IRQ	{ IRQ_EB_RTC }
 
 /*
  * These devices are connected via the DMA APB bridge
  */
-#define SCI_IRQ		{ IRQ_EB_SCI, NO_IRQ }
-#define EB_UART0_IRQ	{ IRQ_EB_UART0, NO_IRQ }
-#define EB_UART1_IRQ	{ IRQ_EB_UART1, NO_IRQ }
-#define EB_UART2_IRQ	{ IRQ_EB_UART2, NO_IRQ }
-#define EB_UART3_IRQ	{ IRQ_EB_UART3, NO_IRQ }
-#define EB_SSP_IRQ	{ IRQ_EB_SSP, NO_IRQ }
+#define SCI_IRQ		{ IRQ_EB_SCI }
+#define EB_UART0_IRQ	{ IRQ_EB_UART0 }
+#define EB_UART1_IRQ	{ IRQ_EB_UART1 }
+#define EB_UART2_IRQ	{ IRQ_EB_UART2 }
+#define EB_UART3_IRQ	{ IRQ_EB_UART3 }
+#define EB_SSP_IRQ	{ IRQ_EB_SSP }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,  "fpga:aaci",  AACI,     NULL);
arch/arm/mach-realview/realview_pb1176.c +20 -20
index e4abe94..9506de9 100644
@@ -132,27 +132,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 /*
  * RealView PB1176 AMBA devices
  */
-#define GPIO2_IRQ	{ IRQ_PB1176_GPIO2, NO_IRQ }
-#define GPIO3_IRQ	{ IRQ_PB1176_GPIO3, NO_IRQ }
-#define AACI_IRQ	{ IRQ_PB1176_AACI, NO_IRQ }
+#define GPIO2_IRQ	{ IRQ_PB1176_GPIO2 }
+#define GPIO3_IRQ	{ IRQ_PB1176_GPIO3 }
+#define AACI_IRQ	{ IRQ_PB1176_AACI }
 #define MMCI0_IRQ	{ IRQ_PB1176_MMCI0A, IRQ_PB1176_MMCI0B }
-#define KMI0_IRQ	{ IRQ_PB1176_KMI0, NO_IRQ }
-#define KMI1_IRQ	{ IRQ_PB1176_KMI1, NO_IRQ }
-#define PB1176_SMC_IRQ	{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ	{ NO_IRQ, NO_IRQ }
-#define PB1176_CLCD_IRQ	{ IRQ_DC1176_CLCD, NO_IRQ }
-#define SCTL_IRQ	{ NO_IRQ, NO_IRQ }
-#define PB1176_WATCHDOG_IRQ	{ IRQ_DC1176_WATCHDOG, NO_IRQ }
-#define PB1176_GPIO0_IRQ	{ IRQ_PB1176_GPIO0, NO_IRQ }
-#define GPIO1_IRQ	{ IRQ_PB1176_GPIO1, NO_IRQ }
-#define PB1176_RTC_IRQ	{ IRQ_DC1176_RTC, NO_IRQ }
-#define SCI_IRQ		{ IRQ_PB1176_SCI, NO_IRQ }
-#define PB1176_UART0_IRQ	{ IRQ_DC1176_UART0, NO_IRQ }
-#define PB1176_UART1_IRQ	{ IRQ_DC1176_UART1, NO_IRQ }
-#define PB1176_UART2_IRQ	{ IRQ_DC1176_UART2, NO_IRQ }
-#define PB1176_UART3_IRQ	{ IRQ_DC1176_UART3, NO_IRQ }
-#define PB1176_UART4_IRQ	{ IRQ_PB1176_UART4, NO_IRQ }
-#define PB1176_SSP_IRQ		{ IRQ_DC1176_SSP, NO_IRQ }
+#define KMI0_IRQ	{ IRQ_PB1176_KMI0 }
+#define KMI1_IRQ	{ IRQ_PB1176_KMI1 }
+#define PB1176_SMC_IRQ	{ }
+#define MPMC_IRQ	{ }
+#define PB1176_CLCD_IRQ	{ IRQ_DC1176_CLCD }
+#define SCTL_IRQ	{ }
+#define PB1176_WATCHDOG_IRQ	{ IRQ_DC1176_WATCHDOG }
+#define PB1176_GPIO0_IRQ	{ IRQ_PB1176_GPIO0 }
+#define GPIO1_IRQ	{ IRQ_PB1176_GPIO1 }
+#define PB1176_RTC_IRQ	{ IRQ_DC1176_RTC }
+#define SCI_IRQ		{ IRQ_PB1176_SCI }
+#define PB1176_UART0_IRQ	{ IRQ_DC1176_UART0 }
+#define PB1176_UART1_IRQ	{ IRQ_DC1176_UART1 }
+#define PB1176_UART2_IRQ	{ IRQ_DC1176_UART2 }
+#define PB1176_UART3_IRQ	{ IRQ_DC1176_UART3 }
+#define PB1176_UART4_IRQ	{ IRQ_PB1176_UART4 }
+#define PB1176_SSP_IRQ		{ IRQ_DC1176_SSP }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
arch/arm/mach-realview/realview_pb11mp.c +20 -20
index 127a3fd..cb4f2da 100644
@@ -132,27 +132,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
  * RealView PB11MPCore AMBA devices
  */
 
-#define GPIO2_IRQ		{ IRQ_PB11MP_GPIO2, NO_IRQ }
-#define GPIO3_IRQ		{ IRQ_PB11MP_GPIO3, NO_IRQ }
-#define AACI_IRQ		{ IRQ_TC11MP_AACI, NO_IRQ }
+#define GPIO2_IRQ		{ IRQ_PB11MP_GPIO2 }
+#define GPIO3_IRQ		{ IRQ_PB11MP_GPIO3 }
+#define AACI_IRQ		{ IRQ_TC11MP_AACI }
 #define MMCI0_IRQ		{ IRQ_TC11MP_MMCI0A, IRQ_TC11MP_MMCI0B }
-#define KMI0_IRQ		{ IRQ_TC11MP_KMI0, NO_IRQ }
-#define KMI1_IRQ		{ IRQ_TC11MP_KMI1, NO_IRQ }
-#define PB11MP_SMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define PB11MP_CLCD_IRQ		{ IRQ_PB11MP_CLCD, NO_IRQ }
-#define DMAC_IRQ		{ IRQ_PB11MP_DMAC, NO_IRQ }
-#define SCTL_IRQ		{ NO_IRQ, NO_IRQ }
-#define PB11MP_WATCHDOG_IRQ	{ IRQ_PB11MP_WATCHDOG, NO_IRQ }
-#define PB11MP_GPIO0_IRQ	{ IRQ_PB11MP_GPIO0, NO_IRQ }
-#define GPIO1_IRQ		{ IRQ_PB11MP_GPIO1, NO_IRQ }
-#define PB11MP_RTC_IRQ		{ IRQ_TC11MP_RTC, NO_IRQ }
-#define SCI_IRQ			{ IRQ_PB11MP_SCI, NO_IRQ }
-#define PB11MP_UART0_IRQ	{ IRQ_TC11MP_UART0, NO_IRQ }
-#define PB11MP_UART1_IRQ	{ IRQ_TC11MP_UART1, NO_IRQ }
-#define PB11MP_UART2_IRQ	{ IRQ_PB11MP_UART2, NO_IRQ }
-#define PB11MP_UART3_IRQ	{ IRQ_PB11MP_UART3, NO_IRQ }
-#define PB11MP_SSP_IRQ		{ IRQ_PB11MP_SSP, NO_IRQ }
+#define KMI0_IRQ		{ IRQ_TC11MP_KMI0 }
+#define KMI1_IRQ		{ IRQ_TC11MP_KMI1 }
+#define PB11MP_SMC_IRQ		{ }
+#define MPMC_IRQ		{ }
+#define PB11MP_CLCD_IRQ		{ IRQ_PB11MP_CLCD }
+#define DMAC_IRQ		{ IRQ_PB11MP_DMAC }
+#define SCTL_IRQ		{ }
+#define PB11MP_WATCHDOG_IRQ	{ IRQ_PB11MP_WATCHDOG }
+#define PB11MP_GPIO0_IRQ	{ IRQ_PB11MP_GPIO0 }
+#define GPIO1_IRQ		{ IRQ_PB11MP_GPIO1 }
+#define PB11MP_RTC_IRQ		{ IRQ_TC11MP_RTC }
+#define SCI_IRQ			{ IRQ_PB11MP_SCI }
+#define PB11MP_UART0_IRQ	{ IRQ_TC11MP_UART0 }
+#define PB11MP_UART1_IRQ	{ IRQ_TC11MP_UART1 }
+#define PB11MP_UART2_IRQ	{ IRQ_PB11MP_UART2 }
+#define PB11MP_UART3_IRQ	{ IRQ_PB11MP_UART3 }
+#define PB11MP_SSP_IRQ		{ IRQ_PB11MP_SSP }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
arch/arm/mach-realview/realview_pba8.c +20 -20
index 25b2e59..293de21 100644
@@ -122,27 +122,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
  * RealView PBA8Core AMBA devices
  */
 
-#define GPIO2_IRQ		{ IRQ_PBA8_GPIO2, NO_IRQ }
-#define GPIO3_IRQ		{ IRQ_PBA8_GPIO3, NO_IRQ }
-#define AACI_IRQ		{ IRQ_PBA8_AACI, NO_IRQ }
+#define GPIO2_IRQ		{ IRQ_PBA8_GPIO2 }
+#define GPIO3_IRQ		{ IRQ_PBA8_GPIO3 }
+#define AACI_IRQ		{ IRQ_PBA8_AACI }
 #define MMCI0_IRQ		{ IRQ_PBA8_MMCI0A, IRQ_PBA8_MMCI0B }
-#define KMI0_IRQ		{ IRQ_PBA8_KMI0, NO_IRQ }
-#define KMI1_IRQ		{ IRQ_PBA8_KMI1, NO_IRQ }
-#define PBA8_SMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define PBA8_CLCD_IRQ		{ IRQ_PBA8_CLCD, NO_IRQ }
-#define DMAC_IRQ		{ IRQ_PBA8_DMAC, NO_IRQ }
-#define SCTL_IRQ		{ NO_IRQ, NO_IRQ }
-#define PBA8_WATCHDOG_IRQ	{ IRQ_PBA8_WATCHDOG, NO_IRQ }
-#define PBA8_GPIO0_IRQ		{ IRQ_PBA8_GPIO0, NO_IRQ }
-#define GPIO1_IRQ		{ IRQ_PBA8_GPIO1, NO_IRQ }
-#define PBA8_RTC_IRQ		{ IRQ_PBA8_RTC, NO_IRQ }
-#define SCI_IRQ			{ IRQ_PBA8_SCI, NO_IRQ }
-#define PBA8_UART0_IRQ		{ IRQ_PBA8_UART0, NO_IRQ }
-#define PBA8_UART1_IRQ		{ IRQ_PBA8_UART1, NO_IRQ }
-#define PBA8_UART2_IRQ		{ IRQ_PBA8_UART2, NO_IRQ }
-#define PBA8_UART3_IRQ		{ IRQ_PBA8_UART3, NO_IRQ }
-#define PBA8_SSP_IRQ		{ IRQ_PBA8_SSP, NO_IRQ }
+#define KMI0_IRQ		{ IRQ_PBA8_KMI0 }
+#define KMI1_IRQ		{ IRQ_PBA8_KMI1 }
+#define PBA8_SMC_IRQ		{ }
+#define MPMC_IRQ		{ }
+#define PBA8_CLCD_IRQ		{ IRQ_PBA8_CLCD }
+#define DMAC_IRQ		{ IRQ_PBA8_DMAC }
+#define SCTL_IRQ		{ }
+#define PBA8_WATCHDOG_IRQ	{ IRQ_PBA8_WATCHDOG }
+#define PBA8_GPIO0_IRQ		{ IRQ_PBA8_GPIO0 }
+#define GPIO1_IRQ		{ IRQ_PBA8_GPIO1 }
+#define PBA8_RTC_IRQ		{ IRQ_PBA8_RTC }
+#define SCI_IRQ			{ IRQ_PBA8_SCI }
+#define PBA8_UART0_IRQ		{ IRQ_PBA8_UART0 }
+#define PBA8_UART1_IRQ		{ IRQ_PBA8_UART1 }
+#define PBA8_UART2_IRQ		{ IRQ_PBA8_UART2 }
+#define PBA8_UART3_IRQ		{ IRQ_PBA8_UART3 }
+#define PBA8_SSP_IRQ		{ IRQ_PBA8_SSP }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
arch/arm/mach-realview/realview_pbx.c +20 -20
index ac71564..8e2a306 100644
@@ -144,27 +144,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
  * RealView PBXCore AMBA devices
  */
 
-#define GPIO2_IRQ		{ IRQ_PBX_GPIO2, NO_IRQ }
-#define GPIO3_IRQ		{ IRQ_PBX_GPIO3, NO_IRQ }
-#define AACI_IRQ		{ IRQ_PBX_AACI, NO_IRQ }
+#define GPIO2_IRQ		{ IRQ_PBX_GPIO2 }
+#define GPIO3_IRQ		{ IRQ_PBX_GPIO3 }
+#define AACI_IRQ		{ IRQ_PBX_AACI }
 #define MMCI0_IRQ		{ IRQ_PBX_MMCI0A, IRQ_PBX_MMCI0B }
-#define KMI0_IRQ		{ IRQ_PBX_KMI0, NO_IRQ }
-#define KMI1_IRQ		{ IRQ_PBX_KMI1, NO_IRQ }
-#define PBX_SMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define PBX_CLCD_IRQ		{ IRQ_PBX_CLCD, NO_IRQ }
-#define DMAC_IRQ		{ IRQ_PBX_DMAC, NO_IRQ }
-#define SCTL_IRQ		{ NO_IRQ, NO_IRQ }
-#define PBX_WATCHDOG_IRQ	{ IRQ_PBX_WATCHDOG, NO_IRQ }
-#define PBX_GPIO0_IRQ		{ IRQ_PBX_GPIO0, NO_IRQ }
-#define GPIO1_IRQ		{ IRQ_PBX_GPIO1, NO_IRQ }
-#define PBX_RTC_IRQ		{ IRQ_PBX_RTC, NO_IRQ }
-#define SCI_IRQ			{ IRQ_PBX_SCI, NO_IRQ }
-#define PBX_UART0_IRQ		{ IRQ_PBX_UART0, NO_IRQ }
-#define PBX_UART1_IRQ		{ IRQ_PBX_UART1, NO_IRQ }
-#define PBX_UART2_IRQ		{ IRQ_PBX_UART2, NO_IRQ }
-#define PBX_UART3_IRQ		{ IRQ_PBX_UART3, NO_IRQ }
-#define PBX_SSP_IRQ		{ IRQ_PBX_SSP, NO_IRQ }
+#define KMI0_IRQ		{ IRQ_PBX_KMI0 }
+#define KMI1_IRQ		{ IRQ_PBX_KMI1 }
+#define PBX_SMC_IRQ		{ }
+#define MPMC_IRQ		{ }
+#define PBX_CLCD_IRQ		{ IRQ_PBX_CLCD }
+#define DMAC_IRQ		{ IRQ_PBX_DMAC }
+#define SCTL_IRQ		{ }
+#define PBX_WATCHDOG_IRQ	{ IRQ_PBX_WATCHDOG }
+#define PBX_GPIO0_IRQ		{ IRQ_PBX_GPIO0 }
+#define GPIO1_IRQ		{ IRQ_PBX_GPIO1 }
+#define PBX_RTC_IRQ		{ IRQ_PBX_RTC }
+#define SCI_IRQ			{ IRQ_PBX_SCI }
+#define PBX_UART0_IRQ		{ IRQ_PBX_UART0 }
+#define PBX_UART1_IRQ		{ IRQ_PBX_UART1 }
+#define PBX_UART2_IRQ		{ IRQ_PBX_UART2 }
+#define PBX_UART3_IRQ		{ IRQ_PBX_UART3 }
+#define PBX_SSP_IRQ		{ IRQ_PBX_SSP }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
arch/arm/mach-versatile/core.c +17 -17
index 02b7b93..358cc0b 100644
@@ -582,36 +582,36 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 	.num_chipselect = 1,
 };
 
-#define AACI_IRQ	{ IRQ_AACI, NO_IRQ }
+#define AACI_IRQ	{ IRQ_AACI }
 #define MMCI0_IRQ	{ IRQ_MMCI0A,IRQ_SIC_MMCI0B }
-#define KMI0_IRQ	{ IRQ_SIC_KMI0, NO_IRQ }
-#define KMI1_IRQ	{ IRQ_SIC_KMI1, NO_IRQ }
+#define KMI0_IRQ	{ IRQ_SIC_KMI0 }
+#define KMI1_IRQ	{ IRQ_SIC_KMI1 }
 
 /*
  * These devices are connected directly to the multi-layer AHB switch
  */
-#define SMC_IRQ		{ NO_IRQ, NO_IRQ }
-#define MPMC_IRQ	{ NO_IRQ, NO_IRQ }
-#define CLCD_IRQ	{ IRQ_CLCDINT, NO_IRQ }
-#define DMAC_IRQ	{ IRQ_DMAINT, NO_IRQ }
+#define SMC_IRQ		{ }
+#define MPMC_IRQ	{ }
+#define CLCD_IRQ	{ IRQ_CLCDINT }
+#define DMAC_IRQ	{ IRQ_DMAINT }
 
 /*
  * These devices are connected via the core APB bridge
  */
-#define SCTL_IRQ	{ NO_IRQ, NO_IRQ }
-#define WATCHDOG_IRQ	{ IRQ_WDOGINT, NO_IRQ }
-#define GPIO0_IRQ	{ IRQ_GPIOINT0, NO_IRQ }
-#define GPIO1_IRQ	{ IRQ_GPIOINT1, NO_IRQ }
-#define RTC_IRQ		{ IRQ_RTCINT, NO_IRQ }
+#define SCTL_IRQ	{ }
+#define WATCHDOG_IRQ	{ IRQ_WDOGINT }
+#define GPIO0_IRQ	{ IRQ_GPIOINT0 }
+#define GPIO1_IRQ	{ IRQ_GPIOINT1 }
+#define RTC_IRQ		{ IRQ_RTCINT }
 
 /*
  * These devices are connected via the DMA APB bridge
  */
-#define SCI_IRQ		{ IRQ_SCIINT, NO_IRQ }
-#define UART0_IRQ	{ IRQ_UARTINT0, NO_IRQ }
-#define UART1_IRQ	{ IRQ_UARTINT1, NO_IRQ }
-#define UART2_IRQ	{ IRQ_UARTINT2, NO_IRQ }
-#define SSP_IRQ		{ IRQ_SSPINT, NO_IRQ }
+#define SCI_IRQ		{ IRQ_SCIINT }
+#define UART0_IRQ	{ IRQ_UARTINT0 }
+#define UART1_IRQ	{ IRQ_UARTINT1 }
+#define UART2_IRQ	{ IRQ_UARTINT2 }
+#define SSP_IRQ		{ IRQ_SSPINT }
 
 /* FPGA Primecells */
 AMBA_DEVICE(aaci,  "fpga:04", AACI,     NULL);
arch/arm/mach-versatile/versatile_pb.c +4 -4
index 9581c19..1a5fe6e 100644
@@ -58,15 +58,15 @@ static struct pl061_platform_data gpio3_plat_data = {
 	.irq_base	= IRQ_GPIO3_START,
 };
 
-#define UART3_IRQ	{ IRQ_SIC_UART3, NO_IRQ }
-#define SCI1_IRQ	{ IRQ_SIC_SCI3, NO_IRQ }
+#define UART3_IRQ	{ IRQ_SIC_UART3 }
+#define SCI1_IRQ	{ IRQ_SIC_SCI3 }
 #define MMCI1_IRQ	{ IRQ_MMCI1A, IRQ_SIC_MMCI1B }
 
 /*
  * These devices are connected via the core APB bridge
  */
-#define GPIO2_IRQ	{ IRQ_GPIOINT2, NO_IRQ }
-#define GPIO3_IRQ	{ IRQ_GPIOINT3, NO_IRQ }
+#define GPIO2_IRQ	{ IRQ_GPIOINT2 }
+#define GPIO3_IRQ	{ IRQ_GPIOINT3 }
 
 /*
  * These devices are connected via the DMA APB bridge
arch/arm/mach-vexpress/include/mach/ct-ca9x4.h +1 -1
index a34d3d4..a40468f 100644
@@ -35,7 +35,7 @@
  * Interrupts.  Those in {} are for AMBA devices
  */
 #define IRQ_CT_CA9X4_CLCDC	{ 76 }
-#define IRQ_CT_CA9X4_DMC	{ -1 }
+#define IRQ_CT_CA9X4_DMC	{ 0 }
 #define IRQ_CT_CA9X4_SMC	{ 77, 78 }
 #define IRQ_CT_CA9X4_TIMER0	80
 #define IRQ_CT_CA9X4_TIMER1	81
Signature · 1 line
1.7.4.4
#19 lore raw

PATCH 11/31 ARM: amba: lpc32xx: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-lpc32xx/phy3250.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-lpc32xx/phy3250.c +2 -2
index bfee5b4..025eb21 100644
@@ -161,7 +161,7 @@ static struct amba_device lpc32xx_clcd_device = {
 		.flags			= IORESOURCE_MEM,
 	},
 	.dma_mask			= ~0,
-	.irq				= {IRQ_LPC32XX_LCD, NO_IRQ},
+	.irq				= {IRQ_LPC32XX_LCD},
 };
 
 /*
@@ -203,7 +203,7 @@ static struct amba_device lpc32xx_ssp0_device = {
 		.flags			= IORESOURCE_MEM,
 	},
 	.dma_mask			= ~0,
-	.irq				= {IRQ_LPC32XX_SSP0, NO_IRQ},
+	.irq				= {IRQ_LPC32XX_SSP0},
 };
 
 /* AT25 driver registration */
Signature · 1 line
1.7.4.4
#20 lore raw

PATCH 12/31 ARM: amba: mxs: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-mxs/devices/amba-duart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/devices/amba-duart.c +1 -1
index a559db0..a5479f7 100644
@@ -23,7 +23,7 @@ const struct amba_device name##_device __initconst = {		\
 		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
 		.flags = IORESOURCE_MEM,			\
 	},							\
-	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+	.irq = {soc ## _INT_DUART},				\
 }
 
 #ifdef CONFIG_SOC_IMX23
Signature · 1 line
1.7.4.4
#21 lore raw

PATCH 12/31 ARM: amba: mxs: get rid of NO_IRQ initializers

Quoted 1 line · Russell King - ARM Linux
Quoted 18 lines
---
 arch/arm/mach-mxs/devices/amba-duart.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/devices/amba-duart.c +1 -1
index a559db0..a5479f7 100644
@@ -23,7 +23,7 @@ const struct amba_device name##_device __initconst = {		\
 		.end = (soc ## _DUART_BASE_ADDR) + SZ_8K - 1,	\
 		.flags = IORESOURCE_MEM,			\
 	},							\
-	.irq = {soc ## _INT_DUART, NO_IRQ},			\
+	.irq = {soc ## _INT_DUART},				\
 }
 
 #ifdef CONFIG_SOC_IMX23
#22 lore raw

PATCH 13/31 ARM: amba: nomadik: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-nomadik/board-nhk8815.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-nomadik/board-nhk8815.c +2 -2
index 7c878bf..721e51c 100644
@@ -191,13 +191,13 @@ static void __init nhk8815_onenand_init(void)
 static struct amba_device uart0_device = {
 	.dev = { .init_name = "uart0" },
 	__MEM_4K_RESOURCE(NOMADIK_UART0_BASE),
-	.irq = {IRQ_UART0, NO_IRQ},
+	.irq = {IRQ_UART0},
 };
 
 static struct amba_device uart1_device = {
 	.dev = { .init_name = "uart1" },
 	__MEM_4K_RESOURCE(NOMADIK_UART1_BASE),
-	.irq = {IRQ_UART1, NO_IRQ},
+	.irq = {IRQ_UART1},
 };
 
 static struct amba_device *amba_devs[] __initdata = {
Signature · 1 line
1.7.4.4
#23 lore raw

PATCH 13/31 ARM: amba: nomadik: get rid of NO_IRQ initializers

arch/arm/mach-nomadik/board-nhk8815.c static void __init nhk8815_onenand_init(void) · line 194

Quoted 2 lines
arch/arm/mach-nomadik/board-nhk8815.c +1 -1
-	.irq = {IRQ_UART0, NO_IRQ},
+	.irq = {IRQ_UART0},
#25 lore raw

PATCH 14/31 ARM: amba: netx: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-netx/fb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-netx/fb.c +1 -1
index b991323..eda856c 100644
@@ -102,7 +102,7 @@ static struct amba_device fb_device = {
 		.end	= 0x00104fff,
 		.flags	= IORESOURCE_MEM,
 	},
-	.irq		= { NETX_IRQ_LCD, NO_IRQ },
+	.irq		= { NETX_IRQ_LCD },
 };
 
 int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel)
Signature · 1 line
1.7.4.4
#26 lore raw

PATCH 15/31 ARM: amba: spear: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-spear3xx/spear300.c |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c |    4 ++--
 arch/arm/mach-spear6xx/spear6xx.c |   10 +++++-----
 3 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/mach-spear3xx/spear300.c +1 -1
index a5e46b4..6fdeec9 100644
@@ -440,7 +440,7 @@ struct amba_device spear300_gpio1_device = {
 		.end = SPEAR300_GPIO_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR300_VIRQ_GPIO1, NO_IRQ},
+	.irq = {SPEAR300_VIRQ_GPIO1},
 };
 
 /* spear300 routines */
arch/arm/mach-spear3xx/spear3xx.c +2 -2
index 10af45d..bc4f1c6 100644
@@ -38,7 +38,7 @@ struct amba_device spear3xx_gpio_device = {
 		.end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR3XX_IRQ_BASIC_GPIO, NO_IRQ},
+	.irq = {SPEAR3XX_IRQ_BASIC_GPIO},
 };
 
 /* uart device registration */
@@ -51,7 +51,7 @@ struct amba_device spear3xx_uart_device = {
 		.end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR3XX_IRQ_UART, NO_IRQ},
+	.irq = {SPEAR3XX_IRQ_UART},
 };
 
 /* Do spear3xx familiy common initialization part here */
arch/arm/mach-spear6xx/spear6xx.c +5 -5
index e0f6628..b997b1b 100644
@@ -34,7 +34,7 @@ struct amba_device uart_device[] = {
 			.end = SPEAR6XX_ICM1_UART0_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_UART_0, NO_IRQ},
+		.irq = {IRQ_UART_0},
 	}, {
 		.dev = {
 			.init_name = "uart1",
@@ -44,7 +44,7 @@ struct amba_device uart_device[] = {
 			.end = SPEAR6XX_ICM1_UART1_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_UART_1, NO_IRQ},
+		.irq = {IRQ_UART_1},
 	}
 };
 
@@ -73,7 +73,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_CPU_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_LOCAL_GPIO, NO_IRQ},
+		.irq = {IRQ_LOCAL_GPIO},
 	}, {
 		.dev = {
 			.init_name = "gpio1",
@@ -84,7 +84,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_ICM3_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_BASIC_GPIO, NO_IRQ},
+		.irq = {IRQ_BASIC_GPIO},
 	}, {
 		.dev = {
 			.init_name = "gpio2",
@@ -95,7 +95,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_ICM2_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_APPL_GPIO, NO_IRQ},
+		.irq = {IRQ_APPL_GPIO},
 	}
 };
 
Signature · 1 line
1.7.4.4
#27 lore raw

PATCH 15/31 ARM: amba: spear: get rid of NO_IRQ initializers

Quoted 83 lines · Russell King - ARM Linux
---
 arch/arm/mach-spear3xx/spear300.c |    2 +-
 arch/arm/mach-spear3xx/spear3xx.c |    4 ++--
 arch/arm/mach-spear6xx/spear6xx.c |   10 +++++-----
 3 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/mach-spear3xx/spear300.c +1 -1
index a5e46b4..6fdeec9 100644
@@ -440,7 +440,7 @@ struct amba_device spear300_gpio1_device = {
 		.end = SPEAR300_GPIO_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR300_VIRQ_GPIO1, NO_IRQ},
+	.irq = {SPEAR300_VIRQ_GPIO1},
 };
 
 /* spear300 routines */
arch/arm/mach-spear3xx/spear3xx.c +2 -2
index 10af45d..bc4f1c6 100644
@@ -38,7 +38,7 @@ struct amba_device spear3xx_gpio_device = {
 		.end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR3XX_IRQ_BASIC_GPIO, NO_IRQ},
+	.irq = {SPEAR3XX_IRQ_BASIC_GPIO},
 };
 
 /* uart device registration */
@@ -51,7 +51,7 @@ struct amba_device spear3xx_uart_device = {
 		.end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {SPEAR3XX_IRQ_UART, NO_IRQ},
+	.irq = {SPEAR3XX_IRQ_UART},
 };
 
 /* Do spear3xx familiy common initialization part here */
arch/arm/mach-spear6xx/spear6xx.c +4 -4
index e0f6628..b997b1b 100644
@@ -34,7 +34,7 @@ struct amba_device uart_device[] = {
 			.end = SPEAR6XX_ICM1_UART0_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_UART_0, NO_IRQ},
+		.irq = {IRQ_UART_0},
 	}, {
 		.dev = {
 			.init_name = "uart1",
@@ -44,7 +44,7 @@ struct amba_device uart_device[] = {
 			.end = SPEAR6XX_ICM1_UART1_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_UART_1, NO_IRQ},
+		.irq = {IRQ_UART_1},
 	}
 };
 
@@ -73,7 +73,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_CPU_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_LOCAL_GPIO, NO_IRQ},
+		.irq = {IRQ_LOCAL_GPIO},
 	}, {
 		.dev = {
 			.init_name = "gpio1",
@@ -84,7 +84,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_ICM3_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_BASIC_GPIO, NO_IRQ},
+		.irq = {IRQ_BASIC_GPIO},
 	}, {
 		.dev = {
 			.init_name = "gpio2",

arch/arm/mach-spear6xx/spear6xx.c struct amba_device gpio_device[] = { · line 101

Quoted 8 lines
arch/arm/mach-spear6xx/spear6xx.c +1 -1
@@ -95,7 +95,7 @@ struct amba_device gpio_device[] = {
 			.end = SPEAR6XX_ICM2_GPIO_BASE + SZ_4K - 1,
 			.flags = IORESOURCE_MEM,
 		},
-		.irq = {IRQ_APPL_GPIO, NO_IRQ},
+		.irq = {IRQ_APPL_GPIO},
 	}
 };
 
Signature · 1 line
viresh
#28 lore raw

PATCH 16/31 ARM: amba: u300: get rid of NO_IRQ initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-u300/core.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/mach-u300/core.c +3 -3
index b4c6926..ed92967 100644
@@ -105,7 +105,7 @@ static struct amba_device uart0_device = {
 		.end   = U300_UART0_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = { IRQ_U300_UART0, NO_IRQ },
+	.irq = { IRQ_U300_UART0 },
 };
 
 /* The U335 have an additional UART1 on the APP CPU */
@@ -129,7 +129,7 @@ static struct amba_device uart1_device = {
 		.end   = U300_UART1_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = { IRQ_U300_UART1, NO_IRQ },
+	.irq = { IRQ_U300_UART1 },
 };
 #endif
 
@@ -160,7 +160,7 @@ static struct amba_device pl022_device = {
 		.end   = U300_SPI_BASE + SZ_4K - 1,
 		.flags = IORESOURCE_MEM,
 	},
-	.irq = {IRQ_U300_SPI, NO_IRQ },
+	.irq = {IRQ_U300_SPI },
 	/*
 	 * This device has a DMA channel but the Linux driver does not use
 	 * it currently.
Signature · 1 line
1.7.4.4
#30 lore raw

PATCH 17/31 ARM: amba: make use of -1 IRQs warn

In reply to Russell King - ARM Linux

Make the core warn about the use of -1 (NO_IRQ)

---
 drivers/amba/bus.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/amba/bus.c +3 -0
index d15acbb..01c2cf4 100644
@@ -511,6 +511,9 @@ int amba_device_add(struct amba_device *dev, struct resource *parent)
 	void __iomem *tmp;
 	int i, ret;
 
+	WARN_ON(dev->irq[0] == (unsigned int)-1);
+	WARN_ON(dev->irq[1] == (unsigned int)-1);
+
 	ret = request_resource(parent, &dev->res);
 	if (ret)
 		goto err_out;
Signature · 1 line
1.7.4.4
#31 lore raw

PATCH 18/31 ARM: amba: provide common initializers for static amba devices

In reply to Russell King - ARM Linux
---
 include/linux/amba/bus.h |   33 +++++++++++++++++++++++++++++++++
 1 files changed, 33 insertions(+), 0 deletions(-)
include/linux/amba/bus.h +33 -0
index e192962..a9fab83 100644
@@ -92,4 +92,37 @@ void amba_release_regions(struct amba_device *);
 #define amba_manf(d)	AMBA_MANF_BITS((d)->periphid)
 #define amba_part(d)	AMBA_PART_BITS((d)->periphid)
 
+#define __AMBA_DEV(busid, data, mask)				\
+	{							\
+		.coherent_dma_mask = mask,			\
+		.init_name = busid,				\
+		.platform_data = data,				\
+	}
+
+/*
+ * APB devices do not themselves have the ability to address memory,
+ * so DMA masks should be zero (much like USB peripheral devices.)
+ * The DMA controller DMA masks should be used instead (much like
+ * USB host controllers in conventional PCs.)
+ */
+#define AMBA_APB_DEVICE(name, busid, id, base, irqs, data)	\
+struct amba_device name##_device = {				\
+	.dev = __AMBA_DEV(busid, data, 0),			\
+	.res = DEFINE_RES_MEM(base, SZ_4K),			\
+	.irq = irqs,						\
+	.periphid = id,						\
+}
+
+/*
+ * AHB devices are DMA capable, so set their DMA masks
+ */
+#define AMBA_AHB_DEVICE(name, busid, id, base, irqs, data)	\
+struct amba_device name##_device = {				\
+	.dev = __AMBA_DEV(busid, data, ~0ULL),			\
+	.res = DEFINE_RES_MEM(base, SZ_4K),			\
+	.dma_mask = ~0ULL,					\
+	.irq = irqs,						\
+	.periphid = id,						\
+}
+
 #endif
Signature · 1 line
1.7.4.4
#33 lore raw

PATCH 19/31 ARM: amba: vexpress: get rid of private platform amba_device initializer

In reply to Russell King - ARM Linux
---
 arch/arm/mach-vexpress/core.h     |   17 -----------------
 arch/arm/mach-vexpress/ct-ca9x4.c |    8 ++++----
 arch/arm/mach-vexpress/v2m.c      |   20 ++++++++++----------
 3 files changed, 14 insertions(+), 31 deletions(-)
arch/arm/mach-vexpress/core.h +0 -17
index f439715..9f0f282 100644
@@ -1,19 +1,2 @@
 #define __MMIO_P2V(x)	(((x) & 0xfffff) | (((x) & 0x0f000000) >> 4) | 0xf8000000)
 #define MMIO_P2V(x)	((void __iomem *)__MMIO_P2V(x))
-
-#define AMBA_DEVICE(name,busid,base,plat)	\
-struct amba_device name##_device = {		\
-	.dev		= {			\
-		.coherent_dma_mask = ~0UL,	\
-		.init_name = busid,		\
-		.platform_data = plat,		\
-	},					\
-	.res		= {			\
-		.start	= base,			\
-		.end	= base + SZ_4K - 1,	\
-		.flags	= IORESOURCE_MEM,	\
-	},					\
-	.dma_mask	= ~0UL,			\
-	.irq		= IRQ_##base,		\
-	/* .dma		= DMA_##base,*/		\
-}
arch/arm/mach-vexpress/ct-ca9x4.c +4 -4
index 2b1e836..3fde21c 100644
@@ -109,10 +109,10 @@ static struct clcd_board ct_ca9x4_clcd_data = {
 	.remove		= versatile_clcd_remove_dma,
 };
 
-static AMBA_DEVICE(clcd, "ct:clcd", CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data);
-static AMBA_DEVICE(dmc, "ct:dmc", CT_CA9X4_DMC, NULL);
-static AMBA_DEVICE(smc, "ct:smc", CT_CA9X4_SMC, NULL);
-static AMBA_DEVICE(gpio, "ct:gpio", CT_CA9X4_GPIO, NULL);
+static AMBA_AHB_DEVICE(clcd, "ct:clcd", 0, CT_CA9X4_CLCDC, IRQ_CT_CA9X4_CLCDC, &ct_ca9x4_clcd_data);
+static AMBA_APB_DEVICE(dmc, "ct:dmc", 0, CT_CA9X4_DMC, IRQ_CT_CA9X4_DMC, NULL);
+static AMBA_APB_DEVICE(smc, "ct:smc", 0, CT_CA9X4_SMC, IRQ_CT_CA9X4_SMC, NULL);
+static AMBA_APB_DEVICE(gpio, "ct:gpio", 0, CT_CA9X4_GPIO, IRQ_CT_CA9X4_GPIO, NULL);
 
 static struct amba_device *ct_ca9x4_amba_devs[] __initdata = {
 	&clcd_device,
arch/arm/mach-vexpress/v2m.c +10 -10
index b4a28ca..ad64f97 100644
@@ -266,16 +266,16 @@ static struct mmci_platform_data v2m_mmci_data = {
 	.status		= v2m_mmci_status,
 };
 
-static AMBA_DEVICE(aaci,  "mb:aaci",  V2M_AACI, NULL);
-static AMBA_DEVICE(mmci,  "mb:mmci",  V2M_MMCI, &v2m_mmci_data);
-static AMBA_DEVICE(kmi0,  "mb:kmi0",  V2M_KMI0, NULL);
-static AMBA_DEVICE(kmi1,  "mb:kmi1",  V2M_KMI1, NULL);
-static AMBA_DEVICE(uart0, "mb:uart0", V2M_UART0, NULL);
-static AMBA_DEVICE(uart1, "mb:uart1", V2M_UART1, NULL);
-static AMBA_DEVICE(uart2, "mb:uart2", V2M_UART2, NULL);
-static AMBA_DEVICE(uart3, "mb:uart3", V2M_UART3, NULL);
-static AMBA_DEVICE(wdt,   "mb:wdt",   V2M_WDT, NULL);
-static AMBA_DEVICE(rtc,   "mb:rtc",   V2M_RTC, NULL);
+static AMBA_APB_DEVICE(aaci,  "mb:aaci",  0, V2M_AACI, IRQ_V2M_AACI, NULL);
+static AMBA_APB_DEVICE(mmci,  "mb:mmci",  0, V2M_MMCI, IRQ_V2M_MMCI, &v2m_mmci_data);
+static AMBA_APB_DEVICE(kmi0,  "mb:kmi0",  0, V2M_KMI0, IRQ_V2M_KMI0, NULL);
+static AMBA_APB_DEVICE(kmi1,  "mb:kmi1",  0, V2M_KMI1, IRQ_V2M_KMI1, NULL);
+static AMBA_APB_DEVICE(uart0, "mb:uart0", 0, V2M_UART0, IRQ_V2M_UART0, NULL);
+static AMBA_APB_DEVICE(uart1, "mb:uart1", 0, V2M_UART1, IRQ_V2M_UART1, NULL);
+static AMBA_APB_DEVICE(uart2, "mb:uart2", 0, V2M_UART2, IRQ_V2M_UART2, NULL);
+static AMBA_APB_DEVICE(uart3, "mb:uart3", 0, V2M_UART3, IRQ_V2M_UART3, NULL);
+static AMBA_APB_DEVICE(wdt,   "mb:wdt",   0, V2M_WDT, IRQ_V2M_WDT, NULL);
+static AMBA_APB_DEVICE(rtc,   "mb:rtc",   0, V2M_RTC, IRQ_V2M_RTC, NULL);
 
 static struct amba_device *v2m_amba_devs[] __initdata = {
 	&aaci_device,
Signature · 1 line
1.7.4.4
#34 lore raw

PATCH 19/31 ARM: amba: vexpress: get rid of private platform amba_device initializer

Quoted 6 lines · Russell King - ARM Linux
---
 arch/arm/mach-vexpress/core.h     |   17 -----------------
 arch/arm/mach-vexpress/ct-ca9x4.c |    8 ++++----
 arch/arm/mach-vexpress/v2m.c      |   20 ++++++++++----------
 3 files changed, 14 insertions(+), 31 deletions(-)

Looks good to me, and I've boot-tested it on my board as well.

Will

#35 lore raw

PATCH 20/31 ARM: amba: versatile: get rid of private platform amba_device initializer

In reply to Russell King - ARM Linux
---
 arch/arm/mach-versatile/core.c         |   36 ++++++++++++++++----------------
 arch/arm/mach-versatile/core.h         |   20 ++++-------------
 arch/arm/mach-versatile/versatile_pb.c |   10 ++++----
 3 files changed, 28 insertions(+), 38 deletions(-)
arch/arm/mach-versatile/core.c +18 -18
index 358cc0b..4f352e4 100644
@@ -614,26 +614,26 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define SSP_IRQ		{ IRQ_SSPINT }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,  "fpga:04", AACI,     NULL);
-AMBA_DEVICE(mmc0,  "fpga:05", MMCI0,    &mmc0_plat_data);
-AMBA_DEVICE(kmi0,  "fpga:06", KMI0,     NULL);
-AMBA_DEVICE(kmi1,  "fpga:07", KMI1,     NULL);
+APB_DEVICE(aaci,  "fpga:04", AACI,     NULL);
+APB_DEVICE(mmc0,  "fpga:05", MMCI0,    &mmc0_plat_data);
+APB_DEVICE(kmi0,  "fpga:06", KMI0,     NULL);
+APB_DEVICE(kmi1,  "fpga:07", KMI1,     NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,   "dev:00",  SMC,      NULL);
-AMBA_DEVICE(mpmc,  "dev:10",  MPMC,     NULL);
-AMBA_DEVICE(clcd,  "dev:20",  CLCD,     &clcd_plat_data);
-AMBA_DEVICE(dmac,  "dev:30",  DMAC,     NULL);
-AMBA_DEVICE(sctl,  "dev:e0",  SCTL,     NULL);
-AMBA_DEVICE(wdog,  "dev:e1",  WATCHDOG, NULL);
-AMBA_DEVICE(gpio0, "dev:e4",  GPIO0,    &gpio0_plat_data);
-AMBA_DEVICE(gpio1, "dev:e5",  GPIO1,    &gpio1_plat_data);
-AMBA_DEVICE(rtc,   "dev:e8",  RTC,      NULL);
-AMBA_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
-AMBA_DEVICE(uart0, "dev:f1",  UART0,    NULL);
-AMBA_DEVICE(uart1, "dev:f2",  UART1,    NULL);
-AMBA_DEVICE(uart2, "dev:f3",  UART2,    NULL);
-AMBA_DEVICE(ssp0,  "dev:f4",  SSP,      &ssp0_plat_data);
+AHB_DEVICE(smc,   "dev:00",  SMC,      NULL);
+AHB_DEVICE(mpmc,  "dev:10",  MPMC,     NULL);
+AHB_DEVICE(clcd,  "dev:20",  CLCD,     &clcd_plat_data);
+AHB_DEVICE(dmac,  "dev:30",  DMAC,     NULL);
+APB_DEVICE(sctl,  "dev:e0",  SCTL,     NULL);
+APB_DEVICE(wdog,  "dev:e1",  WATCHDOG, NULL);
+APB_DEVICE(gpio0, "dev:e4",  GPIO0,    &gpio0_plat_data);
+APB_DEVICE(gpio1, "dev:e5",  GPIO1,    &gpio1_plat_data);
+APB_DEVICE(rtc,   "dev:e8",  RTC,      NULL);
+APB_DEVICE(sci0,  "dev:f0",  SCI,      NULL);
+APB_DEVICE(uart0, "dev:f1",  UART0,    NULL);
+APB_DEVICE(uart1, "dev:f2",  UART1,    NULL);
+APB_DEVICE(uart2, "dev:f3",  UART2,    NULL);
+APB_DEVICE(ssp0,  "dev:f4",  SSP,      &ssp0_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&dmac_device,
arch/arm/mach-versatile/core.h +5 -15
index 2ef2f55..683e607 100644
@@ -36,20 +36,10 @@ extern unsigned int mmc_status(struct device *dev);
 extern struct of_dev_auxdata versatile_auxdata_lookup[];
 #endif
 
-#define AMBA_DEVICE(name,busid,base,plat)			\
-static struct amba_device name##_device = {			\
-	.dev		= {					\
-		.coherent_dma_mask = ~0,			\
-		.init_name = busid,				\
-		.platform_data = plat,				\
-	},							\
-	.res		= {					\
-		.start	= VERSATILE_##base##_BASE,		\
-		.end	= (VERSATILE_##base##_BASE) + SZ_4K - 1,\
-		.flags	= IORESOURCE_MEM,			\
-	},							\
-	.dma_mask	= ~0,					\
-	.irq		= base##_IRQ,				\
-}
+#define APB_DEVICE(name, busid, base, plat)	\
+static AMBA_APB_DEVICE(name, busid, 0, VERSATILE_##base##_BASE, base##_IRQ, plat)
+
+#define AHB_DEVICE(name, busid, base, plat)	\
+static AMBA_AHB_DEVICE(name, busid, 0, VERSATILE_##base##_BASE, base##_IRQ, plat)
 
 #endif
arch/arm/mach-versatile/versatile_pb.c +5 -5
index 1a5fe6e..1973833 100644
@@ -73,13 +73,13 @@ static struct pl061_platform_data gpio3_plat_data = {
  */
 
 /* FPGA Primecells */
-AMBA_DEVICE(uart3, "fpga:09", UART3,    NULL);
-AMBA_DEVICE(sci1,  "fpga:0a", SCI1,     NULL);
-AMBA_DEVICE(mmc1,  "fpga:0b", MMCI1,    &mmc1_plat_data);
+APB_DEVICE(uart3, "fpga:09", UART3,    NULL);
+APB_DEVICE(sci1,  "fpga:0a", SCI1,     NULL);
+APB_DEVICE(mmc1,  "fpga:0b", MMCI1,    &mmc1_plat_data);
 
 /* DevChip Primecells */
-AMBA_DEVICE(gpio2, "dev:e6",  GPIO2,    &gpio2_plat_data);
-AMBA_DEVICE(gpio3, "dev:e7",  GPIO3,    &gpio3_plat_data);
+APB_DEVICE(gpio2, "dev:e6",  GPIO2,    &gpio2_plat_data);
+APB_DEVICE(gpio3, "dev:e7",  GPIO3,    &gpio3_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&uart3_device,
Signature · 1 line
1.7.4.4
#36 lore raw

PATCH 20/31 ARM: amba: versatile: get rid of private platform amba_device initializer

Quoted 6 lines · Russell King - ARM Linux
---
 arch/arm/mach-versatile/core.c         |   36 ++++++++++++++++----------------
 arch/arm/mach-versatile/core.h         |   20 ++++-------------
 arch/arm/mach-versatile/versatile_pb.c |   10 ++++----
 3 files changed, 28 insertions(+), 38 deletions(-)

This seems happy enough on a Versatile AB926, although I do get spurious IRQs from the ethernet chip:

	eth0: spurious interrupt (mask = 0xb3)

This doesn't seem to be the fault of this patch though; I suspect it's related to the recent VIC changes and removal of MULTI_IRQ_HANDLER (especially since the ethernet interrupts lives on the secondary controller).

So for this patch:

I'll investigate the other problem separately.

Will

#37 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

In reply to Russell King - ARM Linux
---
 arch/arm/mach-realview/core.h            |   20 ++++-----------
 arch/arm/mach-realview/realview_eb.c     |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb1176.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb11mp.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pba8.c   |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pbx.c    |   38 +++++++++++++++---------------
 6 files changed, 100 insertions(+), 110 deletions(-)
arch/arm/mach-realview/core.h +5 -15
index 735b57a..b1c6097 100644
@@ -28,21 +28,11 @@
 #include <asm/setup.h>
 #include <asm/leds.h>
 
-#define AMBA_DEVICE(name,busid,base,plat)			\
-static struct amba_device name##_device = {			\
-	.dev		= {					\
-		.coherent_dma_mask = ~0,			\
-		.init_name = busid,				\
-		.platform_data = plat,				\
-	},							\
-	.res		= {					\
-		.start	= REALVIEW_##base##_BASE,		\
-		.end	= (REALVIEW_##base##_BASE) + SZ_4K - 1,	\
-		.flags	= IORESOURCE_MEM,			\
-	},							\
-	.dma_mask	= ~0,					\
-	.irq		= base##_IRQ,				\
-}
+#define APB_DEVICE(name, busid, base, plat)			\
+static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+
+#define AHB_DEVICE(name, busid, base, plat)			\
+static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
 
 struct machine_desc;
 
arch/arm/mach-realview/realview_eb.c +19 -19
index 5c810e5..fbca43c 100644
@@ -176,27 +176,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define EB_SSP_IRQ	{ IRQ_EB_SSP }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,  "fpga:aaci",  AACI,     NULL);
-AMBA_DEVICE(mmc0,  "fpga:mmc0",  MMCI0,    &realview_mmc0_plat_data);
-AMBA_DEVICE(kmi0,  "fpga:kmi0",  KMI0,     NULL);
-AMBA_DEVICE(kmi1,  "fpga:kmi1",  KMI1,     NULL);
-AMBA_DEVICE(uart3, "fpga:uart3", EB_UART3, NULL);
+APB_DEVICE(aaci,  "fpga:aaci",  AACI,     NULL);
+APB_DEVICE(mmc0,  "fpga:mmc0",  MMCI0,    &realview_mmc0_plat_data);
+APB_DEVICE(kmi0,  "fpga:kmi0",  KMI0,     NULL);
+APB_DEVICE(kmi1,  "fpga:kmi1",  KMI1,     NULL);
+APB_DEVICE(uart3, "fpga:uart3", EB_UART3, NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,   "dev:smc",   EB_SMC,   NULL);
-AMBA_DEVICE(clcd,  "dev:clcd",  EB_CLCD,  &clcd_plat_data);
-AMBA_DEVICE(dmac,  "dev:dmac",  DMAC,     NULL);
-AMBA_DEVICE(sctl,  "dev:sctl",  SCTL,     NULL);
-AMBA_DEVICE(wdog,  "dev:wdog",  EB_WATCHDOG, NULL);
-AMBA_DEVICE(gpio0, "dev:gpio0", EB_GPIO0, &gpio0_plat_data);
-AMBA_DEVICE(gpio1, "dev:gpio1", GPIO1,    &gpio1_plat_data);
-AMBA_DEVICE(gpio2, "dev:gpio2", GPIO2,    &gpio2_plat_data);
-AMBA_DEVICE(rtc,   "dev:rtc",   EB_RTC,   NULL);
-AMBA_DEVICE(sci0,  "dev:sci0",  SCI,      NULL);
-AMBA_DEVICE(uart0, "dev:uart0", EB_UART0, NULL);
-AMBA_DEVICE(uart1, "dev:uart1", EB_UART1, NULL);
-AMBA_DEVICE(uart2, "dev:uart2", EB_UART2, NULL);
-AMBA_DEVICE(ssp0,  "dev:ssp0",  EB_SSP,   &ssp0_plat_data);
+AHB_DEVICE(smc,   "dev:smc",   EB_SMC,   NULL);
+AHB_DEVICE(clcd,  "dev:clcd",  EB_CLCD,  &clcd_plat_data);
+AHB_DEVICE(dmac,  "dev:dmac",  DMAC,     NULL);
+AHB_DEVICE(sctl,  "dev:sctl",  SCTL,     NULL);
+APB_DEVICE(wdog,  "dev:wdog",  EB_WATCHDOG, NULL);
+APB_DEVICE(gpio0, "dev:gpio0", EB_GPIO0, &gpio0_plat_data);
+APB_DEVICE(gpio1, "dev:gpio1", GPIO1,    &gpio1_plat_data);
+APB_DEVICE(gpio2, "dev:gpio2", GPIO2,    &gpio2_plat_data);
+APB_DEVICE(rtc,   "dev:rtc",   EB_RTC,   NULL);
+APB_DEVICE(sci0,  "dev:sci0",  SCI,      NULL);
+APB_DEVICE(uart0, "dev:uart0", EB_UART0, NULL);
+APB_DEVICE(uart1, "dev:uart1", EB_UART1, NULL);
+APB_DEVICE(uart2, "dev:uart2", EB_UART2, NULL);
+APB_DEVICE(ssp0,  "dev:ssp0",  EB_SSP,   &ssp0_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&dmac_device,
arch/arm/mach-realview/realview_pb1176.c +19 -19
index 9506de9..1b6e60c 100644
@@ -155,27 +155,27 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_SSP_IRQ		{ IRQ_DC1176_SSP }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
-AMBA_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
-AMBA_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
-AMBA_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
-AMBA_DEVICE(uart4,	"fpga:uart4",	PB1176_UART4,	NULL);
+APB_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
+APB_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
+APB_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
+APB_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
+APB_DEVICE(uart4,	"fpga:uart4",	PB1176_UART4,	NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,	"dev:smc",	PB1176_SMC,	NULL);
-AMBA_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
-AMBA_DEVICE(wdog,	"dev:wdog",	PB1176_WATCHDOG,	NULL);
-AMBA_DEVICE(gpio0,	"dev:gpio0",	PB1176_GPIO0,	&gpio0_plat_data);
-AMBA_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
-AMBA_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
-AMBA_DEVICE(rtc,	"dev:rtc",	PB1176_RTC,	NULL);
-AMBA_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
-AMBA_DEVICE(uart0,	"dev:uart0",	PB1176_UART0,	NULL);
-AMBA_DEVICE(uart1,	"dev:uart1",	PB1176_UART1,	NULL);
-AMBA_DEVICE(uart2,	"dev:uart2",	PB1176_UART2,	NULL);
-AMBA_DEVICE(uart3,	"dev:uart3",	PB1176_UART3,	NULL);
-AMBA_DEVICE(ssp0,	"dev:ssp0",	PB1176_SSP,	&ssp0_plat_data);
-AMBA_DEVICE(clcd,	"dev:clcd",	PB1176_CLCD,	&clcd_plat_data);
+AHB_DEVICE(smc,		"dev:smc",	PB1176_SMC,	NULL);
+AHB_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
+APB_DEVICE(wdog,	"dev:wdog",	PB1176_WATCHDOG,	NULL);
+APB_DEVICE(gpio0,	"dev:gpio0",	PB1176_GPIO0,	&gpio0_plat_data);
+APB_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
+APB_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
+APB_DEVICE(rtc,		"dev:rtc",	PB1176_RTC,	NULL);
+APB_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
+APB_DEVICE(uart0,	"dev:uart0",	PB1176_UART0,	NULL);
+APB_DEVICE(uart1,	"dev:uart1",	PB1176_UART1,	NULL);
+APB_DEVICE(uart2,	"dev:uart2",	PB1176_UART2,	NULL);
+APB_DEVICE(uart3,	"dev:uart3",	PB1176_UART3,	NULL);
+APB_DEVICE(ssp0,	"dev:ssp0",	PB1176_SSP,	&ssp0_plat_data);
+AHB_DEVICE(clcd,	"dev:clcd",	PB1176_CLCD,	&clcd_plat_data);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&uart0_device,
arch/arm/mach-realview/realview_pb11mp.c +19 -19
index cb4f2da..43b82bc 100644
@@ -155,29 +155,29 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB11MP_SSP_IRQ		{ IRQ_PB11MP_SSP }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
-AMBA_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
-AMBA_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
-AMBA_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
-AMBA_DEVICE(uart3,	"fpga:uart3",	PB11MP_UART3,	NULL);
+APB_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
+APB_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
+APB_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
+APB_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
+APB_DEVICE(uart3,	"fpga:uart3",	PB11MP_UART3,	NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,	"dev:smc",	PB11MP_SMC,	NULL);
-AMBA_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
-AMBA_DEVICE(wdog,	"dev:wdog",	PB11MP_WATCHDOG, NULL);
-AMBA_DEVICE(gpio0,	"dev:gpio0",	PB11MP_GPIO0,	&gpio0_plat_data);
-AMBA_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
-AMBA_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
-AMBA_DEVICE(rtc,	"dev:rtc",	PB11MP_RTC,	NULL);
-AMBA_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
-AMBA_DEVICE(uart0,	"dev:uart0",	PB11MP_UART0,	NULL);
-AMBA_DEVICE(uart1,	"dev:uart1",	PB11MP_UART1,	NULL);
-AMBA_DEVICE(uart2,	"dev:uart2",	PB11MP_UART2,	NULL);
-AMBA_DEVICE(ssp0,	"dev:ssp0",	PB11MP_SSP,	&ssp0_plat_data);
+AHB_DEVICE(smc,		"dev:smc",	PB11MP_SMC,	NULL);
+AHB_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
+APB_DEVICE(wdog,	"dev:wdog",	PB11MP_WATCHDOG, NULL);
+APB_DEVICE(gpio0,	"dev:gpio0",	PB11MP_GPIO0,	&gpio0_plat_data);
+APB_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
+APB_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
+APB_DEVICE(rtc,		"dev:rtc",	PB11MP_RTC,	NULL);
+APB_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
+APB_DEVICE(uart0,	"dev:uart0",	PB11MP_UART0,	NULL);
+APB_DEVICE(uart1,	"dev:uart1",	PB11MP_UART1,	NULL);
+APB_DEVICE(uart2,	"dev:uart2",	PB11MP_UART2,	NULL);
+APB_DEVICE(ssp0,	"dev:ssp0",	PB11MP_SSP,	&ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
-AMBA_DEVICE(clcd,	"issp:clcd",	PB11MP_CLCD,	&clcd_plat_data);
-AMBA_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
+AHB_DEVICE(clcd,	"issp:clcd",	PB11MP_CLCD,	&clcd_plat_data);
+AHB_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&dmac_device,
arch/arm/mach-realview/realview_pba8.c +19 -19
index 293de21..5965017 100644
@@ -145,29 +145,29 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PBA8_SSP_IRQ		{ IRQ_PBA8_SSP }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
-AMBA_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
-AMBA_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
-AMBA_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
-AMBA_DEVICE(uart3,	"fpga:uart3",	PBA8_UART3,	NULL);
+APB_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
+APB_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
+APB_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
+APB_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
+APB_DEVICE(uart3,	"fpga:uart3",	PBA8_UART3,	NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,	"dev:smc",	PBA8_SMC,	NULL);
-AMBA_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
-AMBA_DEVICE(wdog,	"dev:wdog",	PBA8_WATCHDOG, NULL);
-AMBA_DEVICE(gpio0,	"dev:gpio0",	PBA8_GPIO0,	&gpio0_plat_data);
-AMBA_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
-AMBA_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
-AMBA_DEVICE(rtc,	"dev:rtc",	PBA8_RTC,	NULL);
-AMBA_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
-AMBA_DEVICE(uart0,	"dev:uart0",	PBA8_UART0,	NULL);
-AMBA_DEVICE(uart1,	"dev:uart1",	PBA8_UART1,	NULL);
-AMBA_DEVICE(uart2,	"dev:uart2",	PBA8_UART2,	NULL);
-AMBA_DEVICE(ssp0,	"dev:ssp0",	PBA8_SSP,	&ssp0_plat_data);
+AHB_DEVICE(smc,		"dev:smc",	PBA8_SMC,	NULL);
+AHB_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
+APB_DEVICE(wdog,	"dev:wdog",	PBA8_WATCHDOG, NULL);
+APB_DEVICE(gpio0,	"dev:gpio0",	PBA8_GPIO0,	&gpio0_plat_data);
+APB_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
+APB_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
+APB_DEVICE(rtc,		"dev:rtc",	PBA8_RTC,	NULL);
+APB_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
+APB_DEVICE(uart0,	"dev:uart0",	PBA8_UART0,	NULL);
+APB_DEVICE(uart1,	"dev:uart1",	PBA8_UART1,	NULL);
+APB_DEVICE(uart2,	"dev:uart2",	PBA8_UART2,	NULL);
+APB_DEVICE(ssp0,	"dev:ssp0",	PBA8_SSP,	&ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
-AMBA_DEVICE(clcd,	"issp:clcd",	PBA8_CLCD,	&clcd_plat_data);
-AMBA_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
+AHB_DEVICE(clcd,	"issp:clcd",	PBA8_CLCD,	&clcd_plat_data);
+AHB_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&dmac_device,
arch/arm/mach-realview/realview_pbx.c +19 -19
index 8e2a306..1cd9956 100644
@@ -167,29 +167,29 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PBX_SSP_IRQ		{ IRQ_PBX_SSP }
 
 /* FPGA Primecells */
-AMBA_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
-AMBA_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
-AMBA_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
-AMBA_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
-AMBA_DEVICE(uart3,	"fpga:uart3",	PBX_UART3,	NULL);
+APB_DEVICE(aaci,	"fpga:aaci",	AACI,		NULL);
+APB_DEVICE(mmc0,	"fpga:mmc0",	MMCI0,		&realview_mmc0_plat_data);
+APB_DEVICE(kmi0,	"fpga:kmi0",	KMI0,		NULL);
+APB_DEVICE(kmi1,	"fpga:kmi1",	KMI1,		NULL);
+APB_DEVICE(uart3,	"fpga:uart3",	PBX_UART3,	NULL);
 
 /* DevChip Primecells */
-AMBA_DEVICE(smc,	"dev:smc",	PBX_SMC,	NULL);
-AMBA_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
-AMBA_DEVICE(wdog,	"dev:wdog",	PBX_WATCHDOG, 	NULL);
-AMBA_DEVICE(gpio0,	"dev:gpio0",	PBX_GPIO0,	&gpio0_plat_data);
-AMBA_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
-AMBA_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
-AMBA_DEVICE(rtc,	"dev:rtc",	PBX_RTC,	NULL);
-AMBA_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
-AMBA_DEVICE(uart0,	"dev:uart0",	PBX_UART0,	NULL);
-AMBA_DEVICE(uart1,	"dev:uart1",	PBX_UART1,	NULL);
-AMBA_DEVICE(uart2,	"dev:uart2",	PBX_UART2,	NULL);
-AMBA_DEVICE(ssp0,	"dev:ssp0",	PBX_SSP,	&ssp0_plat_data);
+AHB_DEVICE(smc,	"dev:smc",	PBX_SMC,	NULL);
+AHB_DEVICE(sctl,	"dev:sctl",	SCTL,		NULL);
+APB_DEVICE(wdog,	"dev:wdog",	PBX_WATCHDOG, 	NULL);
+APB_DEVICE(gpio0,	"dev:gpio0",	PBX_GPIO0,	&gpio0_plat_data);
+APB_DEVICE(gpio1,	"dev:gpio1",	GPIO1,		&gpio1_plat_data);
+APB_DEVICE(gpio2,	"dev:gpio2",	GPIO2,		&gpio2_plat_data);
+APB_DEVICE(rtc,		"dev:rtc",	PBX_RTC,	NULL);
+APB_DEVICE(sci0,	"dev:sci0",	SCI,		NULL);
+APB_DEVICE(uart0,	"dev:uart0",	PBX_UART0,	NULL);
+APB_DEVICE(uart1,	"dev:uart1",	PBX_UART1,	NULL);
+APB_DEVICE(uart2,	"dev:uart2",	PBX_UART2,	NULL);
+APB_DEVICE(ssp0,	"dev:ssp0",	PBX_SSP,	&ssp0_plat_data);
 
 /* Primecells on the NEC ISSP chip */
-AMBA_DEVICE(clcd,	"issp:clcd",	PBX_CLCD,	&clcd_plat_data);
-AMBA_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
+AHB_DEVICE(clcd,	"issp:clcd",	PBX_CLCD,	&clcd_plat_data);
+AHB_DEVICE(dmac,	"issp:dmac",	DMAC,		NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&dmac_device,
Signature · 1 line
1.7.4.4
#38 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Hi Russell,

Quoted 9 lines · Russell King - ARM Linux
---
 arch/arm/mach-realview/core.h            |   20 ++++-----------
 arch/arm/mach-realview/realview_eb.c     |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb1176.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb11mp.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pba8.c   |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pbx.c    |   38 +++++++++++++++---------------
 6 files changed, 100 insertions(+), 110 deletions(-)

After applying this patch, I get compile-time errors in realview_*.c. E.g.:

arch/arm/mach-realview/realview_pb1176.c:158:1: error: ?AACI? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:159:1: error: ?MMCI0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:160:1: error: ?KMI0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:161:1: error: ?KMI1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:162:1: error: ?PB1176_UART4? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:165:1: error: ?PB1176_SMC? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:166:1: error: ?SCTL? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:167:1: error: ?PB1176_WATCHDOG? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:168:1: error: ?PB1176_GPIO0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:169:1: error: ?GPIO1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:170:1: error: ?GPIO2? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:171:1: error: ?PB1176_RTC? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:172:1: error: ?SCI? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:173:1: error: ?PB1176_UART0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:174:1: error: ?PB1176_UART1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:175:1: error: ?PB1176_UART2? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:176:1: error: ?PB1176_UART3? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:177:1: error: ?PB1176_SSP? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:178:1: error: ?PB1176_CLCD? undeclared here (not in a function)

Quoted 10 lines
arch/arm/mach-realview/core.h +0 -2
index 735b57a..b1c6097 100644
@@ -28,21 +28,11 @@
 #include <asm/setup.h>
 #include <asm/leds.h>
 
-#define AMBA_DEVICE(name,busid,base,plat)                      \
-static struct amba_device name##_device = {                    \

arch/arm/mach-realview/core.h line 42

Quoted 10 lines
arch/arm/mach-realview/core.h +0 -10
-       .dev            = {                                     \
-               .coherent_dma_mask = ~0,                        \
-               .init_name = busid,                             \
-               .platform_data = plat,                          \
-       },                                                      \
-       .res            = {                                     \
-               .start  = REALVIEW_##base##_BASE,               \
-               .end    = (REALVIEW_##base##_BASE) + SZ_4K - 1, \
-               .flags  = IORESOURCE_MEM,                       \
-       },                                                      

Which is because the old AMBA_DEVICE macro munges REALVIEW_ and _BASE around the peripheral identifier...

arch/arm/mach-realview/core.h line 35

Quoted 5 lines
arch/arm/mach-realview/core.h +5 -0
+#define APB_DEVICE(name, busid, base, plat)                    \
+static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+
+#define AHB_DEVICE(name, busid, base, plat)                    \
+static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat)

...whereas the new macros just use base directly.

Fixing the macro solves the build problem:

arch/arm/mach-realview/core.h +2 -2
index b1c6097..f8f2c0a 100644
@@ -29,10 +29,10 @@
 #include <asm/leds.h>
 
 #define APB_DEVICE(name, busid, base, plat)                    \
-static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
 
 #define AHB_DEVICE(name, busid, base, plat)                    \
-static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+static AMBA_AHB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
 
 struct machine_desc;
 

but then I see a warning during boot:

[    1.669654] ------------[ cut here ]------------
[    1.684021] WARNING: at drivers/amba/bus.c:514 amba_device_add+0x1b4/0x1d0()
[    1.705585] Modules linked in:
[    1.715195] [<c0013a00>] (unwind_backtrace+0x0/0xfc) from [<c03d1350>] (dump_stack+0x20/0x24)
[    1.741288] [<c03d1350>] (dump_stack+0x20/0x24) from [<c001f9b8>] (warn_slowpath_common+0x5c/0x74)
[    1.768689] [<c001f9b8>] (warn_slowpath_common+0x5c/0x74) from [<c001f9fc>] (warn_slowpath_null+0x2c/0x34)
[    1.798165] [<c001f9fc>] (warn_slowpath_null+0x2c/0x34) from [<c023dcd4>] (amba_device_add+0x1b4/0x1d0)
[    1.826857] [<c023dcd4>] (amba_device_add+0x1b4/0x1d0) from [<c023dd84>] (amba_device_register+0x94/0xc4)
[    1.856106] [<c023dd84>] (amba_device_register+0x94/0xc4) from [<c0551934>] (realview_pb1176_init+0x74/0xac)
[    1.886120] [<c0551934>] (realview_pb1176_init+0x74/0xac) from [<c054d60c>] (customize_machine+0x24/0x30)
[    1.915340] [<c054d60c>] (customize_machine+0x24/0x30) from [<c000879c>] (do_one_initcall+0x48/0x1a0)
[    1.943505] [<c000879c>] (do_one_initcall+0x48/0x1a0) from [<c054b870>] (kernel_init+0x80/0x128)
[    1.970378] [<c054b870>] (kernel_init+0x80/0x128) from [<c000ea78>] (kernel_thread_exit+0x0/0x8)
[    1.997192] ---[ end trace 1b75b31a2719ed1e ]---

I suspect that comes from PB1176_GPIO0_IRQ being -1.

Will

#39 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 106 lines · Will Deacon

Hi Russell,

Quoted 9 lines · Russell King - ARM Linux
---
 arch/arm/mach-realview/core.h            |   20 ++++-----------
 arch/arm/mach-realview/realview_eb.c     |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb1176.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pb11mp.c |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pba8.c   |   38 +++++++++++++++---------------
 arch/arm/mach-realview/realview_pbx.c    |   38 +++++++++++++++---------------
 6 files changed, 100 insertions(+), 110 deletions(-)

After applying this patch, I get compile-time errors in realview_*.c. E.g.:

arch/arm/mach-realview/realview_pb1176.c:158:1: error: ?AACI? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:159:1: error: ?MMCI0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:160:1: error: ?KMI0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:161:1: error: ?KMI1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:162:1: error: ?PB1176_UART4? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:165:1: error: ?PB1176_SMC? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:166:1: error: ?SCTL? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:167:1: error: ?PB1176_WATCHDOG? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:168:1: error: ?PB1176_GPIO0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:169:1: error: ?GPIO1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:170:1: error: ?GPIO2? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:171:1: error: ?PB1176_RTC? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:172:1: error: ?SCI? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:173:1: error: ?PB1176_UART0? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:174:1: error: ?PB1176_UART1? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:175:1: error: ?PB1176_UART2? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:176:1: error: ?PB1176_UART3? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:177:1: error: ?PB1176_SSP? undeclared here (not in a function) arch/arm/mach-realview/realview_pb1176.c:178:1: error: ?PB1176_CLCD? undeclared here (not in a function)

Quoted 10 lines
arch/arm/mach-realview/core.h +0 -2
index 735b57a..b1c6097 100644
@@ -28,21 +28,11 @@
 #include <asm/setup.h>
 #include <asm/leds.h>
 
-#define AMBA_DEVICE(name,busid,base,plat)                      \
-static struct amba_device name##_device = {                    \

arch/arm/mach-realview/core.h line 42

Quoted 10 lines
arch/arm/mach-realview/core.h +0 -10
-       .dev            = {                                     \
-               .coherent_dma_mask = ~0,                        \
-               .init_name = busid,                             \
-               .platform_data = plat,                          \
-       },                                                      \
-       .res            = {                                     \
-               .start  = REALVIEW_##base##_BASE,               \
-               .end    = (REALVIEW_##base##_BASE) + SZ_4K - 1, \
-               .flags  = IORESOURCE_MEM,                       \
-       },                                                      

Which is because the old AMBA_DEVICE macro munges REALVIEW_ and _BASE around the peripheral identifier...

arch/arm/mach-realview/core.h line 35

Quoted 5 lines
arch/arm/mach-realview/core.h +5 -0
+#define APB_DEVICE(name, busid, base, plat)                    \
+static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+
+#define AHB_DEVICE(name, busid, base, plat)                    \
+static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat)

...whereas the new macros just use base directly.

Fixing the macro solves the build problem:

arch/arm/mach-realview/core.h +2 -2
index b1c6097..f8f2c0a 100644
@@ -29,10 +29,10 @@
 #include <asm/leds.h>
 
 #define APB_DEVICE(name, busid, base, plat)                    \
-static AMBA_APB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+static AMBA_APB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
 
 #define AHB_DEVICE(name, busid, base, plat)                    \
-static AMBA_AHB_DEVICE(name, busid, 0, base, base##_IRQ, plat)
+static AMBA_AHB_DEVICE(name, busid, 0, REALVIEW_##base##_BASE, base##_IRQ, plat)
 
 struct machine_desc;
 

but then I see a warning during boot:

[    1.669654] ------------[ cut here ]------------
[    1.684021] WARNING: at drivers/amba/bus.c:514 amba_device_add+0x1b4/0x1d0()
[    1.705585] Modules linked in:
[    1.715195] [<c0013a00>] (unwind_backtrace+0x0/0xfc) from [<c03d1350>] (dump_stack+0x20/0x24)
[    1.741288] [<c03d1350>] (dump_stack+0x20/0x24) from [<c001f9b8>] (warn_slowpath_common+0x5c/0x74)
[    1.768689] [<c001f9b8>] (warn_slowpath_common+0x5c/0x74) from [<c001f9fc>] (warn_slowpath_null+0x2c/0x34)
[    1.798165] [<c001f9fc>] (warn_slowpath_null+0x2c/0x34) from [<c023dcd4>] (amba_device_add+0x1b4/0x1d0)
[    1.826857] [<c023dcd4>] (amba_device_add+0x1b4/0x1d0) from [<c023dd84>] (amba_device_register+0x94/0xc4)
[    1.856106] [<c023dd84>] (amba_device_register+0x94/0xc4) from [<c0551934>] (realview_pb1176_init+0x74/0xac)
[    1.886120] [<c0551934>] (realview_pb1176_init+0x74/0xac) from [<c054d60c>] (customize_machine+0x24/0x30)
[    1.915340] [<c054d60c>] (customize_machine+0x24/0x30) from [<c000879c>] (do_one_initcall+0x48/0x1a0)
[    1.943505] [<c000879c>] (do_one_initcall+0x48/0x1a0) from [<c054b870>] (kernel_init+0x80/0x128)
[    1.970378] [<c054b870>] (kernel_init+0x80/0x128) from [<c000ea78>] (kernel_thread_exit+0x0/0x8)
[    1.997192] ---[ end trace 1b75b31a2719ed1e ]---
Quoted 1 line

I suspect that comes from PB1176_GPIO0_IRQ being -1.

It seems you've also tested the code which detects -1 IRQs too, which is good. PB1176 needs that GPIO0_IRQ fixing, but I suspect passing zero may not be entirely a good thing for it as request_irq(0,...) probably succeeds there. I think that needs fixing before this warning can go away.

In the mean time, it's just a warning, and its saying there's something wrong there which needs fixing but without anything currently broken. So it's working as designed.

#40 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 18 lines · Russell King - ARM Linux
Quoted 17 lines · Will Deacon

but then I see a warning during boot:

[    1.669654] ------------[ cut here ]------------
[    1.684021] WARNING: at drivers/amba/bus.c:514 amba_device_add+0x1b4/0x1d0()
[    1.705585] Modules linked in:
[    1.715195] [<c0013a00>] (unwind_backtrace+0x0/0xfc) from [<c03d1350>] (dump_stack+0x20/0x24)
[    1.741288] [<c03d1350>] (dump_stack+0x20/0x24) from [<c001f9b8>] (warn_slowpath_common+0x5c/0x74)
[    1.768689] [<c001f9b8>] (warn_slowpath_common+0x5c/0x74) from [<c001f9fc>] (warn_slowpath_null+0x2c/0x34)
[    1.798165] [<c001f9fc>] (warn_slowpath_null+0x2c/0x34) from [<c023dcd4>] (amba_device_add+0x1b4/0x1d0)
[    1.826857] [<c023dcd4>] (amba_device_add+0x1b4/0x1d0) from [<c023dd84>] (amba_device_register+0x94/0xc4)
[    1.856106] [<c023dd84>] (amba_device_register+0x94/0xc4) from [<c0551934>] (realview_pb1176_init+0x74/0xac)
[    1.886120] [<c0551934>] (realview_pb1176_init+0x74/0xac) from [<c054d60c>] (customize_machine+0x24/0x30)
[    1.915340] [<c054d60c>] (customize_machine+0x24/0x30) from [<c000879c>] (do_one_initcall+0x48/0x1a0)
[    1.943505] [<c000879c>] (do_one_initcall+0x48/0x1a0) from [<c054b870>] (kernel_init+0x80/0x128)
[    1.970378] [<c054b870>] (kernel_init+0x80/0x128) from [<c000ea78>] (kernel_thread_exit+0x0/0x8)
[    1.997192] ---[ end trace 1b75b31a2719ed1e ]---
Quoted 7 lines
Quoted 1 line

I suspect that comes from PB1176_GPIO0_IRQ being -1.

It seems you've also tested the code which detects -1 IRQs too, which is good. PB1176 needs that GPIO0_IRQ fixing, but I suspect passing zero may not be entirely a good thing for it as request_irq(0,...) probably succeeds there. I think that needs fixing before this warning can go away.

Yup, I actually tested this simply by checking out your devel-3.3 branch, so the whole series has been tested on the boards that I've mentioned.

Quoted 3 lines

In the mean time, it's just a warning, and its saying there's something wrong there which needs fixing but without anything currently broken. So it's working as designed.

Right. I took a quick look at the TRM for the PB1176, and I think we do have an interrupt for GPIO0, it's just on the other GIC. This patch should do the trick, but I'm not sure what I can do to tickle the GPIO stuff anyway:

arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC                (IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC         (IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD                (IRQ_DC1176_GIC_START + 15)     /* CLCD controller */
+#define IRQ_DC1176_GPIO0       (IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP         (IRQ_DC1176_GIC_START + 17)     /* SSP port */
 #define IRQ_DC1176_UART0       (IRQ_DC1176_GIC_START + 18)     /* UART 0 on development chip */
 #define IRQ_DC1176_UART1       (IRQ_DC1176_GIC_START + 19)     /* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC                (IRQ_PB1176_GIC_START + 24)     /* DMA controller */
 #define IRQ_PB1176_RTC         (IRQ_PB1176_GIC_START + 25)     /* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0       -1
 #define IRQ_PB1176_SCTL                -1
 
 #define NR_GIC_PB1176          2
arch/arm/mach-realview/realview_pb1176.c +1 -1
index 1b6e60c..b1d7caf 100644
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ        { IRQ_DC1176_CLCD }
 #define SCTL_IRQ       { }
 #define PB1176_WATCHDOG_IRQ    { IRQ_DC1176_WATCHDOG }
-#define PB1176_GPIO0_IRQ       { IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ       { IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ      { IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ { IRQ_DC1176_RTC }
 #define SCI_IRQ                { IRQ_PB1176_SCI }

Will

#41 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 4 lines · Will Deacon

Right. I took a quick look at the TRM for the PB1176, and I think we do have an interrupt for GPIO0, it's just on the other GIC. This patch should do the trick, but I'm not sure what I can do to tickle the GPIO stuff anyway:

For a simple test just insert/remove the MMC card and see it add/remove the card (appear in console, and /proc/interrupts)

Or do you mean tickle GPIO0? That is more tricky I think...

Yours,
Linus Walleij

#42 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

In reply to Will Deacon
Quoted 30 lines · Will Deacon

Right. I took a quick look at the TRM for the PB1176, and I think we do have an interrupt for GPIO0, it's just on the other GIC. This patch should do the trick, but I'm not sure what I can do to tickle the GPIO stuff anyway:

arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC                (IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC         (IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD                (IRQ_DC1176_GIC_START + 15)     /* CLCD controller */
+#define IRQ_DC1176_GPIO0       (IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP         (IRQ_DC1176_GIC_START + 17)     /* SSP port */
 #define IRQ_DC1176_UART0       (IRQ_DC1176_GIC_START + 18)     /* UART 0 on development chip */
 #define IRQ_DC1176_UART1       (IRQ_DC1176_GIC_START + 19)     /* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC                (IRQ_PB1176_GIC_START + 24)     /* DMA controller */
 #define IRQ_PB1176_RTC         (IRQ_PB1176_GIC_START + 25)     /* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0       -1
 #define IRQ_PB1176_SCTL                -1
 
 #define NR_GIC_PB1176          2
arch/arm/mach-realview/realview_pb1176.c +0 -0
index 1b6e60c..b1d7caf 100644

arch/arm/mach-realview/realview_pb1176.c static struct pl022_ssp_controller ssp0_plat_data = { · line 149

Quoted 8 lines
arch/arm/mach-realview/realview_pb1176.c +1 -1
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ        { IRQ_DC1176_CLCD }
 #define SCTL_IRQ       { }
 #define PB1176_WATCHDOG_IRQ    { IRQ_DC1176_WATCHDOG }
-#define PB1176_GPIO0_IRQ       { IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ       { IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ      { IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ { IRQ_DC1176_RTC }
 #define SCI_IRQ                { IRQ_PB1176_SCI }

I guess we should believe the TRM on this - can you put this in the patch system please?

Thanks.

#43 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 29 lines · Russell King - ARM Linux
Quoted 28 lines · Will Deacon
arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC                (IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC         (IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD                (IRQ_DC1176_GIC_START + 15)     /* CLCD controller */
+#define IRQ_DC1176_GPIO0       (IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP         (IRQ_DC1176_GIC_START + 17)     /* SSP port */
 #define IRQ_DC1176_UART0       (IRQ_DC1176_GIC_START + 18)     /* UART 0 on development chip */
 #define IRQ_DC1176_UART1       (IRQ_DC1176_GIC_START + 19)     /* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC                (IRQ_PB1176_GIC_START + 24)     /* DMA controller */
 #define IRQ_PB1176_RTC         (IRQ_PB1176_GIC_START + 25)     /* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0       -1
 #define IRQ_PB1176_SCTL                -1
 
 #define NR_GIC_PB1176          2
arch/arm/mach-realview/realview_pb1176.c +0 -0
index 1b6e60c..b1d7caf 100644
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ        { IRQ_DC1176_CLCD }
 #define SCTL_IRQ       { }
 #define PB1176_WATCHDOG_IRQ    { IRQ_DC1176_WATCHDOG }
Quoted 8 lines

arch/arm/mach-realview/realview_pb1176.c static struct pl022_ssp_controller ssp0_plat_data = { · line 149

Quoted 5 lines
arch/arm/mach-realview/realview_pb1176.c +1 -1
-#define PB1176_GPIO0_IRQ       { IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ       { IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ      { IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ { IRQ_DC1176_RTC }
 #define SCI_IRQ                { IRQ_PB1176_SCI }

I guess we should believe the TRM on this - can you put this in the patch system please?

Sure. Which branch shall I take it against (before or after your amba changes)?

Will

#44 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 2 lines · Will Deacon

Sure. Which branch shall I take it against (before or after your amba changes)?

If it's before them, we can think about putting it in as a fix during this -rc independently of the rest of the changes. If it's after, then it'll probably add a conflict.

So, it'll be much easier to have it before, and I'll update what's necessary in the amba branch.

#45 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 10 lines · Russell King - ARM Linux
Quoted 2 lines · Will Deacon

Sure. Which branch shall I take it against (before or after your amba changes)?

If it's before them, we can think about putting it in as a fix during this -rc independently of the rest of the changes. If it's after, then it'll probably add a conflict.

So, it'll be much easier to have it before, and I'll update what's necessary in the amba branch.

Okey doke, I've submitted it as 7300/1 against 3.3-rc1.

Will

#46 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 5 lines · Will Deacon
Quoted 4 lines · Russell King - ARM Linux
Quoted 2 lines · Will Deacon

Sure. Which branch shall I take it against (before or after your amba changes)?

Quoted 8 lines
Quoted 6 lines

If it's before them, we can think about putting it in as a fix during this -rc independently of the rest of the changes. If it's after, then it'll probably add a conflict.

So, it'll be much easier to have it before, and I'll update what's necessary in the amba branch.

Okey doke, I've submitted it as 7300/1 against 3.3-rc1.

Right, so with the stack of amba patches on top, it looks like this, which to me looks sane. I haven't build-tested it though.

arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC		(IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC		(IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD		(IRQ_DC1176_GIC_START + 15)	/* CLCD controller */
+#define IRQ_DC1176_GPIO0	(IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP		(IRQ_DC1176_GIC_START + 17)	/* SSP port */
 #define IRQ_DC1176_UART0	(IRQ_DC1176_GIC_START + 18)	/* UART 0 on development chip */
 #define IRQ_DC1176_UART1	(IRQ_DC1176_GIC_START + 19)	/* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC		(IRQ_PB1176_GIC_START + 24)	/* DMA controller */
 #define IRQ_PB1176_RTC		(IRQ_PB1176_GIC_START + 25)	/* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0	-1
 #define IRQ_PB1176_SCTL		-1
 
 #define NR_GIC_PB1176		2
arch/arm/mach-realview/realview_pb1176.c +1 -1
index 1b6e60c..b1d7caf 100644
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ	{ IRQ_DC1176_CLCD }
 #define SCTL_IRQ	{ }
 #define PB1176_WATCHDOG_IRQ	{ IRQ_DC1176_WATCHDOG }
-#define PB1176_GPIO0_IRQ	{ IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ	{ IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ	{ IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ	{ IRQ_DC1176_RTC }
 #define SCI_IRQ		{ IRQ_PB1176_SCI }
#47 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 2 lines · Russell King - ARM Linux

Right, so with the stack of amba patches on top, it looks like this, which to me looks sane. I haven't build-tested it though.

Will,

Did you see this? Any comment?

Thanks.

Quoted 40 lines
arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC		(IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC		(IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD		(IRQ_DC1176_GIC_START + 15)	/* CLCD controller */
+#define IRQ_DC1176_GPIO0	(IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP		(IRQ_DC1176_GIC_START + 17)	/* SSP port */
 #define IRQ_DC1176_UART0	(IRQ_DC1176_GIC_START + 18)	/* UART 0 on development chip */
 #define IRQ_DC1176_UART1	(IRQ_DC1176_GIC_START + 19)	/* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC		(IRQ_PB1176_GIC_START + 24)	/* DMA controller */
 #define IRQ_PB1176_RTC		(IRQ_PB1176_GIC_START + 25)	/* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0	-1
 #define IRQ_PB1176_SCTL		-1
 
 #define NR_GIC_PB1176		2
arch/arm/mach-realview/realview_pb1176.c +1 -1
index 1b6e60c..b1d7caf 100644
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ	{ IRQ_DC1176_CLCD }
 #define SCTL_IRQ	{ }
 #define PB1176_WATCHDOG_IRQ	{ IRQ_DC1176_WATCHDOG }
-#define PB1176_GPIO0_IRQ	{ IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ	{ IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ	{ IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ	{ IRQ_DC1176_RTC }
 #define SCI_IRQ		{ IRQ_PB1176_SCI }

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#48 lore raw

PATCH 21/31 ARM: amba: realview: get rid of private platform amba_device initializer

Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Russell King - ARM Linux

Right, so with the stack of amba patches on top, it looks like this, which to me looks sane. I haven't build-tested it though.

Will,

Hi Russell,

Quoted 1 line

Did you see this? Any comment?

Sorry, this somehow got buried in other mail.

Quoted 20 lines
Quoted 20 lines
arch/arm/mach-realview/include/mach/irqs-pb1176.h +1 -1
index 5c3c625..708f841 100644
@@ -40,6 +40,7 @@
 #define IRQ_DC1176_L2CC		(IRQ_DC1176_GIC_START + 13)
 #define IRQ_DC1176_RTC		(IRQ_DC1176_GIC_START + 14)
 #define IRQ_DC1176_CLCD		(IRQ_DC1176_GIC_START + 15)	/* CLCD controller */
+#define IRQ_DC1176_GPIO0	(IRQ_DC1176_GIC_START + 16)
 #define IRQ_DC1176_SSP		(IRQ_DC1176_GIC_START + 17)	/* SSP port */
 #define IRQ_DC1176_UART0	(IRQ_DC1176_GIC_START + 18)	/* UART 0 on development chip */
 #define IRQ_DC1176_UART1	(IRQ_DC1176_GIC_START + 19)	/* UART 1 on development chip */
@@ -73,7 +74,6 @@
 #define IRQ_PB1176_DMAC		(IRQ_PB1176_GIC_START + 24)	/* DMA controller */
 #define IRQ_PB1176_RTC		(IRQ_PB1176_GIC_START + 25)	/* Real Time Clock */
 
-#define IRQ_PB1176_GPIO0	-1
 #define IRQ_PB1176_SCTL		-1
 
Quoted 14 lines
Quoted 6 lines
arch/arm/mach-realview/include/mach/irqs-pb1176.h +0 -0
 #define NR_GIC_PB1176		2
arch/arm/mach-realview/realview_pb1176.c +0 -0
index 1b6e60c..b1d7caf 100644

arch/arm/mach-realview/realview_pb1176.c static struct pl022_ssp_controller ssp0_plat_data = { · line 149

Quoted 8 lines
arch/arm/mach-realview/realview_pb1176.c +1 -1
@@ -143,7 +143,7 @@ static struct pl022_ssp_controller ssp0_plat_data = {
 #define PB1176_CLCD_IRQ	{ IRQ_DC1176_CLCD }
 #define SCTL_IRQ	{ }
 #define PB1176_WATCHDOG_IRQ	{ IRQ_DC1176_WATCHDOG }
-#define PB1176_GPIO0_IRQ	{ IRQ_PB1176_GPIO0 }
+#define PB1176_GPIO0_IRQ	{ IRQ_DC1176_GPIO0 }
 #define GPIO1_IRQ	{ IRQ_PB1176_GPIO1 }
 #define PB1176_RTC_IRQ	{ IRQ_DC1176_RTC }
 #define SCI_IRQ		{ IRQ_PB1176_SCI }

This looks fine to me. It matches what I posted originally, which was the intention.

Will

#50 lore raw

PATCH 22/31 ARM: amba: integrator: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-integrator/core.c          |   70 ++++++------------------------
 arch/arm/mach-integrator/integrator_cp.c |   49 ++++-----------------
 2 files changed, 22 insertions(+), 97 deletions(-)
arch/arm/mach-integrator/core.c +13 -57
index 29baef9..15b87f2 100644
@@ -35,67 +35,23 @@
 
 static struct amba_pl010_data integrator_uart_data;
 
-static struct amba_device rtc_device = {
-	.dev		= {
-		.init_name = "mb:15",
-	},
-	.res		= {
-		.start	= INTEGRATOR_RTC_BASE,
-		.end	= INTEGRATOR_RTC_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_RTCINT },
-};
+#define INTEGRATOR_RTC_IRQ	{ IRQ_RTCINT }
+#define INTEGRATOR_UART0_IRQ	{ IRQ_UARTINT0 }
+#define INTEGRATOR_UART1_IRQ	{ IRQ_UARTINT1 }
+#define KMI0_IRQ		{ IRQ_KMIINT0 }
+#define KMI1_IRQ		{ IRQ_KMIINT1 }
 
-static struct amba_device uart0_device = {
-	.dev		= {
-		.init_name = "mb:16",
-		.platform_data = &integrator_uart_data,
-	},
-	.res		= {
-		.start	= INTEGRATOR_UART0_BASE,
-		.end	= INTEGRATOR_UART0_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_UARTINT0 },
-};
+static AMBA_APB_DEVICE(rtc, "mb:15", 0,
+	INTEGRATOR_RTC_BASE, INTEGRATOR_RTC_IRQ, NULL);
 
-static struct amba_device uart1_device = {
-	.dev		= {
-		.init_name = "mb:17",
-		.platform_data = &integrator_uart_data,
-	},
-	.res		= {
-		.start	= INTEGRATOR_UART1_BASE,
-		.end	= INTEGRATOR_UART1_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_UARTINT1 },
-};
+static AMBA_APB_DEVICE(uart0, "mb:16", 0,
+	INTEGRATOR_UART0_BASE, INTEGRATOR_UART0_IRQ, &integrator_uart_data);
 
-static struct amba_device kmi0_device = {
-	.dev		= {
-		.init_name = "mb:18",
-	},
-	.res		= {
-		.start	= KMI0_BASE,
-		.end	= KMI0_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_KMIINT0 },
-};
+static AMBA_APB_DEVICE(uart1, "mb:17", 0,
+	INTEGRATOR_UART1_BASE, INTEGRATOR_UART1_IRQ, &integrator_uart_data);
 
-static struct amba_device kmi1_device = {
-	.dev		= {
-		.init_name = "mb:19",
-	},
-	.res		= {
-		.start	= KMI1_BASE,
-		.end	= KMI1_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_KMIINT1 },
-};
+static AMBA_APB_DEVICE(kmi0, "mb:18", 0, KMI0_BASE, KMI0_IRQ, NULL);
+static AMBA_APB_DEVICE(kmi1, "mb:19", 0, KMI1_BASE, KMI1_IRQ, NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&rtc_device,
arch/arm/mach-integrator/integrator_cp.c +9 -40

62 lines not on this page · raw message

Signature · 1 line
1.7.4.4
#51 lore raw

PATCH 22/31 ARM: amba: integrator: use common amba device initializers

Quoted 5 lines · Russell King - ARM Linux
---
 arch/arm/mach-integrator/core.c          |   70 ++++++------------------------
 arch/arm/mach-integrator/integrator_cp.c |   49 ++++-----------------
 2 files changed, 22 insertions(+), 97 deletions(-)

Seems happy enough on my Integrator-CP w/ 1136 core tile.

Will

#52 lore raw

PATCH 23/31 ARM: amba: omap2: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-omap2/emu.c |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)
arch/arm/mach-omap2/emu.c +2 -24
index 9c442e2..ce91aad 100644
@@ -30,29 +30,8 @@ MODULE_AUTHOR("Alexander Shishkin");
 #define ETB_BASE	(L4_EMU_34XX_PHYS + 0x1b000)
 #define DAPCTL		(L4_EMU_34XX_PHYS + 0x1d000)
 
-static struct amba_device omap3_etb_device = {
-	.dev		= {
-		.init_name = "etb",
-	},
-	.res		= {
-		.start	= ETB_BASE,
-		.end	= ETB_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.periphid	= 0x000bb907,
-};
-
-static struct amba_device omap3_etm_device = {
-	.dev		= {
-		.init_name = "etm",
-	},
-	.res		= {
-		.start	= ETM_BASE,
-		.end	= ETM_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.periphid	= 0x102bb921,
-};
+static AMBA_APB_DEVICE(omap3_etb, "etb", 0x000bb907, ETB_BASE, { }, NULL);
+static AMBA_APB_DEVICE(omap3_etm, "etm", 0x102bb921, ETM_BASE, { }, NULL);
 
 static int __init emu_init(void)
 {
@@ -66,4 +45,3 @@ static int __init emu_init(void)
 }
 
 subsys_initcall(emu_init);
-
Signature · 1 line
1.7.4.4
maintainer
#53 lore raw

PATCH 23/31 ARM: amba: omap2: use common amba device initializers

Quoted 1 line · Russell King - ARM Linux
Quoted 52 lines
---
 arch/arm/mach-omap2/emu.c |   26 ++------------------------
 1 files changed, 2 insertions(+), 24 deletions(-)
arch/arm/mach-omap2/emu.c +2 -24
index 9c442e2..ce91aad 100644
@@ -30,29 +30,8 @@ MODULE_AUTHOR("Alexander Shishkin");
 #define ETB_BASE	(L4_EMU_34XX_PHYS + 0x1b000)
 #define DAPCTL		(L4_EMU_34XX_PHYS + 0x1d000)
 
-static struct amba_device omap3_etb_device = {
-	.dev		= {
-		.init_name = "etb",
-	},
-	.res		= {
-		.start	= ETB_BASE,
-		.end	= ETB_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.periphid	= 0x000bb907,
-};
-
-static struct amba_device omap3_etm_device = {
-	.dev		= {
-		.init_name = "etm",
-	},
-	.res		= {
-		.start	= ETM_BASE,
-		.end	= ETM_BASE + SZ_4K - 1,
-		.flags	= IORESOURCE_MEM,
-	},
-	.periphid	= 0x102bb921,
-};
+static AMBA_APB_DEVICE(omap3_etb, "etb", 0x000bb907, ETB_BASE, { }, NULL);
+static AMBA_APB_DEVICE(omap3_etm, "etm", 0x102bb921, ETM_BASE, { }, NULL);
 
 static int __init emu_init(void)
 {
@@ -66,4 +45,3 @@ static int __init emu_init(void)
 }
 
 subsys_initcall(emu_init);
-
Signature · 6 lines
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#54 lore raw

PATCH 24/31 ARM: amba: ep93xx: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-ep93xx/core.c |   46 +++++-------------------------------------
 1 files changed, 6 insertions(+), 40 deletions(-)
arch/arm/mach-ep93xx/core.c +6 -40
index 1a8397a..903edb0 100644
@@ -279,48 +279,14 @@ static struct amba_pl010_data ep93xx_uart_data = {
 	.set_mctrl	= ep93xx_uart_set_mctrl,
 };
 
-static struct amba_device uart1_device = {
-	.dev		= {
-		.init_name	= "apb:uart1",
-		.platform_data	= &ep93xx_uart_data,
-	},
-	.res		= {
-		.start	= EP93XX_UART1_PHYS_BASE,
-		.end	= EP93XX_UART1_PHYS_BASE + 0x0fff,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_EP93XX_UART1 },
-	.periphid	= 0x00041010,
-};
-
-static struct amba_device uart2_device = {
-	.dev		= {
-		.init_name	= "apb:uart2",
-		.platform_data	= &ep93xx_uart_data,
-	},
-	.res		= {
-		.start	= EP93XX_UART2_PHYS_BASE,
-		.end	= EP93XX_UART2_PHYS_BASE + 0x0fff,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_EP93XX_UART2 },
-	.periphid	= 0x00041010,
-};
+static AMBA_APB_DEVICE(uart1, "apb:uart1", 0x00041010, EP93XX_UART1_PHYS_BASE,
+	{ IRQ_EP93XX_UART1 }, &ep93xx_uart_data);
 
-static struct amba_device uart3_device = {
-	.dev		= {
-		.init_name	= "apb:uart3",
-		.platform_data	= &ep93xx_uart_data,
-	},
-	.res		= {
-		.start	= EP93XX_UART3_PHYS_BASE,
-		.end	= EP93XX_UART3_PHYS_BASE + 0x0fff,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { IRQ_EP93XX_UART3 },
-	.periphid	= 0x00041010,
-};
+static AMBA_APB_DEVICE(uart2, "apb:uart2", 0x00041010, EP93XX_UART2_PHYS_BASE,
+	{ IRQ_EP93XX_UART2 }, &ep93xx_uart_data);
 
+static AMBA_APB_DEVICE(uart3, "apb:uart3", 0x00041010, EP93XX_UART3_PHYS_BASE,
+	{ IRQ_EP93XX_UART3 }, &ep93xx_uart_data);
 
 static struct resource ep93xx_rtc_resource[] = {
 	{
Signature · 1 line
1.7.4.4
#56 lore raw

PATCH 25/31 ARM: amba: bcmring: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-bcmring/core.c |   23 ++---------------------
 1 files changed, 2 insertions(+), 21 deletions(-)
arch/arm/mach-bcmring/core.c +2 -21
index 6b67b7e..22e4e0a 100644
@@ -52,27 +52,8 @@
 #include <mach/csp/chipcHw_inline.h>
 #include <mach/csp/tmrHw_reg.h>
 
-#define AMBA_DEVICE(name, initname, base, plat, size)       \
-static struct amba_device name##_device = {     \
-   .dev = {                                     \
-      .coherent_dma_mask = ~0,                  \
-      .init_name = initname,                    \
-      .platform_data = plat                     \
-   },                                           \
-   .res = {                                     \
-      .start = MM_ADDR_IO_##base,               \
-		.end = MM_ADDR_IO_##base + (size) - 1,    \
-      .flags = IORESOURCE_MEM                   \
-   },                                           \
-   .dma_mask = ~0,                              \
-   .irq = {                                     \
-      IRQ_##base                                \
-   }                                            \
-}
-
-
-AMBA_DEVICE(uartA, "uarta", UARTA, NULL, SZ_4K);
-AMBA_DEVICE(uartB, "uartb", UARTB, NULL, SZ_4K);
+static AMBA_APB_DEVICE(uartA, "uarta", MM_ADDR_IO_UARTA, { IRQ_UARTA }, NULL);
+static AMBA_APB_DEVICE(uartB, "uartb", MM_ADDR_IO_UARTB, { IRQ_UARTB }, NULL);
 
 static struct clk pll1_clk = {
 	.name = "PLL1",
Signature · 1 line
1.7.4.4
#57 lore raw

PATCH 26/31 ARM: amba: netx: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-netx/fb.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
arch/arm/mach-netx/fb.c +1 -12
index eda856c..2cdf6ef 100644
@@ -92,18 +92,7 @@ void clk_put(struct clk *clk)
 {
 }
 
-static struct amba_device fb_device = {
-	.dev		= {
-		.init_name = "fb",
-		.coherent_dma_mask = ~0,
-	},
-	.res		= {
-		.start	= 0x00104000,
-		.end	= 0x00104fff,
-		.flags	= IORESOURCE_MEM,
-	},
-	.irq		= { NETX_IRQ_LCD },
-};
+static AMBA_AHB_DEVICE(fb, "fb", 0, 0x00104000, { NETX_IRQ_LCD }, NULL);
 
 int netx_fb_init(struct clcd_board *board, struct clcd_panel *panel)
 {
Signature · 1 line
1.7.4.4
#58 lore raw

PATCH 27/31 ARM: amba: lpc32xx: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-lpc32xx/phy3250.c |   32 ++++----------------------------
 1 files changed, 4 insertions(+), 28 deletions(-)
arch/arm/mach-lpc32xx/phy3250.c +4 -28
index 025eb21..5d51c10 100644
@@ -149,20 +149,8 @@ static struct clcd_board lpc32xx_clcd_data = {
 	.remove		= lpc32xx_clcd_remove,
 };
 
-static struct amba_device lpc32xx_clcd_device = {
-	.dev				= {
-		.coherent_dma_mask	= ~0,
-		.init_name		= "dev:clcd",
-		.platform_data		= &lpc32xx_clcd_data,
-	},
-	.res				= {
-		.start			= LPC32XX_LCD_BASE,
-		.end			= (LPC32XX_LCD_BASE + SZ_4K - 1),
-		.flags			= IORESOURCE_MEM,
-	},
-	.dma_mask			= ~0,
-	.irq				= {IRQ_LPC32XX_LCD},
-};
+static AMBA_AHB_DEVICE(lpc32xx_clcd, "dev:clcd", 0,
+	LPC32XX_LCD_BASE, { IRQ_LPC32XX_LCD }, &lpc32xx_clcd_data);
 
 /*
  * AMBA SSP (SPI)
@@ -191,20 +179,8 @@ static struct pl022_ssp_controller lpc32xx_ssp0_data = {
 	.enable_dma		= 0,
 };
 
-static struct amba_device lpc32xx_ssp0_device = {
-	.dev				= {
-		.coherent_dma_mask	= ~0,
-		.init_name		= "dev:ssp0",
-		.platform_data		= &lpc32xx_ssp0_data,
-	},
-	.res				= {
-		.start			= LPC32XX_SSP0_BASE,
-		.end			= (LPC32XX_SSP0_BASE + SZ_4K - 1),
-		.flags			= IORESOURCE_MEM,
-	},
-	.dma_mask			= ~0,
-	.irq				= {IRQ_LPC32XX_SSP0},
-};
+static AMBA_APB_DEVICE(lpc32xx_ssp0, "dev:ssp0", 0,
+	LPC32XX_SSP0_BASE, { IRQ_LPC32XX_SSP0 }, &lpc32xx_ssp0_data);
 
 /* AT25 driver registration */
 static int __init phy3250_spi_board_register(void)
Signature · 1 line
1.7.4.4
#59 lore raw

PATCH 28/31 ARM: amba: u300: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-u300/core.c |   85 ++++++++------------------------------------
 1 files changed, 16 insertions(+), 69 deletions(-)
arch/arm/mach-u300/core.c +16 -69
index ed92967..b986560 100644
@@ -94,19 +94,9 @@ static struct amba_pl011_data uart0_plat_data = {
 #endif
 };
 
-static struct amba_device uart0_device = {
-	.dev = {
-		.coherent_dma_mask = ~0,
-		.init_name = "uart0", /* Slow device at 0x3000 offset */
-		.platform_data = &uart0_plat_data,
-	},
-	.res = {
-		.start = U300_UART0_BASE,
-		.end   = U300_UART0_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = { IRQ_U300_UART0 },
-};
+/* Slow device at 0x3000 offset */
+static AMBA_APB_DEVICE(uart0, "uart0", 0, U300_UART0_BASE,
+	{ IRQ_U300_UART0 }, &uart0_plat_data);
 
 /* The U335 have an additional UART1 on the APP CPU */
 #ifdef CONFIG_MACH_U300_BS335
@@ -118,71 +108,28 @@ static struct amba_pl011_data uart1_plat_data = {
 #endif
 };
 
-static struct amba_device uart1_device = {
-	.dev = {
-		.coherent_dma_mask = ~0,
-		.init_name = "uart1", /* Fast device at 0x7000 offset */
-		.platform_data = &uart1_plat_data,
-	},
-	.res = {
-		.start = U300_UART1_BASE,
-		.end   = U300_UART1_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = { IRQ_U300_UART1 },
-};
+/* Fast device at 0x7000 offset */
+static AMBA_APB_DEVICE(uart1, "uart1", 0, U300_UART1_BASE,
+	{ IRQ_U300_UART1 }, &uart1_plat_data);
 #endif
 
-static struct amba_device pl172_device = {
-	.dev = {
-		.init_name = "pl172", /* AHB device at 0x4000 offset */
-		.platform_data = NULL,
-	},
-	.res = {
-		.start = U300_EMIF_CFG_BASE,
-		.end   = U300_EMIF_CFG_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-};
+/* AHB device at 0x4000 offset */
+static AMBA_APB_DEVICE(pl172, "pl172", 0, U300_EMIF_CFG_BASE, { }, NULL);
 
 
 /*
  * Everything within this next ifdef deals with external devices connected to
  * the APP SPI bus.
  */
-static struct amba_device pl022_device = {
-	.dev = {
-		.coherent_dma_mask = ~0,
-		.init_name = "pl022", /* Fast device at 0x6000 offset */
-	},
-	.res = {
-		.start = U300_SPI_BASE,
-		.end   = U300_SPI_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_U300_SPI },
-	/*
-	 * This device has a DMA channel but the Linux driver does not use
-	 * it currently.
-	 */
-};
+/* Fast device at 0x6000 offset */
+static AMBA_APB_DEVICE(pl022, "pl022", 0, U300_SPI_BASE,
+	{ IRQ_U300_SPI }, NULL);
 
-static struct amba_device mmcsd_device = {
-	.dev = {
-		.init_name = "mmci", /* Fast device at 0x1000 offset */
-		.platform_data = NULL, /* Added later */
-	},
-	.res = {
-		.start = U300_MMCSD_BASE,
-		.end   = U300_MMCSD_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 },
-	/*
-	 * This device has a DMA channel but the Linux driver does not use
-	 * it currently.
-	 */
-};
+/* Fast device at 0x1000 offset */
+#define U300_MMCSD_IRQS	{ IRQ_U300_MMCSD_MCIINTR0, IRQ_U300_MMCSD_MCIINTR1 }
+
+static AMBA_APB_DEVICE(mmcsd, "mmci", 0, U300_MMCSD_BASE,
+	U300_MMCSD_IRQS, NULL);
 
 /*
  * The order of device declaration may be important, since some devices
Signature · 1 line
1.7.4.4
#61 lore raw

PATCH 29/31 ARM: amba: nomadik: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-nomadik/board-nhk8815.c |   17 ++++-------------
 arch/arm/mach-nomadik/cpu-8815.c      |    9 ++-------
 2 files changed, 6 insertions(+), 20 deletions(-)
arch/arm/mach-nomadik/board-nhk8815.c +4 -13
index 721e51c..f6f74ad 100644
@@ -185,20 +185,11 @@ static void __init nhk8815_onenand_init(void)
 #endif
 }
 
-#define __MEM_4K_RESOURCE(x) \
-	.res = {.start = (x), .end = (x) + SZ_4K - 1, .flags = IORESOURCE_MEM}
+static AMBA_APB_DEVICE(uart0, "uart0", 0, NOMADIK_UART0_BASE,
+	{ IRQ_UART0 }, NULL);
 
-static struct amba_device uart0_device = {
-	.dev = { .init_name = "uart0" },
-	__MEM_4K_RESOURCE(NOMADIK_UART0_BASE),
-	.irq = {IRQ_UART0},
-};
-
-static struct amba_device uart1_device = {
-	.dev = { .init_name = "uart1" },
-	__MEM_4K_RESOURCE(NOMADIK_UART1_BASE),
-	.irq = {IRQ_UART1},
-};
+static AMBA_APB_DEVICE(uart1, "uart1", 0, NOMADIK_UART1_BASE,
+	{ IRQ_UART1 }, NULL);
 
 static struct amba_device *amba_devs[] __initdata = {
 	&uart0_device,
arch/arm/mach-nomadik/cpu-8815.c +2 -7
index 65df7b4..27f43a4 100644
@@ -97,12 +97,7 @@ static struct platform_device cpu8815_platform_gpio[] = {
 	GPIO_DEVICE(3),
 };
 
-static struct amba_device cpu8815_amba_rng = {
-	.dev = {
-		.init_name = "rng",
-	},
-	__MEM_4K_RESOURCE(NOMADIK_RNG_BASE),
-};
+static AMBA_APB_DEVICE(cpu8815_amba_rng, "rng", 0, NOMADIK_RNG_BASE, { }, NULL);
 
 static struct platform_device *platform_devs[] __initdata = {
 	cpu8815_platform_gpio + 0,
@@ -112,7 +107,7 @@ static struct platform_device *platform_devs[] __initdata = {
 };
 
 static struct amba_device *amba_devs[] __initdata = {
-	&cpu8815_amba_rng
+	&cpu8815_amba_rng_device
 };
 
 static int __init cpu8815_init(void)
Signature · 1 line
1.7.4.4
#62 lore raw

PATCH 29/31 ARM: amba: nomadik: use common amba device initializers

arch/arm/mach-nomadik/board-nhk8815.c static void __init nhk8815_onenand_init(void) · line 189

Quoted 2 lines
arch/arm/mach-nomadik/board-nhk8815.c +2 -0
+static AMBA_APB_DEVICE(uart0, "uart0", 0, NOMADIK_UART0_BASE,
+	{ IRQ_UART0 }, NULL);

thanks
/alessandro

#63 lore raw

PATCH 29/31 ARM: amba: nomadik: use common amba device initializers

In reply to Russell King - ARM Linux
Quoted 5 lines · Russell King - ARM Linux

---
?arch/arm/mach-nomadik/board-nhk8815.c | ? 17 ++++------------- ?arch/arm/mach-nomadik/cpu-8815.c ? ? ?| ? ?9 ++------- ?2 files changed, 6 insertions(+), 20 deletions(-)

  1 files changed, 2 insertions(+), 2 deletions(-)

Thanks Russell,
Linus Walleij

#64 lore raw

PATCH 30/31 ARM: amba: spear: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-spear3xx/spear300.c |   14 ++------------
 arch/arm/mach-spear3xx/spear3xx.c |   27 ++++-----------------------
 2 files changed, 6 insertions(+), 35 deletions(-)
arch/arm/mach-spear3xx/spear300.c +2 -12
index 6fdeec9..9da50e281 100644
@@ -430,18 +430,8 @@ static struct pl061_platform_data gpio1_plat_data = {
 	.irq_base	= SPEAR300_GPIO1_INT_BASE,
 };
 
-struct amba_device spear300_gpio1_device = {
-	.dev = {
-		.init_name = "gpio1",
-		.platform_data = &gpio1_plat_data,
-	},
-	.res = {
-		.start = SPEAR300_GPIO_BASE,
-		.end = SPEAR300_GPIO_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR300_VIRQ_GPIO1},
-};
+AMBA_APB_DEVICE(spear300_gpio1, "gpio1", 0, SPEAR300_GPIO_BASE,
+	{SPEAR300_VIRQ_GPIO1}, &gpio1_plat_data);
 
 /* spear300 routines */
 void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
arch/arm/mach-spear3xx/spear3xx.c +4 -23
index bc4f1c6..b1733c3 100644
@@ -28,31 +28,12 @@ static struct pl061_platform_data gpio_plat_data = {
 	.irq_base	= SPEAR3XX_GPIO_INT_BASE,
 };
 
-struct amba_device spear3xx_gpio_device = {
-	.dev = {
-		.init_name = "gpio",
-		.platform_data = &gpio_plat_data,
-	},
-	.res = {
-		.start = SPEAR3XX_ICM3_GPIO_BASE,
-		.end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR3XX_IRQ_BASIC_GPIO},
-};
+AMBA_APB_DEVICE(spear3xx_gpio, "gpio", 0, SPEAR3XX_ICM3_GPIO_BASE,
+	{SPEAR3XX_IRQ_BASIC_GPIO}, &gpio_plat_data);
 
 /* uart device registration */
-struct amba_device spear3xx_uart_device = {
-	.dev = {
-		.init_name = "uart",
-	},
-	.res = {
-		.start = SPEAR3XX_ICM1_UART_BASE,
-		.end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR3XX_IRQ_UART},
-};
+AMBA_APB_DEVICE(spear3xx_uart, "uart", 0, SPEAR3XX_ICM1_UART_BASE,
+	{SPEAR3XX_IRQ_UART}, NULL);
 
 /* Do spear3xx familiy common initialization part here */
 void __init spear3xx_init(void)
Signature · 1 line
1.7.4.4
#65 lore raw

PATCH 30/31 ARM: amba: spear: use common amba device initializers

Quoted 61 lines · Russell King - ARM Linux
---
 arch/arm/mach-spear3xx/spear300.c |   14 ++------------
 arch/arm/mach-spear3xx/spear3xx.c |   27 ++++-----------------------
 2 files changed, 6 insertions(+), 35 deletions(-)
arch/arm/mach-spear3xx/spear300.c +2 -12
index 6fdeec9..9da50e281 100644
@@ -430,18 +430,8 @@ static struct pl061_platform_data gpio1_plat_data = {
 	.irq_base	= SPEAR300_GPIO1_INT_BASE,
 };
 
-struct amba_device spear300_gpio1_device = {
-	.dev = {
-		.init_name = "gpio1",
-		.platform_data = &gpio1_plat_data,
-	},
-	.res = {
-		.start = SPEAR300_GPIO_BASE,
-		.end = SPEAR300_GPIO_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR300_VIRQ_GPIO1},
-};
+AMBA_APB_DEVICE(spear300_gpio1, "gpio1", 0, SPEAR300_GPIO_BASE,
+	{SPEAR300_VIRQ_GPIO1}, &gpio1_plat_data);
 
 /* spear300 routines */
 void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
arch/arm/mach-spear3xx/spear3xx.c +2 -18
index bc4f1c6..b1733c3 100644
@@ -28,31 +28,12 @@ static struct pl061_platform_data gpio_plat_data = {
 	.irq_base	= SPEAR3XX_GPIO_INT_BASE,
 };
 
-struct amba_device spear3xx_gpio_device = {
-	.dev = {
-		.init_name = "gpio",
-		.platform_data = &gpio_plat_data,
-	},
-	.res = {
-		.start = SPEAR3XX_ICM3_GPIO_BASE,
-		.end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR3XX_IRQ_BASIC_GPIO},
-};
+AMBA_APB_DEVICE(spear3xx_gpio, "gpio", 0, SPEAR3XX_ICM3_GPIO_BASE,
+	{SPEAR3XX_IRQ_BASIC_GPIO}, &gpio_plat_data);
 
 /* uart device registration */
-struct amba_device spear3xx_uart_device = {
-	.dev = {
-		.init_name = "uart",
-	},
-	.res = {
-		.start = SPEAR3XX_ICM1_UART_BASE,

arch/arm/mach-spear3xx/spear3xx.c static struct pl061_platform_data gpio_plat_data = { · line 39

Quoted 10 lines
arch/arm/mach-spear3xx/spear3xx.c +2 -5
-		.end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {SPEAR3XX_IRQ_UART},
-};
+AMBA_APB_DEVICE(spear3xx_uart, "uart", 0, SPEAR3XX_ICM1_UART_BASE,
+	{SPEAR3XX_IRQ_UART}, NULL);
 
 /* Do spear3xx familiy common initialization part here */
 void __init spear3xx_init(void)
Signature · 1 line
viresh
#66 lore raw

PATCH 31/31 ARM: amba: samsung: use common amba device initializers

In reply to Russell King - ARM Linux
---
 arch/arm/mach-exynos/dma.c  |   38 ++++++--------------------------------
 arch/arm/mach-s5p64x0/dma.c |   22 +++++-----------------
 arch/arm/mach-s5pc100/dma.c |   38 ++++++--------------------------------
 arch/arm/mach-s5pv210/dma.c |   38 ++++++--------------------------------
 4 files changed, 23 insertions(+), 113 deletions(-)
arch/arm/mach-exynos/dma.c +6 -32
index 8d681bf..91370de 100644
@@ -74,21 +74,8 @@ struct dma_pl330_platdata exynos4_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device exynos4_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &exynos4_pdma0_pdata,
-	},
-	.res = {
-		.start = EXYNOS4_PA_PDMA0,
-		.end = EXYNOS4_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(exynos4_pdma0, "dma-pl330.0", 0x00041330, EXYNOS4_PA_PDMA0,
+	{IRQ_PDMA0}, &exynos4_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_PCM0_RX,
@@ -123,21 +110,8 @@ struct dma_pl330_platdata exynos4_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device exynos4_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &exynos4_pdma1_pdata,
-	},
-	.res = {
-		.start = EXYNOS4_PA_PDMA1,
-		.end = EXYNOS4_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(exynos4_pdma1,  "dma-pl330.1", 0x00041330, EXYNOS4_PA_PDMA1,
+	{IRQ_PDMA1}, &exynos4_pdma1_pdata);
 
 static int __init exynos4_dma_init(void)
 {
@@ -146,11 +120,11 @@ static int __init exynos4_dma_init(void)
 
 	dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask);
-	amba_device_register(&exynos4_device_pdma0, &iomem_resource);
+	amba_device_register(&exynos4_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask);
-	amba_device_register(&exynos4_device_pdma1, &iomem_resource);
+	amba_device_register(&exynos4_pdma1_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5p64x0/dma.c +5 -17
index 99049aa..f7f68ad 100644
@@ -108,34 +108,22 @@ struct dma_pl330_platdata s5p6450_pdma_pdata = {
 	.peri_id = s5p6450_pdma_peri,
 };
 
-struct amba_device s5p64x0_device_pdma = {
-	.dev = {
-		.init_name = "dma-pl330",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-	},
-	.res = {
-		.start = S5P64X0_PA_PDMA,
-		.end = S5P64X0_PA_PDMA + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_DMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5p64x0_pdma, "dma-pl330", 0x00041330, S5P64X0_PA_PDMA,
+	{IRQ_DMA0}, NULL);
 
 static int __init s5p64x0_dma_init(void)
 {
 	if (soc_is_s5p6450()) {
 		dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask);
 		dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask);
-		s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata;
+		s5p64x0_pdma_device.dev.platform_data = &s5p6450_pdma_pdata;
 	} else {
 		dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask);
 		dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask);
-		s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata;
+		s5p64x0_pdma_device.dev.platform_data = &s5p6440_pdma_pdata;
 	}
 
-	amba_device_register(&s5p64x0_device_pdma, &iomem_resource);
+	amba_device_register(&s5p64x0_pdma_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5pc100/dma.c +6 -32
index ac08d7e..96b1ab3 100644
@@ -73,21 +73,8 @@ struct dma_pl330_platdata s5pc100_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device s5pc100_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_pdma0_pdata,
-	},
-	.res = {
-		.start = S5PC100_PA_PDMA0,
-		.end = S5PC100_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pc100_pdma0,  "dma-pl330.0", 0x00041330, S5PC100_PA_PDMA0,
+	{IRQ_PDMA0}, &s5pc100_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_UART0_RX,
@@ -127,31 +114,18 @@ struct dma_pl330_platdata s5pc100_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device s5pc100_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_pdma1_pdata,
-	},
-	.res = {
-		.start = S5PC100_PA_PDMA1,
-		.end = S5PC100_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pc100_pdma1, "dma-pl330.1", 0x00041330, S5PC100_PA_PDMA1,
+	{IRQ_PDMA1}, &s5pc100_pdma1_pdata);
 
 static int __init s5pc100_dma_init(void)
 {
 	dma_cap_set(DMA_SLAVE, s5pc100_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pc100_pdma0_pdata.cap_mask);
-	amba_device_register(&s5pc100_device_pdma0, &iomem_resource);
+	amba_device_register(&s5pc100_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, s5pc100_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pc100_pdma1_pdata.cap_mask);
-	amba_device_register(&s5pc100_device_pdma1, &iomem_resource);
+	amba_device_register(&s5pc100_pdma1_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5pv210/dma.c +6 -32
index 8602fa5..f6885d2 100644
@@ -71,21 +71,8 @@ struct dma_pl330_platdata s5pv210_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device s5pv210_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_pdma0_pdata,
-	},
-	.res = {
-		.start = S5PV210_PA_PDMA0,
-		.end = S5PV210_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330, S5PV210_PA_PDMA0,
+	{IRQ_PDMA0}, &s5pv210_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_UART0_RX,
@@ -127,31 +114,18 @@ struct dma_pl330_platdata s5pv210_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device s5pv210_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_pdma1_pdata,
-	},
-	.res = {
-		.start = S5PV210_PA_PDMA1,
-		.end = S5PV210_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330, S5PV210_PA_PDMA1,
+	{IRQ_PDMA1}, &s5pv210_pdma1_pdata);
 
 static int __init s5pv210_dma_init(void)
 {
 	dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask);
-	amba_device_register(&s5pv210_device_pdma0, &iomem_resource);
+	amba_device_register(&s5pv210_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask);
-	amba_device_register(&s5pv210_device_pdma1, &iomem_resource);
+	amba_device_register(&s5pv210_pdma1_device, &iomem_resource);
 
 	return 0;
 }
Signature · 1 line
1.7.4.4
#67 lore raw

PATCH 31/31 ARM: amba: samsung: use common amba device initializers

Quoted 2 lines · Russell King

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 247 lines
---
 arch/arm/mach-exynos/dma.c  |   38 ++++++--------------------------------
 arch/arm/mach-s5p64x0/dma.c |   22 +++++-----------------
 arch/arm/mach-s5pc100/dma.c |   38 ++++++--------------------------------
 arch/arm/mach-s5pv210/dma.c |   38 ++++++--------------------------------
 4 files changed, 23 insertions(+), 113 deletions(-)
arch/arm/mach-exynos/dma.c +6 -32
index 8d681bf..91370de 100644
@@ -74,21 +74,8 @@ struct dma_pl330_platdata exynos4_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device exynos4_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &exynos4_pdma0_pdata,
-	},
-	.res = {
-		.start = EXYNOS4_PA_PDMA0,
-		.end = EXYNOS4_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(exynos4_pdma0, "dma-pl330.0", 0x00041330, EXYNOS4_PA_PDMA0,
+	{IRQ_PDMA0}, &exynos4_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_PCM0_RX,
@@ -123,21 +110,8 @@ struct dma_pl330_platdata exynos4_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device exynos4_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &exynos4_pdma1_pdata,
-	},
-	.res = {
-		.start = EXYNOS4_PA_PDMA1,
-		.end = EXYNOS4_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(exynos4_pdma1,  "dma-pl330.1", 0x00041330, EXYNOS4_PA_PDMA1,
+	{IRQ_PDMA1}, &exynos4_pdma1_pdata);
 
 static int __init exynos4_dma_init(void)
 {
@@ -146,11 +120,11 @@ static int __init exynos4_dma_init(void)
 
 	dma_cap_set(DMA_SLAVE, exynos4_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, exynos4_pdma0_pdata.cap_mask);
-	amba_device_register(&exynos4_device_pdma0, &iomem_resource);
+	amba_device_register(&exynos4_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, exynos4_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, exynos4_pdma1_pdata.cap_mask);
-	amba_device_register(&exynos4_device_pdma1, &iomem_resource);
+	amba_device_register(&exynos4_pdma1_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5p64x0/dma.c +5 -17
index 99049aa..f7f68ad 100644
@@ -108,34 +108,22 @@ struct dma_pl330_platdata s5p6450_pdma_pdata = {
 	.peri_id = s5p6450_pdma_peri,
 };
 
-struct amba_device s5p64x0_device_pdma = {
-	.dev = {
-		.init_name = "dma-pl330",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-	},
-	.res = {
-		.start = S5P64X0_PA_PDMA,
-		.end = S5P64X0_PA_PDMA + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_DMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5p64x0_pdma, "dma-pl330", 0x00041330, S5P64X0_PA_PDMA,
+	{IRQ_DMA0}, NULL);
 
 static int __init s5p64x0_dma_init(void)
 {
 	if (soc_is_s5p6450()) {
 		dma_cap_set(DMA_SLAVE, s5p6450_pdma_pdata.cap_mask);
 		dma_cap_set(DMA_CYCLIC, s5p6450_pdma_pdata.cap_mask);
-		s5p64x0_device_pdma.dev.platform_data = &s5p6450_pdma_pdata;
+		s5p64x0_pdma_device.dev.platform_data = &s5p6450_pdma_pdata;
 	} else {
 		dma_cap_set(DMA_SLAVE, s5p6440_pdma_pdata.cap_mask);
 		dma_cap_set(DMA_CYCLIC, s5p6440_pdma_pdata.cap_mask);
-		s5p64x0_device_pdma.dev.platform_data = &s5p6440_pdma_pdata;
+		s5p64x0_pdma_device.dev.platform_data = &s5p6440_pdma_pdata;
 	}
 
-	amba_device_register(&s5p64x0_device_pdma, &iomem_resource);
+	amba_device_register(&s5p64x0_pdma_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5pc100/dma.c +6 -32
index ac08d7e..96b1ab3 100644
@@ -73,21 +73,8 @@ struct dma_pl330_platdata s5pc100_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device s5pc100_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_pdma0_pdata,
-	},
-	.res = {
-		.start = S5PC100_PA_PDMA0,
-		.end = S5PC100_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pc100_pdma0,  "dma-pl330.0", 0x00041330, S5PC100_PA_PDMA0,
+	{IRQ_PDMA0}, &s5pc100_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_UART0_RX,
@@ -127,31 +114,18 @@ struct dma_pl330_platdata s5pc100_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device s5pc100_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pc100_pdma1_pdata,
-	},
-	.res = {
-		.start = S5PC100_PA_PDMA1,
-		.end = S5PC100_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pc100_pdma1, "dma-pl330.1", 0x00041330, S5PC100_PA_PDMA1,
+	{IRQ_PDMA1}, &s5pc100_pdma1_pdata);
 
 static int __init s5pc100_dma_init(void)
 {
 	dma_cap_set(DMA_SLAVE, s5pc100_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pc100_pdma0_pdata.cap_mask);
-	amba_device_register(&s5pc100_device_pdma0, &iomem_resource);
+	amba_device_register(&s5pc100_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, s5pc100_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pc100_pdma1_pdata.cap_mask);
-	amba_device_register(&s5pc100_device_pdma1, &iomem_resource);
+	amba_device_register(&s5pc100_pdma1_device, &iomem_resource);
 
 	return 0;
 }
arch/arm/mach-s5pv210/dma.c +6 -33
index 8602fa5..f6885d2 100644
@@ -71,21 +71,8 @@ struct dma_pl330_platdata s5pv210_pdma0_pdata = {
 	.peri_id = pdma0_peri,
 };
 
-struct amba_device s5pv210_device_pdma0 = {
-	.dev = {
-		.init_name = "dma-pl330.0",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_pdma0_pdata,
-	},
-	.res = {
-		.start = S5PV210_PA_PDMA0,
-		.end = S5PV210_PA_PDMA0 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA0},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330, S5PV210_PA_PDMA0,
+	{IRQ_PDMA0}, &s5pv210_pdma0_pdata);
 
 u8 pdma1_peri[] = {
 	DMACH_UART0_RX,
@@ -127,31 +114,18 @@ struct dma_pl330_platdata s5pv210_pdma1_pdata = {
 	.peri_id = pdma1_peri,
 };
 
-struct amba_device s5pv210_device_pdma1 = {
-	.dev = {
-		.init_name = "dma-pl330.1",
-		.dma_mask = &dma_dmamask,
-		.coherent_dma_mask = DMA_BIT_MASK(32),
-		.platform_data = &s5pv210_pdma1_pdata,
-	},
-	.res = {
-		.start = S5PV210_PA_PDMA1,
-		.end = S5PV210_PA_PDMA1 + SZ_4K,
-		.flags = IORESOURCE_MEM,
-	},
-	.irq = {IRQ_PDMA1},
-	.periphid = 0x00041330,
-};
+AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330, S5PV210_PA_PDMA1,
+	{IRQ_PDMA1}, &s5pv210_pdma1_pdata);
 
 static int __init s5pv210_dma_init(void)
 {
 	dma_cap_set(DMA_SLAVE, s5pv210_pdma0_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pv210_pdma0_pdata.cap_mask);
-	amba_device_register(&s5pv210_device_pdma0, &iomem_resource);
+	amba_device_register(&s5pv210_pdma0_device, &iomem_resource);
 
 	dma_cap_set(DMA_SLAVE, s5pv210_pdma1_pdata.cap_mask);
 	dma_cap_set(DMA_CYCLIC, s5pv210_pdma1_pdata.cap_mask);
-	amba_device_register(&s5pv210_device_pdma1, &iomem_resource);
+	amba_device_register(&s5pv210_pdma1_device, &iomem_resource);
 
 	return 0;
 }
--

1.7.4.4

#68 lore raw

cover Clean up amba/primecell bus support

In reply to Russell King - ARM Linux
Quoted 28 lines · Russell King - ARM Linux

This patch set cleans up the AMBA/Primecell bus support. Contained within this set are:

1. Patches 1-5 - Allocation APIs
It seems several places in the kernel want to allocate and register amba_device structures. Let's make this official, and common code. So we introduce amba_device_alloc(), amba_device_add(), and amba_device_put() APIs, which provide the necessary support safely for this.

Convert the DT, ux500, Integrator/AP and mxs code to use these APIs rather than their private version.

2. Patches 6-17 - NO_IRQ cleanup
Making IRQ number 0 mean 'no irq' for the AMBA drivers and bus layer. We get rid of NO_IRQ initializers in this across various platforms, and make the bus layer warn if '-1' is passed in a device as an IRQ. This prevents new occurances of NO_IRQ initializers for this bus type going by unspotted.

3. Patches 18-31 - static initializers
Provide a standardized set of initializers for statically declared AMBA devices. We provide two - one for the simpler APB devices, and one for AHB devices. The major difference between these two is the setting of the DMA mask - APB peripherals do not have DMA capability themselves.

Quoted 8 lines

While updating (3), I came across new additions in Spear3xx and the Samsung directories which added AMBA devices, which are declared globally. The Spear3xx devices are used in other files, so that's fine.

Samsung devices don't seem to be - and that needs fixing (did someone not run checkpatch or sparse on these changes?) Please send fixes.

Yeah, you're right. They in Samsung directories are not used anywhere else. So statically declaration can be used. As a note, I always run checkpatch but sparse before applying but unfortunately, checkpatch didn't complain about that.

Let me check where fixes are needed in Samsung directories then send it.

Thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.

Quoted 41 lines

Acks for these patches are welcome.

 arch/arm/mach-bcmring/core.c                   |   23 +-----
 arch/arm/mach-ep93xx/core.c                    |   46 ++---------
 arch/arm/mach-exynos/dma.c                     |   38 ++-------
 arch/arm/mach-integrator/core.c                |   70 +++-------------
 arch/arm/mach-integrator/impd1.c               |    9 +--
 arch/arm/mach-integrator/integrator_cp.c       |   49 ++---------
 arch/arm/mach-lpc32xx/phy3250.c                |   32 +------
 arch/arm/mach-mxs/devices.c                    |    8 +-
 arch/arm/mach-mxs/devices/amba-duart.c         |    2 +-
 arch/arm/mach-netx/fb.c                        |   13 +---
 arch/arm/mach-nomadik/board-nhk8815.c          |   17 +---
 arch/arm/mach-nomadik/cpu-8815.c               |    9 +--
 arch/arm/mach-omap2/emu.c                      |   26 +------
 arch/arm/mach-realview/core.h                  |   20 +----
 arch/arm/mach-realview/realview_eb.c           |   78 +++++++++---------
 arch/arm/mach-realview/realview_pb1176.c       |   78 +++++++++---------
 arch/arm/mach-realview/realview_pb11mp.c       |   78 +++++++++---------
 arch/arm/mach-realview/realview_pba8.c         |   78 +++++++++---------
 arch/arm/mach-realview/realview_pbx.c          |   78 +++++++++---------
 arch/arm/mach-s5p64x0/dma.c                    |   22 +----
 arch/arm/mach-s5pc100/dma.c                    |   38 ++-------
 arch/arm/mach-s5pv210/dma.c                    |   38 ++-------
 arch/arm/mach-spear3xx/spear300.c              |   14 +---
 arch/arm/mach-spear3xx/spear3xx.c              |   27 +-----
 arch/arm/mach-spear6xx/spear6xx.c              |   10 +-
 arch/arm/mach-u300/core.c                      |   85 ++++----------------
 arch/arm/mach-ux500/devices-common.c           |   13 +--
 arch/arm/mach-versatile/core.c                 |   70 ++++++++--------
 arch/arm/mach-versatile/core.h                 |   20 +----
 arch/arm/mach-versatile/versatile_pb.c         |   18 ++--
 arch/arm/mach-vexpress/core.h                  |   17 ----
 arch/arm/mach-vexpress/ct-ca9x4.c              |    8 +-
 arch/arm/mach-vexpress/include/mach/ct-ca9x4.h |    2 +-
 arch/arm/mach-vexpress/v2m.c                   |   20 ++--
 drivers/amba/bus.c                             |  105 ++++++++++++++++++------
 drivers/mmc/host/mmci.c                        |    2 +-
 drivers/of/platform.c                          |    6 +-
 include/linux/amba/bus.h                       |   36 ++++++++
 38 files changed, 488 insertions(+), 815 deletions(-)