Skip to contentSkip to conversation

ARM: davinci: modernize the irq support

PATCH Superseded Bartosz Golaszewski 4 participants 98 messages Jan 31, 2019 – Feb 8, 2019

Subsystems (4)

v1 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

cover ARM: davinci: modernize the irq support

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

The series can be logically split into four parts. The first (1-8) aims at introducing support for SPARSE_IRQ. It contains a couple changes required for that functionality and the final patch actually selecting it.

Second part (9-18) makes the aintc driver suitable for drivers/irqchip and eventually moves it over there.

Part 3 (19-31) does the same for the cp-intc driver.

Last part (32-35) aims at removing mach/irqs.h as it's no longer needed with SPARSE_IRQ selected.

The series has been tested on da850-lcdk (for cp-intc) and dm365-evm (for aintc).

Bartosz Golaszewski (35):
ARM: davinci: remove intc_host_map from davinci_soc_info struct
ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER
ARM: davinci: remove davinci_intc_type
ARM: davinci: pull davinci_intc_base into the respective intc drivers
ARM: davinci: drop irq defines from default_priorites
ARM: davinci: wrap interrupt definitions with a macro for SPARSE_IRQ
ARM: davinci: aintc: use irq domain
ARM: davinci: select SPARSE_IRQ
ARM: davinci: aintc: drop GPL license boilerplate
ARM: davinci: aintc: wrap davinci_irq_init() with a helper
ARM: davinci: aintc: use a common prefix for symbols in the driver
ARM: davinci: aintc: drop the 00 prefix from register offsets
ARM: davinci: aintc: add a new config structure
ARM: davinci: aintc: use the new irqchip config structure in dm* SoCs
ARM: davinci: aintc: use the new config structure
ARM: davinci: aintc: move timer-specific irq_set_handler() out of
irq.c
ARM: davinci: aintc: remove unnecessary includes
irqchip: davinci-aintc: move the driver to drivers/irqchip
ARM: davinci: cp-intc: remove cp_intc.h
ARM: davinci: cp-intc: add a wrapper around cp_intc_init()
ARM: davinci: cp-intc: add a new config structure
ARM: davinci: cp-intc: add the new config structures for da8xx SoCs
ARM: davinci: cp-intc: use a common prefix for all symbols
ARM: davinci: cp-intc: convert all hex numbers to lowercase
ARM: davinci: cp-intc: use the new-style config structure
ARM: davinci: cp-intc: improve coding style
ARM: davinci: cp-intc: unify error handling
ARM: davinci: cp-intc: remove unneeded include
ARM: davinci: cp-intc: drop GPL license boilerplate
ARM: davinci: cp-intc: remove redundant comments
irqchip: davinci-cp-intc: move the driver to drivers/irqchip
ARM: davinci: remove intc related fields from davinci_soc_info
ARM: davinci: prepare to remove mach/irqs.h
ARM: davinci: stop using defines from mach/irqs.h
ARM: davinci: remove mach/irqs.h

 arch/arm/Kconfig                              |   2 +
 arch/arm/mach-davinci/Kconfig                 |  19 +-
 arch/arm/mach-davinci/Makefile                |   3 -
 arch/arm/mach-davinci/asp.h                   |   8 +-
 arch/arm/mach-davinci/board-da830-evm.c       |   5 +-
 arch/arm/mach-davinci/board-da850-evm.c       |   7 +-
 arch/arm/mach-davinci/board-dm355-evm.c       |   2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c   |   2 +-
 arch/arm/mach-davinci/board-dm365-evm.c       |   2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c      |   4 +-
 arch/arm/mach-davinci/board-dm646x-evm.c      |   7 +-
 arch/arm/mach-davinci/board-mityomapl138.c    |   3 +-
 arch/arm/mach-davinci/board-neuros-osd2.c     |   2 +-
 arch/arm/mach-davinci/board-omapl138-hawk.c   |   3 +-
 arch/arm/mach-davinci/board-sffsdr.c          |   2 +-
 arch/arm/mach-davinci/common.c                |   3 -
 arch/arm/mach-davinci/cp_intc.c               | 215 ---------
 arch/arm/mach-davinci/cp_intc.h               |  57 ---
 arch/arm/mach-davinci/da830.c                 | 127 +-----
 arch/arm/mach-davinci/da850.c                 | 153 ++-----
 arch/arm/mach-davinci/davinci.h               |   6 +
 arch/arm/mach-davinci/devices-da8xx.c         | 146 +++----
 arch/arm/mach-davinci/devices.c               |  31 +-
 arch/arm/mach-davinci/dm355.c                 | 149 +++----
 arch/arm/mach-davinci/dm365.c                 | 175 +++-----
 arch/arm/mach-davinci/dm644x.c                | 145 +++----
 arch/arm/mach-davinci/dm646x.c                | 159 +++----
 arch/arm/mach-davinci/include/mach/common.h   |  14 +-
 arch/arm/mach-davinci/include/mach/da8xx.h    |   2 +
 .../mach-davinci/include/mach/entry-macro.S   |  39 --
 arch/arm/mach-davinci/include/mach/irqs.h     | 409 ------------------
 arch/arm/mach-davinci/irq.c                   | 117 -----
 arch/arm/mach-davinci/usb-da8xx.c             |   7 +-
 arch/arm/mach-davinci/usb.c                   |   7 +-
 drivers/irqchip/Kconfig                       |  10 +
 drivers/irqchip/Makefile                      |   2 +
 drivers/irqchip/irq-davinci-aintc.c           | 141 ++++++
 drivers/irqchip/irq-davinci-cp-intc.c         | 224 ++++++++++
 include/linux/irqchip/irq-davinci-aintc.h     |  19 +
 include/linux/irqchip/irq-davinci-cp-intc.h   |  18 +
 40 files changed, 829 insertions(+), 1617 deletions(-)
 delete mode 100644 arch/arm/mach-davinci/cp_intc.c
 delete mode 100644 arch/arm/mach-davinci/cp_intc.h
 delete mode 100644 arch/arm/mach-davinci/include/mach/entry-macro.S
 delete mode 100644 arch/arm/mach-davinci/include/mach/irqs.h
 delete mode 100644 arch/arm/mach-davinci/irq.c
 create mode 100644 drivers/irqchip/irq-davinci-aintc.c
 create mode 100644 drivers/irqchip/irq-davinci-cp-intc.c
 create mode 100644 include/linux/irqchip/irq-davinci-aintc.h
 create mode 100644 include/linux/irqchip/irq-davinci-cp-intc.h
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/35 ARM: davinci: remove intc_host_map from davinci_soc_info struct

From: Bartosz Golaszewski <[email protected]>

This field is not used by any board. Remove it as part of the interrupt support cleanup.

---
 arch/arm/mach-davinci/cp_intc.c             | 5 -----
 arch/arm/mach-davinci/include/mach/common.h | 1 -
 2 files changed, 6 deletions(-)
arch/arm/mach-davinci/cp_intc.c +0 -5
index 94085d21018e..67805ca74ff8 100644
@@ -117,7 +117,6 @@ int __init cp_intc_of_init(struct device_node *node, struct device_node *parent)
 {
 	u32 num_irq		= davinci_soc_info.intc_irq_num;
 	u8 *irq_prio		= davinci_soc_info.intc_irq_prios;
-	u32 *host_map		= davinci_soc_info.intc_host_map;
 	unsigned num_reg	= BITS_TO_LONGS(num_irq);
 	int i, irq_base;
 
@@ -182,10 +181,6 @@ int __init cp_intc_of_init(struct device_node *node, struct device_node *parent)
 			cp_intc_write(0x0f0f0f0f, CP_INTC_CHAN_MAP(i));
 	}
 
-	if (host_map)
-		for (i = 0; host_map[i] != -1; i++)
-			cp_intc_write(host_map[i], CP_INTC_HOST_MAP(i));
-
 	irq_base = irq_alloc_descs(-1, 0, num_irq, 0);
 	if (irq_base < 0) {
 		pr_warn("Couldn't allocate IRQ numbers\n");
arch/arm/mach-davinci/include/mach/common.h +0 -1
index b577e13a9c23..944afd57ee38 100644
@@ -61,7 +61,6 @@ struct davinci_soc_info {
 	int				intc_type;
 	u8				*intc_irq_prios;
 	unsigned long			intc_irq_num;
-	u32				*intc_host_map;
 	struct davinci_timer_info	*timer_info;
 	int				gpio_type;
 	u32				gpio_base;
Signature · 1 line
2.20.1
#3 lore raw

Re: [PATCH 01/35] ARM: davinci: remove intc_host_map from davinci_soc_info struct

In reply to Bartosz Golaszewski

Hi Bartosz,

Quoted 4 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This field is not used by any board. Remove it as part of the interrupt support cleanup.

Can you please make sure the patch description is independently readable without the subject line being read first.

For this and some other patches in this series.

Quoted 2 lines

Thanks,
Sekhar

#4 lore raw

PATCH 2/35 ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to support SPARSE_IRQ we first need to make davinci use the generic irq handler for ARM. Translate the legacy assembly to C and put the irq handlers into their respective drivers (aintc and cp-intc).

---
 arch/arm/Kconfig                              |  1 +
 arch/arm/mach-davinci/cp_intc.c               | 13 +++++++
 .../mach-davinci/include/mach/entry-macro.S   | 39 -------------------
 arch/arm/mach-davinci/irq.c                   | 21 ++++++++++
 4 files changed, 35 insertions(+), 39 deletions(-)
 delete mode 100644 arch/arm/mach-davinci/include/mach/entry-macro.S
arch/arm/Kconfig +1 -0
index 664e918e2624..f7770fdcad68 100644
@@ -589,6 +589,7 @@ config ARCH_DAVINCI
 	select GENERIC_ALLOCATOR
 	select GENERIC_CLOCKEVENTS
 	select GENERIC_IRQ_CHIP
+	select GENERIC_IRQ_MULTI_HANDLER
 	select GPIOLIB
 	select HAVE_IDE
 	select PM_GENERIC_DOMAINS if PM
arch/arm/mach-davinci/cp_intc.c +13 -0
index 67805ca74ff8..b9aec3c48a6a 100644
@@ -19,6 +19,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
+#include <asm/exception.h>
 #include <mach/common.h>
 #include "cp_intc.h"
 
@@ -97,6 +98,16 @@ static struct irq_chip cp_intc_irq_chip = {
 
 static struct irq_domain *cp_intc_domain;
 
+static asmlinkage void __exception_irq_entry
+cp_intc_handle_irq(struct pt_regs *regs)
+{
+	int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
+
+	irqnr &= 0xff;
+
+	handle_domain_irq(cp_intc_domain, irqnr, regs);
+}
+
 static int cp_intc_host_map(struct irq_domain *h, unsigned int virq,
 			  irq_hw_number_t hw)
 {
@@ -196,6 +207,8 @@ int __init cp_intc_of_init(struct device_node *node, struct device_node *parent)
 		return -EINVAL;
 	}
 
+	set_handle_irq(cp_intc_handle_irq);
+
 	/* Enable global interrupt */
 	cp_intc_write(1, CP_INTC_GLOBAL_ENABLE);
 
arch/arm/mach-davinci/include/mach/entry-macro.S deleted +0 -39
deleted file mode 100644
index cf5f573eb5fd..000000000000
@@ -1,39 +0,0 @@
-/*
- * Low-level IRQ helper macros for TI DaVinci-based platforms
- *
- * Author: Kevin Hilman, MontaVista Software, Inc. <[email protected]>
- *
- * 2007 (c) MontaVista Software, Inc. This file is licensed under
- * the terms of the GNU General Public License version 2. This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- */
-#include <mach/irqs.h>
-
-		.macro  get_irqnr_preamble, base, tmp
-		ldr \base, =davinci_intc_base
-		ldr \base, [\base]
-		.endm
-
-		.macro	get_irqnr_and_base, irqnr, irqstat, base, tmp
-#if defined(CONFIG_AINTC) && defined(CONFIG_CP_INTC)
-		ldr \tmp, =davinci_intc_type
-		ldr \tmp, [\tmp]
-		cmp \tmp, #DAVINCI_INTC_TYPE_CP_INTC
-		beq 1001f
-#endif
-#if defined(CONFIG_AINTC)
-		ldr \tmp, [\base, #0x14]
-		movs \tmp, \tmp, lsr #2
-		sub \irqnr, \tmp, #1
-		b 1002f
-#endif
-#if defined(CONFIG_CP_INTC)
-1001:		ldr \irqnr, [\base, #0x80] /* get irq number */
-		mov \tmp, \irqnr, lsr #31
-		and \irqnr, \irqnr, #0xff  /* irq is in bits 0-9 */
-		and \tmp, \tmp, #0x1
-		cmp \tmp, #0x1
-#endif
-1002:
-		.endm
arch/arm/mach-davinci/irq.c +21 -0
index 952dc126c390..3bbbef78d9ac 100644
@@ -28,11 +28,13 @@
 #include <mach/cputype.h>
 #include <mach/common.h>
 #include <asm/mach/irq.h>
+#include <asm/exception.h>
 
 #define FIQ_REG0_OFFSET		0x0000
 #define FIQ_REG1_OFFSET		0x0004
 #define IRQ_REG0_OFFSET		0x0008
 #define IRQ_REG1_OFFSET		0x000C
+#define IRQ_IRQENTRY_OFFSET	0x0014
 #define IRQ_ENT_REG0_OFFSET	0x0018
 #define IRQ_ENT_REG1_OFFSET	0x001C
 #define IRQ_INCTL_REG_OFFSET	0x0020
@@ -45,6 +47,11 @@ static inline void davinci_irq_writel(unsigned long value, int offset)
 	__raw_writel(value, davinci_intc_base + offset);
 }
 
+static inline unsigned long davinci_irq_readl(int offset)
+{
+	return __raw_readl(davinci_intc_base + offset);
+}
+
 static __init void
 davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
 {
@@ -69,6 +76,19 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
 			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
 }
 
+static asmlinkage void __exception_irq_entry
+davinci_handle_irq(struct pt_regs *regs)
+{
+	int irqnr = davinci_irq_readl(IRQ_IRQENTRY_OFFSET);
+	struct pt_regs *old_regs = set_irq_regs(regs);
+
+	irqnr >>= 2;
+	irqnr -= 1;
+
+	generic_handle_irq(irqnr);
+	set_irq_regs(old_regs);
+}
+
 /* ARM Interrupt Controller Initialization */
 void __init davinci_irq_init(void)
 {
@@ -114,4 +134,5 @@ void __init davinci_irq_init(void)
 		davinci_alloc_gc(davinci_intc_base + j, i, 32);
 
 	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
+	set_handle_irq(davinci_handle_irq);
 }
Signature · 1 line
2.20.1
#5 lore raw

Re: [PATCH 02/35] ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER

Quoted 8 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to support SPARSE_IRQ we first need to make davinci use the generic irq handler for ARM. Translate the legacy assembly to C and put the irq handlers into their respective drivers (aintc and cp-intc).

---

...

Quoted 1 line
arch/arm/mach-davinci/cp_intc.c +0 -0

...

arch/arm/mach-davinci/cp_intc.c static struct irq_chip cp_intc_irq_chip = { · line 106

Quoted 10 lines
arch/arm/mach-davinci/cp_intc.c +6 -0
@@ -97,6 +98,16 @@ static struct irq_chip cp_intc_irq_chip = {
 
  static struct irq_domain *cp_intc_domain;
 
+static asmlinkage void __exception_irq_entry
+cp_intc_handle_irq(struct pt_regs *regs)
+{
+	int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
+
+	irqnr &= 0xff;

What does applying the 0xff mask do? (perhaps needs a code comment if it is important and not obvious).

Quoted 7 lines
arch/arm/mach-davinci/cp_intc.c +4 -0
+
+	handle_domain_irq(cp_intc_domain, irqnr, regs);
+}
+
  static int cp_intc_host_map(struct irq_domain *h, unsigned int virq,
  			  irq_hw_number_t hw)
  {

...

Quoted 1 line
arch/arm/mach-davinci/irq.c +0 -0

...

arch/arm/mach-davinci/irq.c davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) · line 86

Quoted 12 lines
arch/arm/mach-davinci/irq.c +8 -0
@@ -69,6 +76,19 @@ davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
  			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
  }
 
+static asmlinkage void __exception_irq_entry
+davinci_handle_irq(struct pt_regs *regs)
+{
+	int irqnr = davinci_irq_readl(IRQ_IRQENTRY_OFFSET);
+	struct pt_regs *old_regs = set_irq_regs(regs);
+
+	irqnr >>= 2;
+	irqnr -= 1;

Same here. It is not obvious to me what sort of conversion is going on here.

Quoted 8 lines
arch/arm/mach-davinci/irq.c +5 -0
+
+	generic_handle_irq(irqnr);
+	set_irq_regs(old_regs);
+}
+
  /* ARM Interrupt Controller Initialization */
  void __init davinci_irq_init(void)
  {
#6 lore raw

Re: [PATCH 02/35] ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER

In reply to Bartosz Golaszewski
Quoted 14 lines · Bartosz Golaszewski
arch/arm/mach-davinci/cp_intc.c +1 -0
index 67805ca74ff8..b9aec3c48a6a 100644
@@ -19,6 +19,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
+#include <asm/exception.h>
 #include <mach/common.h>
 #include "cp_intc.h"
 
@@ -97,6 +98,16 @@ static struct irq_chip cp_intc_irq_chip = {
 

arch/arm/mach-davinci/cp_intc.c static struct irq_chip cp_intc_irq_chip = { · line 108

Quoted 10 lines
arch/arm/mach-davinci/cp_intc.c +8 -0
 static struct irq_domain *cp_intc_domain;
 
+static asmlinkage void __exception_irq_entry
+cp_intc_handle_irq(struct pt_regs *regs)
+{
+	int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
+
+	irqnr &= 0xff;
+
+	handle_domain_irq(cp_intc_domain, irqnr, regs);

This leaves out spurious interrupt handling present in existing assembly code. Can you add it back. May be use omap_intc_handle_irq() as an example for handling spurious IRQs.

Quoted 22 lines
arch/arm/mach-davinci/cp_intc.c +2 -0
+}
+
 
arch/arm/mach-davinci/irq.c +2 -0
index 952dc126c390..3bbbef78d9ac 100644
@@ -28,11 +28,13 @@
 #include <mach/cputype.h>
 #include <mach/common.h>
 #include <asm/mach/irq.h>
+#include <asm/exception.h>
 
 #define FIQ_REG0_OFFSET		0x0000
 #define FIQ_REG1_OFFSET		0x0004
 #define IRQ_REG0_OFFSET		0x0008
 #define IRQ_REG1_OFFSET		0x000C
+#define IRQ_IRQENTRY_OFFSET	0x0014
 #define IRQ_ENT_REG0_OFFSET	0x0018
 #define IRQ_ENT_REG1_OFFSET	0x001C
 #define IRQ_INCTL_REG_OFFSET	0x0020

arch/arm/mach-davinci/irq.c static inline void davinci_irq_writel(unsigned long value, int offset) · line 53

Quoted 7 lines
arch/arm/mach-davinci/irq.c +4 -0
@@ -45,6 +47,11 @@ static inline void davinci_irq_writel(unsigned long value, int offset)
 	__raw_writel(value, davinci_intc_base + offset);
 }
 
+static inline unsigned long davinci_irq_readl(int offset)
+{
+	return __raw_readl(davinci_intc_base + offset);
+}

Can we use readl_relaxed() here? I know there is existing __raw_writel() usage. May be add a patch to fix the existing code first.

Thanks,
Sekhar

#7 lore raw

Re: [PATCH 02/35] ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER

śr., 6 lut 2019 o 13:39 Sekhar Nori <[email protected]> napisał(a):

Quoted 19 lines · Bartosz Golaszewski
Quoted 17 lines
arch/arm/mach-davinci/cp_intc.c +1 -0
index 67805ca74ff8..b9aec3c48a6a 100644
@@ -19,6 +19,7 @@
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 
+#include <asm/exception.h>
 #include <mach/common.h>
 #include "cp_intc.h"
 
@@ -97,6 +98,16 @@ static struct irq_chip cp_intc_irq_chip = {
 
 static struct irq_domain *cp_intc_domain;
 
Quoted 13 lines

arch/arm/mach-davinci/cp_intc.c static struct irq_chip cp_intc_irq_chip = { · line 108

Quoted 8 lines
arch/arm/mach-davinci/cp_intc.c +8 -0
+static asmlinkage void __exception_irq_entry
+cp_intc_handle_irq(struct pt_regs *regs)
+{
+     int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
+
+     irqnr &= 0xff;
+
+     handle_domain_irq(cp_intc_domain, irqnr, regs);

This leaves out spurious interrupt handling present in existing assembly code. Can you add it back. May be use omap_intc_handle_irq() as an example for handling spurious IRQs.

Hi Sekhar,

I started looking at this one and noticed that the manual says PRI_INDX field in the GPIR register is in bits 0-9 (mask 0x3ff) while the assembly logically ANDs it with 0xff. I guess it's because there can be no more interrupts than 255 but I'd at least explain it in a comment. Or should we use the proper mask? What do you think?

Bart

Quoted 35 lines
Quoted 22 lines
arch/arm/mach-davinci/cp_intc.c +2 -0
+}
+
 
arch/arm/mach-davinci/irq.c +2 -0
index 952dc126c390..3bbbef78d9ac 100644
@@ -28,11 +28,13 @@
 #include <mach/cputype.h>
 #include <mach/common.h>
 #include <asm/mach/irq.h>
+#include <asm/exception.h>
 
 #define FIQ_REG0_OFFSET              0x0000
 #define FIQ_REG1_OFFSET              0x0004
 #define IRQ_REG0_OFFSET              0x0008
 #define IRQ_REG1_OFFSET              0x000C
+#define IRQ_IRQENTRY_OFFSET  0x0014
 #define IRQ_ENT_REG0_OFFSET  0x0018
 #define IRQ_ENT_REG1_OFFSET  0x001C
 #define IRQ_INCTL_REG_OFFSET 0x0020

arch/arm/mach-davinci/irq.c static inline void davinci_irq_writel(unsigned long value, int offset) · line 53

Quoted 7 lines
arch/arm/mach-davinci/irq.c +4 -0
@@ -45,6 +47,11 @@ static inline void davinci_irq_writel(unsigned long value, int offset)
      __raw_writel(value, davinci_intc_base + offset);
 }
 
+static inline unsigned long davinci_irq_readl(int offset)
+{
+     return __raw_readl(davinci_intc_base + offset);
+}

Can we use readl_relaxed() here? I know there is existing __raw_writel() usage. May be add a patch to fix the existing code first.

Thanks,
Sekhar

#8 lore raw

Re: [PATCH 02/35] ARM: davinci: select GENERIC_IRQ_MULTI_HANDLER

Quoted 14 lines · Bartosz Golaszewski
Quoted 4 lines
Quoted 4 lines
arch/arm/mach-davinci/cp_intc.c +4 -0
+static asmlinkage void __exception_irq_entry
+cp_intc_handle_irq(struct pt_regs *regs)
+{
+     int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
Quoted 9 lines

arch/arm/mach-davinci/cp_intc.c static struct irq_chip cp_intc_irq_chip = { · line 108

Quoted 4 lines
arch/arm/mach-davinci/cp_intc.c +4 -0
+
+     irqnr &= 0xff;
+
+     handle_domain_irq(cp_intc_domain, irqnr, regs);

This leaves out spurious interrupt handling present in existing assembly code. Can you add it back. May be use omap_intc_handle_irq() as an example for handling spurious IRQs.

Quoted 7 lines

Hi Sekhar,

I started looking at this one and noticed that the manual says PRI_INDX field in the GPIR register is in bits 0-9 (mask 0x3ff) while the assembly logically ANDs it with 0xff. I guess it's because there can be no more interrupts than 255 but I'd at least explain it in a comment. Or should we use the proper mask? What do you think?

I think using mask 0x3ff to match TRM is fine.

Thanks,
Sekhar

#9 lore raw

PATCH 3/35 ARM: davinci: remove davinci_intc_type

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We now use the generic ARM irq handler on davinci. There are no more users that check davinci_intc_type. Remove the variable and all its references.

---
 arch/arm/mach-davinci/common.c              | 1 -
 arch/arm/mach-davinci/cp_intc.c             | 1 -
 arch/arm/mach-davinci/da830.c               | 1 -
 arch/arm/mach-davinci/da850.c               | 1 -
 arch/arm/mach-davinci/dm355.c               | 1 -
 arch/arm/mach-davinci/dm365.c               | 1 -
 arch/arm/mach-davinci/dm644x.c              | 1 -
 arch/arm/mach-davinci/dm646x.c              | 1 -
 arch/arm/mach-davinci/include/mach/common.h | 2 --
 arch/arm/mach-davinci/include/mach/irqs.h   | 3 ---
 arch/arm/mach-davinci/irq.c                 | 1 -
 11 files changed, 14 deletions(-)
arch/arm/mach-davinci/common.c +0 -1
index e1d0f0d841ff..a87e158a709b 100644
@@ -24,7 +24,6 @@ struct davinci_soc_info davinci_soc_info;
 EXPORT_SYMBOL(davinci_soc_info);
 
 void __iomem *davinci_intc_base;
-int davinci_intc_type;
 
 void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context)
 {
arch/arm/mach-davinci/cp_intc.c +0 -1
index b9aec3c48a6a..fef39d5988d9 100644
@@ -131,7 +131,6 @@ int __init cp_intc_of_init(struct device_node *node, struct device_node *parent)
 	unsigned num_reg	= BITS_TO_LONGS(num_irq);
 	int i, irq_base;
 
-	davinci_intc_type = DAVINCI_INTC_TYPE_CP_INTC;
 	if (node) {
 		davinci_intc_base = of_iomap(node, 0);
 		if (of_property_read_u32(node, "ti,intc-size", &num_irq))
arch/arm/mach-davinci/da830.c +0 -1
index 2cc9fe4c3a91..9e18b245266b 100644
@@ -807,7 +807,6 @@ static const struct davinci_soc_info davinci_soc_info_da830 = {
 	.pinmux_pins		= da830_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(da830_pins),
 	.intc_base		= DA8XX_CP_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_CP_INTC,
 	.intc_irq_prios		= da830_default_priorities,
 	.intc_irq_num		= DA830_N_CP_INTC_IRQ,
 	.timer_info		= &da830_timer_info,
arch/arm/mach-davinci/da850.c +0 -1
index e7b78df2bfef..e823b89e2b7a 100644
@@ -739,7 +739,6 @@ static const struct davinci_soc_info davinci_soc_info_da850 = {
 	.pinmux_pins		= da850_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(da850_pins),
 	.intc_base		= DA8XX_CP_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_CP_INTC,
 	.intc_irq_prios		= da850_default_priorities,
 	.intc_irq_num		= DA850_N_CP_INTC_IRQ,
 	.timer_info		= &da850_timer_info,
arch/arm/mach-davinci/dm355.c +0 -1
index 4c6e0bef4509..03ce5df28d87 100644
@@ -705,7 +705,6 @@ static const struct davinci_soc_info davinci_soc_info_dm355 = {
 	.pinmux_pins		= dm355_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm355_pins),
 	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_AINTC,
 	.intc_irq_prios		= dm355_default_priorities,
 	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm355_timer_info,
arch/arm/mach-davinci/dm365.c +0 -1
index 01fb2b0c82de..3e034f0478d2 100644
@@ -722,7 +722,6 @@ static const struct davinci_soc_info davinci_soc_info_dm365 = {
 	.pinmux_pins		= dm365_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm365_pins),
 	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_AINTC,
 	.intc_irq_prios		= dm365_default_priorities,
 	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm365_timer_info,
arch/arm/mach-davinci/dm644x.c +0 -1
index 38f92b7d413e..66bab4782c62 100644
@@ -646,7 +646,6 @@ static const struct davinci_soc_info davinci_soc_info_dm644x = {
 	.pinmux_pins		= dm644x_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm644x_pins),
 	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_AINTC,
 	.intc_irq_prios 	= dm644x_default_priorities,
 	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm644x_timer_info,
arch/arm/mach-davinci/dm646x.c +0 -1
index 7dc54b2a610f..45efa715a2c1 100644
@@ -586,7 +586,6 @@ static const struct davinci_soc_info davinci_soc_info_dm646x = {
 	.pinmux_pins		= dm646x_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm646x_pins),
 	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_type		= DAVINCI_INTC_TYPE_AINTC,
 	.intc_irq_prios		= dm646x_default_priorities,
 	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm646x_timer_info,
arch/arm/mach-davinci/include/mach/common.h +0 -2
index 944afd57ee38..34e48de92dcc 100644
@@ -21,7 +21,6 @@ void davinci_timer_init(struct clk *clk);
 
 extern void davinci_irq_init(void);
 extern void __iomem *davinci_intc_base;
-extern int davinci_intc_type;
 
 struct davinci_timer_instance {
 	u32		base;
@@ -58,7 +57,6 @@ struct davinci_soc_info {
 	const struct mux_config		*pinmux_pins;
 	unsigned long			pinmux_pins_num;
 	u32				intc_base;
-	int				intc_type;
 	u8				*intc_irq_prios;
 	unsigned long			intc_irq_num;
 	struct davinci_timer_info	*timer_info;
arch/arm/mach-davinci/include/mach/irqs.h +0 -3
index edb2ca62321a..03c446635301 100644
@@ -30,9 +30,6 @@
 /* Base address */
 #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
-#define DAVINCI_INTC_TYPE_AINTC		0
-#define DAVINCI_INTC_TYPE_CP_INTC	1
-
 /* Interrupt lines */
 #define IRQ_VDINT0       0
 #define IRQ_VDINT1       1
arch/arm/mach-davinci/irq.c +0 -1
index 3bbbef78d9ac..3658235c8ee7 100644
@@ -95,7 +95,6 @@ void __init davinci_irq_init(void)
 	unsigned i, j;
 	const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios;
 
-	davinci_intc_type = DAVINCI_INTC_TYPE_AINTC;
 	davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_4K);
 	if (WARN_ON(!davinci_intc_base))
 		return;
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#11 lore raw

PATCH 4/35 ARM: davinci: pull davinci_intc_base into the respective intc drivers

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This variable is defined globally in common.c. Define separate local variables for the aintc and cp-intc drivers and remove the global one.

---
 arch/arm/mach-davinci/common.c              | 2 --
 arch/arm/mach-davinci/cp_intc.c             | 2 ++
 arch/arm/mach-davinci/include/mach/common.h | 1 -
 arch/arm/mach-davinci/irq.c                 | 2 ++
 4 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-davinci/common.c +0 -2
index a87e158a709b..2850ae02aaa4 100644
@@ -23,8 +23,6 @@
 struct davinci_soc_info davinci_soc_info;
 EXPORT_SYMBOL(davinci_soc_info);
 
-void __iomem *davinci_intc_base;
-
 void davinci_get_mac_addr(struct nvmem_device *nvmem, void *context)
 {
 	char *mac_addr = davinci_soc_info.emac_pdata->mac_addr;
arch/arm/mach-davinci/cp_intc.c +2 -0
index fef39d5988d9..384b72fbefca 100644
@@ -23,6 +23,8 @@
 #include <mach/common.h>
 #include "cp_intc.h"
 
+static void __iomem *davinci_intc_base;
+
 static inline unsigned int cp_intc_read(unsigned offset)
 {
 	return __raw_readl(davinci_intc_base + offset);
arch/arm/mach-davinci/include/mach/common.h +0 -1
index 34e48de92dcc..3d45b73b9a64 100644
@@ -20,7 +20,6 @@
 void davinci_timer_init(struct clk *clk);
 
 extern void davinci_irq_init(void);
-extern void __iomem *davinci_intc_base;
 
 struct davinci_timer_instance {
 	u32		base;
arch/arm/mach-davinci/irq.c +2 -0
index 3658235c8ee7..e539bc65d4ef 100644
@@ -42,6 +42,8 @@
 #define IRQ_INTPRI0_REG_OFFSET	0x0030
 #define IRQ_INTPRI7_REG_OFFSET	0x004C
 
+static void __iomem *davinci_intc_base;
+
 static inline void davinci_irq_writel(unsigned long value, int offset)
 {
 	__raw_writel(value, davinci_intc_base + offset);
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#13 lore raw

PATCH 5/35 ARM: davinci: drop irq defines from default_priorites

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---
 arch/arm/mach-davinci/da830.c  | 107 ++++--------------------------
 arch/arm/mach-davinci/da850.c  | 118 +++++----------------------------
 arch/arm/mach-davinci/dm355.c  |  74 +++------------------
 arch/arm/mach-davinci/dm365.c  |  76 +++------------------
 arch/arm/mach-davinci/dm644x.c |  76 +++------------------
 arch/arm/mach-davinci/dm646x.c |  76 +++------------------
 6 files changed, 69 insertions(+), 458 deletions(-)
arch/arm/mach-davinci/da830.c +14 -93
index 9e18b245266b..f1e7b6c644e5 100644
@@ -624,98 +624,19 @@ const short da830_eqep1_pins[] __initconst = {
 };
 
 /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
-static u8 da830_default_priorities[DA830_N_CP_INTC_IRQ] = {
-	[IRQ_DA8XX_COMMTX]		= 7,
-	[IRQ_DA8XX_COMMRX]		= 7,
-	[IRQ_DA8XX_NINT]		= 7,
-	[IRQ_DA8XX_EVTOUT0]		= 7,
-	[IRQ_DA8XX_EVTOUT1]		= 7,
-	[IRQ_DA8XX_EVTOUT2]		= 7,
-	[IRQ_DA8XX_EVTOUT3]		= 7,
-	[IRQ_DA8XX_EVTOUT4]		= 7,
-	[IRQ_DA8XX_EVTOUT5]		= 7,
-	[IRQ_DA8XX_EVTOUT6]		= 7,
-	[IRQ_DA8XX_EVTOUT7]		= 7,
-	[IRQ_DA8XX_CCINT0]		= 7,
-	[IRQ_DA8XX_CCERRINT]		= 7,
-	[IRQ_DA8XX_TCERRINT0]		= 7,
-	[IRQ_DA8XX_AEMIFINT]		= 7,
-	[IRQ_DA8XX_I2CINT0]		= 7,
-	[IRQ_DA8XX_MMCSDINT0]		= 7,
-	[IRQ_DA8XX_MMCSDINT1]		= 7,
-	[IRQ_DA8XX_ALLINT0]		= 7,
-	[IRQ_DA8XX_RTC]			= 7,
-	[IRQ_DA8XX_SPINT0]		= 7,
-	[IRQ_DA8XX_TINT12_0]		= 7,
-	[IRQ_DA8XX_TINT34_0]		= 7,
-	[IRQ_DA8XX_TINT12_1]		= 7,
-	[IRQ_DA8XX_TINT34_1]		= 7,
-	[IRQ_DA8XX_UARTINT0]		= 7,
-	[IRQ_DA8XX_KEYMGRINT]		= 7,
-	[IRQ_DA830_MPUERR]		= 7,
-	[IRQ_DA8XX_CHIPINT0]		= 7,
-	[IRQ_DA8XX_CHIPINT1]		= 7,
-	[IRQ_DA8XX_CHIPINT2]		= 7,
-	[IRQ_DA8XX_CHIPINT3]		= 7,
-	[IRQ_DA8XX_TCERRINT1]		= 7,
-	[IRQ_DA8XX_C0_RX_THRESH_PULSE]	= 7,
-	[IRQ_DA8XX_C0_RX_PULSE]		= 7,
-	[IRQ_DA8XX_C0_TX_PULSE]		= 7,
-	[IRQ_DA8XX_C0_MISC_PULSE]	= 7,
-	[IRQ_DA8XX_C1_RX_THRESH_PULSE]	= 7,
-	[IRQ_DA8XX_C1_RX_PULSE]		= 7,
-	[IRQ_DA8XX_C1_TX_PULSE]		= 7,
-	[IRQ_DA8XX_C1_MISC_PULSE]	= 7,
-	[IRQ_DA8XX_MEMERR]		= 7,
-	[IRQ_DA8XX_GPIO0]		= 7,
-	[IRQ_DA8XX_GPIO1]		= 7,
-	[IRQ_DA8XX_GPIO2]		= 7,
-	[IRQ_DA8XX_GPIO3]		= 7,
-	[IRQ_DA8XX_GPIO4]		= 7,
-	[IRQ_DA8XX_GPIO5]		= 7,
-	[IRQ_DA8XX_GPIO6]		= 7,
-	[IRQ_DA8XX_GPIO7]		= 7,
-	[IRQ_DA8XX_GPIO8]		= 7,
-	[IRQ_DA8XX_I2CINT1]		= 7,
-	[IRQ_DA8XX_LCDINT]		= 7,
-	[IRQ_DA8XX_UARTINT1]		= 7,
-	[IRQ_DA8XX_MCASPINT]		= 7,
-	[IRQ_DA8XX_ALLINT1]		= 7,
-	[IRQ_DA8XX_SPINT1]		= 7,
-	[IRQ_DA8XX_UHPI_INT1]		= 7,
-	[IRQ_DA8XX_USB_INT]		= 7,
-	[IRQ_DA8XX_IRQN]		= 7,
-	[IRQ_DA8XX_RWAKEUP]		= 7,
-	[IRQ_DA8XX_UARTINT2]		= 7,
-	[IRQ_DA8XX_DFTSSINT]		= 7,
-	[IRQ_DA8XX_EHRPWM0]		= 7,
-	[IRQ_DA8XX_EHRPWM0TZ]		= 7,
-	[IRQ_DA8XX_EHRPWM1]		= 7,
-	[IRQ_DA8XX_EHRPWM1TZ]		= 7,
-	[IRQ_DA830_EHRPWM2]		= 7,
-	[IRQ_DA830_EHRPWM2TZ]		= 7,
-	[IRQ_DA8XX_ECAP0]		= 7,
-	[IRQ_DA8XX_ECAP1]		= 7,
-	[IRQ_DA8XX_ECAP2]		= 7,
-	[IRQ_DA830_EQEP0]		= 7,
-	[IRQ_DA830_EQEP1]		= 7,
-	[IRQ_DA830_T12CMPINT0_0]	= 7,
-	[IRQ_DA830_T12CMPINT1_0]	= 7,
-	[IRQ_DA830_T12CMPINT2_0]	= 7,
-	[IRQ_DA830_T12CMPINT3_0]	= 7,
-	[IRQ_DA830_T12CMPINT4_0]	= 7,
-	[IRQ_DA830_T12CMPINT5_0]	= 7,
-	[IRQ_DA830_T12CMPINT6_0]	= 7,
-	[IRQ_DA830_T12CMPINT7_0]	= 7,
-	[IRQ_DA830_T12CMPINT0_1]	= 7,
-	[IRQ_DA830_T12CMPINT1_1]	= 7,
-	[IRQ_DA830_T12CMPINT2_1]	= 7,
-	[IRQ_DA830_T12CMPINT3_1]	= 7,
-	[IRQ_DA830_T12CMPINT4_1]	= 7,
-	[IRQ_DA830_T12CMPINT5_1]	= 7,
-	[IRQ_DA830_T12CMPINT6_1]	= 7,
-	[IRQ_DA830_T12CMPINT7_1]	= 7,
-	[IRQ_DA8XX_ARMCLKSTOPREQ]	= 7,
+static u8 da830_cp_intc_prios[] = {
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
 };
 
 static struct map_desc da830_io_desc[] = {
@@ -807,7 +728,7 @@ static const struct davinci_soc_info davinci_soc_info_da830 = {
 	.pinmux_pins		= da830_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(da830_pins),
 	.intc_base		= DA8XX_CP_INTC_BASE,
-	.intc_irq_prios		= da830_default_priorities,
+	.intc_irq_prios		= da830_cp_intc_prios,
 	.intc_irq_num		= DA830_N_CP_INTC_IRQ,
 	.timer_info		= &da830_timer_info,
 	.emac_pdata		= &da8xx_emac_pdata,
arch/arm/mach-davinci/da850.c +15 -103

130 lines not on this page · raw message

arch/arm/mach-davinci/dm355.c +10 -64

86 lines not on this page · raw message

arch/arm/mach-davinci/dm365.c +10 -66

88 lines not on this page · raw message

arch/arm/mach-davinci/dm644x.c +10 -66

88 lines not on this page · raw message

arch/arm/mach-davinci/dm646x.c +10 -66

88 lines not on this page · raw message

Signature · 1 line
2.20.1
#14 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---

...

Quoted 63 lines
arch/arm/mach-davinci/dm355.c +0 -63
-static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-	[IRQ_DM355_CCDC_VDINT0]		= 2,
-	[IRQ_DM355_CCDC_VDINT1]		= 6,
-	[IRQ_DM355_CCDC_VDINT2]		= 6,
-	[IRQ_DM355_IPIPE_HST]		= 6,
-	[IRQ_DM355_H3AINT]		= 6,
-	[IRQ_DM355_IPIPE_SDR]		= 6,
-	[IRQ_DM355_IPIPEIFINT]		= 6,
-	[IRQ_DM355_OSDINT]		= 7,
-	[IRQ_DM355_VENCINT]		= 6,
-	[IRQ_ASQINT]			= 6,
-	[IRQ_IMXINT]			= 6,
-	[IRQ_USBINT]			= 4,
-	[IRQ_DM355_RTOINT]		= 4,
-	[IRQ_DM355_UARTINT2]		= 7,
-	[IRQ_DM355_TINT6]		= 7,
-	[IRQ_CCINT0]			= 5,	/* dma */
-	[IRQ_CCERRINT]			= 5,	/* dma */
-	[IRQ_TCERRINT0]			= 5,	/* dma */
-	[IRQ_TCERRINT]			= 5,	/* dma */
-	[IRQ_DM355_SPINT2_1]		= 7,
-	[IRQ_DM355_TINT7]		= 4,
-	[IRQ_DM355_SDIOINT0]		= 7,
-	[IRQ_MBXINT]			= 7,
-	[IRQ_MBRINT]			= 7,
-	[IRQ_MMCINT]			= 7,
-	[IRQ_DM355_MMCINT1]		= 7,
-	[IRQ_DM355_PWMINT3]		= 7,
-	[IRQ_DDRINT]			= 7,
-	[IRQ_AEMIFINT]			= 7,
-	[IRQ_DM355_SDIOINT1]		= 4,
-	[IRQ_TINT0_TINT12]		= 2,	/* clockevent */
-	[IRQ_TINT0_TINT34]		= 2,	/* clocksource */
-	[IRQ_TINT1_TINT12]		= 7,	/* DSP timer */
-	[IRQ_TINT1_TINT34]		= 7,	/* system tick */
-	[IRQ_PWMINT0]			= 7,
-	[IRQ_PWMINT1]			= 7,
-	[IRQ_PWMINT2]			= 7,
-	[IRQ_I2C]			= 3,
-	[IRQ_UARTINT0]			= 3,
-	[IRQ_UARTINT1]			= 3,
-	[IRQ_DM355_SPINT0_0]		= 3,
-	[IRQ_DM355_SPINT0_1]		= 3,
-	[IRQ_DM355_GPIO0]		= 3,
-	[IRQ_DM355_GPIO1]		= 7,
-	[IRQ_DM355_GPIO2]		= 4,
-	[IRQ_DM355_GPIO3]		= 4,
-	[IRQ_DM355_GPIO4]		= 7,
-	[IRQ_DM355_GPIO5]		= 7,
-	[IRQ_DM355_GPIO6]		= 7,
-	[IRQ_DM355_GPIO7]		= 7,
-	[IRQ_DM355_GPIO8]		= 7,
-	[IRQ_DM355_GPIO9]		= 7,
-	[IRQ_DM355_GPIOBNK0]		= 7,
-	[IRQ_DM355_GPIOBNK1]		= 7,
-	[IRQ_DM355_GPIOBNK2]		= 7,
-	[IRQ_DM355_GPIOBNK3]		= 7,
-	[IRQ_DM355_GPIOBNK4]		= 7,
-	[IRQ_DM355_GPIOBNK5]		= 7,
-	[IRQ_DM355_GPIOBNK6]		= 7,
-	[IRQ_COMMTX]			= 7,
-	[IRQ_COMMRX]			= 7,
-	[IRQ_EMUINT]			= 7,

arch/arm/mach-davinci/dm355.c MUX_CFG(DM355, VIN_CINH_EN, 0, 8, 3, 3, false) · line 166

Quoted 10 lines
arch/arm/mach-davinci/dm355.c +9 -0
+static u8 dm355_aintc_prios[] = {
+	2, 6, 6, 6, 6, 6, 6, 7,
+	6, 6, 6, 4, 4, 7, 7, 5,
+	5, 5, 5, 7, 4, 7, 7, 7,
+	7, 7, 7, 7, 7, 4, 2, 2,
+	7, 7, 7, 7, 7, 3, 3, 3,
+	3, 3, 3, 7, 4, 4, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 0, 0,
  };

Hmm... this makes it harder to see what is going on here. You can no longer see which priority corresponds to which IRQ without consulting a manual.

#15 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

Quoted 83 lines · David Lechner
Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---

...

Quoted 69 lines
arch/arm/mach-davinci/dm355.c +6 -63
-static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-    [IRQ_DM355_CCDC_VDINT0]        = 2,
-    [IRQ_DM355_CCDC_VDINT1]        = 6,
-    [IRQ_DM355_CCDC_VDINT2]        = 6,
-    [IRQ_DM355_IPIPE_HST]        = 6,
-    [IRQ_DM355_H3AINT]        = 6,
-    [IRQ_DM355_IPIPE_SDR]        = 6,
-    [IRQ_DM355_IPIPEIFINT]        = 6,
-    [IRQ_DM355_OSDINT]        = 7,
-    [IRQ_DM355_VENCINT]        = 6,
-    [IRQ_ASQINT]            = 6,
-    [IRQ_IMXINT]            = 6,
-    [IRQ_USBINT]            = 4,
-    [IRQ_DM355_RTOINT]        = 4,
-    [IRQ_DM355_UARTINT2]        = 7,
-    [IRQ_DM355_TINT6]        = 7,
-    [IRQ_CCINT0]            = 5,    /* dma */
-    [IRQ_CCERRINT]            = 5,    /* dma */
-    [IRQ_TCERRINT0]            = 5,    /* dma */
-    [IRQ_TCERRINT]            = 5,    /* dma */
-    [IRQ_DM355_SPINT2_1]        = 7,
-    [IRQ_DM355_TINT7]        = 4,
-    [IRQ_DM355_SDIOINT0]        = 7,
-    [IRQ_MBXINT]            = 7,
-    [IRQ_MBRINT]            = 7,
-    [IRQ_MMCINT]            = 7,
-    [IRQ_DM355_MMCINT1]        = 7,
-    [IRQ_DM355_PWMINT3]        = 7,
-    [IRQ_DDRINT]            = 7,
-    [IRQ_AEMIFINT]            = 7,
-    [IRQ_DM355_SDIOINT1]        = 4,
-    [IRQ_TINT0_TINT12]        = 2,    /* clockevent */
-    [IRQ_TINT0_TINT34]        = 2,    /* clocksource */
-    [IRQ_TINT1_TINT12]        = 7,    /* DSP timer */
-    [IRQ_TINT1_TINT34]        = 7,    /* system tick */
-    [IRQ_PWMINT0]            = 7,
-    [IRQ_PWMINT1]            = 7,
-    [IRQ_PWMINT2]            = 7,
-    [IRQ_I2C]            = 3,
-    [IRQ_UARTINT0]            = 3,
-    [IRQ_UARTINT1]            = 3,
-    [IRQ_DM355_SPINT0_0]        = 3,
-    [IRQ_DM355_SPINT0_1]        = 3,
-    [IRQ_DM355_GPIO0]        = 3,
-    [IRQ_DM355_GPIO1]        = 7,
-    [IRQ_DM355_GPIO2]        = 4,
-    [IRQ_DM355_GPIO3]        = 4,
-    [IRQ_DM355_GPIO4]        = 7,
-    [IRQ_DM355_GPIO5]        = 7,
-    [IRQ_DM355_GPIO6]        = 7,
-    [IRQ_DM355_GPIO7]        = 7,
-    [IRQ_DM355_GPIO8]        = 7,
-    [IRQ_DM355_GPIO9]        = 7,
-    [IRQ_DM355_GPIOBNK0]        = 7,
-    [IRQ_DM355_GPIOBNK1]        = 7,
-    [IRQ_DM355_GPIOBNK2]        = 7,
-    [IRQ_DM355_GPIOBNK3]        = 7,
-    [IRQ_DM355_GPIOBNK4]        = 7,
-    [IRQ_DM355_GPIOBNK5]        = 7,
-    [IRQ_DM355_GPIOBNK6]        = 7,
-    [IRQ_COMMTX]            = 7,
-    [IRQ_COMMRX]            = 7,
-    [IRQ_EMUINT]            = 7,
+static u8 dm355_aintc_prios[] = {
+    2, 6, 6, 6, 6, 6, 6, 7,
+    6, 6, 6, 4, 4, 7, 7, 5,
+    5, 5, 5, 7, 4, 7, 7, 7,
+    7, 7, 7, 7, 7, 4, 2, 2,
+    7, 7, 7, 7, 7, 3, 3, 3,
Quoted 8 lines
Quoted 4 lines

+    3, 3, 3, 7, 4, 4, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 0, 0,
  };

Hmm... this makes it harder to see what is going on here. You can no longer see which priority corresponds to which IRQ without consulting a manual.

I agree with David here. The interrupt numbers are dynamic, but the interrupt number offset from hardware point-of-view is fixed. So can these macros be re-purposed to represent the hardware offset (eventually you would pass them to DAVINCI_INTC_IRQ())?

Thanks,
Sekhar

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#16 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

śr., 6 lut 2019 o 14:03 Sekhar Nori <[email protected]> napisał(a):

Quoted 94 lines · David Lechner
Quoted 83 lines · Bartosz Golaszewski
Quoted 10 lines

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---

...

Quoted 69 lines
arch/arm/mach-davinci/dm355.c +6 -63
-static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-    [IRQ_DM355_CCDC_VDINT0]        = 2,
-    [IRQ_DM355_CCDC_VDINT1]        = 6,
-    [IRQ_DM355_CCDC_VDINT2]        = 6,
-    [IRQ_DM355_IPIPE_HST]        = 6,
-    [IRQ_DM355_H3AINT]        = 6,
-    [IRQ_DM355_IPIPE_SDR]        = 6,
-    [IRQ_DM355_IPIPEIFINT]        = 6,
-    [IRQ_DM355_OSDINT]        = 7,
-    [IRQ_DM355_VENCINT]        = 6,
-    [IRQ_ASQINT]            = 6,
-    [IRQ_IMXINT]            = 6,
-    [IRQ_USBINT]            = 4,
-    [IRQ_DM355_RTOINT]        = 4,
-    [IRQ_DM355_UARTINT2]        = 7,
-    [IRQ_DM355_TINT6]        = 7,
-    [IRQ_CCINT0]            = 5,    /* dma */
-    [IRQ_CCERRINT]            = 5,    /* dma */
-    [IRQ_TCERRINT0]            = 5,    /* dma */
-    [IRQ_TCERRINT]            = 5,    /* dma */
-    [IRQ_DM355_SPINT2_1]        = 7,
-    [IRQ_DM355_TINT7]        = 4,
-    [IRQ_DM355_SDIOINT0]        = 7,
-    [IRQ_MBXINT]            = 7,
-    [IRQ_MBRINT]            = 7,
-    [IRQ_MMCINT]            = 7,
-    [IRQ_DM355_MMCINT1]        = 7,
-    [IRQ_DM355_PWMINT3]        = 7,
-    [IRQ_DDRINT]            = 7,
-    [IRQ_AEMIFINT]            = 7,
-    [IRQ_DM355_SDIOINT1]        = 4,
-    [IRQ_TINT0_TINT12]        = 2,    /* clockevent */
-    [IRQ_TINT0_TINT34]        = 2,    /* clocksource */
-    [IRQ_TINT1_TINT12]        = 7,    /* DSP timer */
-    [IRQ_TINT1_TINT34]        = 7,    /* system tick */
-    [IRQ_PWMINT0]            = 7,
-    [IRQ_PWMINT1]            = 7,
-    [IRQ_PWMINT2]            = 7,
-    [IRQ_I2C]            = 3,
-    [IRQ_UARTINT0]            = 3,
-    [IRQ_UARTINT1]            = 3,
-    [IRQ_DM355_SPINT0_0]        = 3,
-    [IRQ_DM355_SPINT0_1]        = 3,
-    [IRQ_DM355_GPIO0]        = 3,
-    [IRQ_DM355_GPIO1]        = 7,
-    [IRQ_DM355_GPIO2]        = 4,
-    [IRQ_DM355_GPIO3]        = 4,
-    [IRQ_DM355_GPIO4]        = 7,
-    [IRQ_DM355_GPIO5]        = 7,
-    [IRQ_DM355_GPIO6]        = 7,
-    [IRQ_DM355_GPIO7]        = 7,
-    [IRQ_DM355_GPIO8]        = 7,
-    [IRQ_DM355_GPIO9]        = 7,
-    [IRQ_DM355_GPIOBNK0]        = 7,
-    [IRQ_DM355_GPIOBNK1]        = 7,
-    [IRQ_DM355_GPIOBNK2]        = 7,
-    [IRQ_DM355_GPIOBNK3]        = 7,
-    [IRQ_DM355_GPIOBNK4]        = 7,
-    [IRQ_DM355_GPIOBNK5]        = 7,
-    [IRQ_DM355_GPIOBNK6]        = 7,
-    [IRQ_COMMTX]            = 7,
-    [IRQ_COMMRX]            = 7,
-    [IRQ_EMUINT]            = 7,
+static u8 dm355_aintc_prios[] = {
+    2, 6, 6, 6, 6, 6, 6, 7,
+    6, 6, 6, 4, 4, 7, 7, 5,
+    5, 5, 5, 7, 4, 7, 7, 7,
+    7, 7, 7, 7, 7, 4, 2, 2,
+    7, 7, 7, 7, 7, 3, 3, 3,
Quoted 8 lines

arch/arm/mach-davinci/dm355.c MUX_CFG(DM355, VIN_CINH_EN, 0, 8, 3, 3, false) · line 166

Quoted 4 lines
arch/arm/mach-davinci/dm355.c +3 -0
+    3, 3, 3, 7, 4, 4, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 0, 0,
  };

Hmm... this makes it harder to see what is going on here. You can no longer see which priority corresponds to which IRQ without consulting a manual.

Quoted 7 lines

I agree with David here. The interrupt numbers are dynamic, but the interrupt number offset from hardware point-of-view is fixed. So can these macros be re-purposed to represent the hardware offset (eventually you would pass them to DAVINCI_INTC_IRQ())?

Thanks,
Sekhar

Should we keep the mach/irqs.h header then? While working on patches for supporting the multi_v5_defconfig build I noticed the mach/* headers tend to cause build problems in certain drivers that use them. Most machines have gotten rid of them. Should we maybe create a local header in mach-davinci/?

Bart

#17 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

Quoted 100 lines · Bartosz Golaszewski

śr., 6 lut 2019 o 14:03 Sekhar Nori <[email protected]> napisał(a):

Quoted 99 lines · David Lechner
Quoted 83 lines · Bartosz Golaszewski
Quoted 10 lines

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---

...

Quoted 69 lines
arch/arm/mach-davinci/dm355.c +6 -63
-static u8 dm355_default_priorities[DAVINCI_N_AINTC_IRQ] = {
-    [IRQ_DM355_CCDC_VDINT0]        = 2,
-    [IRQ_DM355_CCDC_VDINT1]        = 6,
-    [IRQ_DM355_CCDC_VDINT2]        = 6,
-    [IRQ_DM355_IPIPE_HST]        = 6,
-    [IRQ_DM355_H3AINT]        = 6,
-    [IRQ_DM355_IPIPE_SDR]        = 6,
-    [IRQ_DM355_IPIPEIFINT]        = 6,
-    [IRQ_DM355_OSDINT]        = 7,
-    [IRQ_DM355_VENCINT]        = 6,
-    [IRQ_ASQINT]            = 6,
-    [IRQ_IMXINT]            = 6,
-    [IRQ_USBINT]            = 4,
-    [IRQ_DM355_RTOINT]        = 4,
-    [IRQ_DM355_UARTINT2]        = 7,
-    [IRQ_DM355_TINT6]        = 7,
-    [IRQ_CCINT0]            = 5,    /* dma */
-    [IRQ_CCERRINT]            = 5,    /* dma */
-    [IRQ_TCERRINT0]            = 5,    /* dma */
-    [IRQ_TCERRINT]            = 5,    /* dma */
-    [IRQ_DM355_SPINT2_1]        = 7,
-    [IRQ_DM355_TINT7]        = 4,
-    [IRQ_DM355_SDIOINT0]        = 7,
-    [IRQ_MBXINT]            = 7,
-    [IRQ_MBRINT]            = 7,
-    [IRQ_MMCINT]            = 7,
-    [IRQ_DM355_MMCINT1]        = 7,
-    [IRQ_DM355_PWMINT3]        = 7,
-    [IRQ_DDRINT]            = 7,
-    [IRQ_AEMIFINT]            = 7,
-    [IRQ_DM355_SDIOINT1]        = 4,
-    [IRQ_TINT0_TINT12]        = 2,    /* clockevent */
-    [IRQ_TINT0_TINT34]        = 2,    /* clocksource */
-    [IRQ_TINT1_TINT12]        = 7,    /* DSP timer */
-    [IRQ_TINT1_TINT34]        = 7,    /* system tick */
-    [IRQ_PWMINT0]            = 7,
-    [IRQ_PWMINT1]            = 7,
-    [IRQ_PWMINT2]            = 7,
-    [IRQ_I2C]            = 3,
-    [IRQ_UARTINT0]            = 3,
-    [IRQ_UARTINT1]            = 3,
-    [IRQ_DM355_SPINT0_0]        = 3,
-    [IRQ_DM355_SPINT0_1]        = 3,
-    [IRQ_DM355_GPIO0]        = 3,
-    [IRQ_DM355_GPIO1]        = 7,
-    [IRQ_DM355_GPIO2]        = 4,
-    [IRQ_DM355_GPIO3]        = 4,
-    [IRQ_DM355_GPIO4]        = 7,
-    [IRQ_DM355_GPIO5]        = 7,
-    [IRQ_DM355_GPIO6]        = 7,
-    [IRQ_DM355_GPIO7]        = 7,
-    [IRQ_DM355_GPIO8]        = 7,
-    [IRQ_DM355_GPIO9]        = 7,
-    [IRQ_DM355_GPIOBNK0]        = 7,
-    [IRQ_DM355_GPIOBNK1]        = 7,
-    [IRQ_DM355_GPIOBNK2]        = 7,
-    [IRQ_DM355_GPIOBNK3]        = 7,
-    [IRQ_DM355_GPIOBNK4]        = 7,
-    [IRQ_DM355_GPIOBNK5]        = 7,
-    [IRQ_DM355_GPIOBNK6]        = 7,
-    [IRQ_COMMTX]            = 7,
-    [IRQ_COMMRX]            = 7,
-    [IRQ_EMUINT]            = 7,
+static u8 dm355_aintc_prios[] = {
+    2, 6, 6, 6, 6, 6, 6, 7,
+    6, 6, 6, 4, 4, 7, 7, 5,
+    5, 5, 5, 7, 4, 7, 7, 7,
+    7, 7, 7, 7, 7, 4, 2, 2,
+    7, 7, 7, 7, 7, 3, 3, 3,
Quoted 8 lines

arch/arm/mach-davinci/dm355.c MUX_CFG(DM355, VIN_CINH_EN, 0, 8, 3, 3, false) · line 166

Quoted 4 lines
arch/arm/mach-davinci/dm355.c +3 -0
+    3, 3, 3, 7, 4, 4, 7, 7,
+    7, 7, 7, 7, 7, 7, 7, 7,
+    7, 7, 7, 7, 7, 7, 0, 0,
  };

Hmm... this makes it harder to see what is going on here. You can no longer see which priority corresponds to which IRQ without consulting a manual.

I agree with David here. The interrupt numbers are dynamic, but the interrupt number offset from hardware point-of-view is fixed. So can these macros be re-purposed to represent the hardware offset (eventually you would pass them to DAVINCI_INTC_IRQ())?

Quoted 8 lines
Quoted 2 lines

Thanks,
Sekhar

Should we keep the mach/irqs.h header then? While working on patches for supporting the multi_v5_defconfig build I noticed the mach/* headers tend to cause build problems in certain drivers that use them. Most machines have gotten rid of them. Should we maybe create a local header in mach-davinci/?

Yes, we should have a local header in mach-davinci. It should not be in include/mach/ so it should not be exposed to drivers.

Thanks,
Sekhar

#18 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

In reply to Bartosz Golaszewski
Quoted 123 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---
  arch/arm/mach-davinci/da830.c  | 107 ++++--------------------------
  arch/arm/mach-davinci/da850.c  | 118 +++++----------------------------
  arch/arm/mach-davinci/dm355.c  |  74 +++------------------
  arch/arm/mach-davinci/dm365.c  |  76 +++------------------
  arch/arm/mach-davinci/dm644x.c |  76 +++------------------
  arch/arm/mach-davinci/dm646x.c |  76 +++------------------
  6 files changed, 69 insertions(+), 458 deletions(-)
arch/arm/mach-davinci/da830.c +5 -92
index 9e18b245266b..f1e7b6c644e5 100644
@@ -624,98 +624,19 @@ const short da830_eqep1_pins[] __initconst = {
  };
 
  /* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
-static u8 da830_default_priorities[DA830_N_CP_INTC_IRQ] = {
-	[IRQ_DA8XX_COMMTX]		= 7,
-	[IRQ_DA8XX_COMMRX]		= 7,
-	[IRQ_DA8XX_NINT]		= 7,
-	[IRQ_DA8XX_EVTOUT0]		= 7,
-	[IRQ_DA8XX_EVTOUT1]		= 7,
-	[IRQ_DA8XX_EVTOUT2]		= 7,
-	[IRQ_DA8XX_EVTOUT3]		= 7,
-	[IRQ_DA8XX_EVTOUT4]		= 7,
-	[IRQ_DA8XX_EVTOUT5]		= 7,
-	[IRQ_DA8XX_EVTOUT6]		= 7,
-	[IRQ_DA8XX_EVTOUT7]		= 7,
-	[IRQ_DA8XX_CCINT0]		= 7,
-	[IRQ_DA8XX_CCERRINT]		= 7,
-	[IRQ_DA8XX_TCERRINT0]		= 7,
-	[IRQ_DA8XX_AEMIFINT]		= 7,
-	[IRQ_DA8XX_I2CINT0]		= 7,
-	[IRQ_DA8XX_MMCSDINT0]		= 7,
-	[IRQ_DA8XX_MMCSDINT1]		= 7,
-	[IRQ_DA8XX_ALLINT0]		= 7,
-	[IRQ_DA8XX_RTC]			= 7,
-	[IRQ_DA8XX_SPINT0]		= 7,
-	[IRQ_DA8XX_TINT12_0]		= 7,
-	[IRQ_DA8XX_TINT34_0]		= 7,
-	[IRQ_DA8XX_TINT12_1]		= 7,
-	[IRQ_DA8XX_TINT34_1]		= 7,
-	[IRQ_DA8XX_UARTINT0]		= 7,
-	[IRQ_DA8XX_KEYMGRINT]		= 7,
-	[IRQ_DA830_MPUERR]		= 7,
-	[IRQ_DA8XX_CHIPINT0]		= 7,
-	[IRQ_DA8XX_CHIPINT1]		= 7,
-	[IRQ_DA8XX_CHIPINT2]		= 7,
-	[IRQ_DA8XX_CHIPINT3]		= 7,
-	[IRQ_DA8XX_TCERRINT1]		= 7,
-	[IRQ_DA8XX_C0_RX_THRESH_PULSE]	= 7,
-	[IRQ_DA8XX_C0_RX_PULSE]		= 7,
-	[IRQ_DA8XX_C0_TX_PULSE]		= 7,
-	[IRQ_DA8XX_C0_MISC_PULSE]	= 7,
-	[IRQ_DA8XX_C1_RX_THRESH_PULSE]	= 7,
-	[IRQ_DA8XX_C1_RX_PULSE]		= 7,
-	[IRQ_DA8XX_C1_TX_PULSE]		= 7,
-	[IRQ_DA8XX_C1_MISC_PULSE]	= 7,
-	[IRQ_DA8XX_MEMERR]		= 7,
-	[IRQ_DA8XX_GPIO0]		= 7,
-	[IRQ_DA8XX_GPIO1]		= 7,
-	[IRQ_DA8XX_GPIO2]		= 7,
-	[IRQ_DA8XX_GPIO3]		= 7,
-	[IRQ_DA8XX_GPIO4]		= 7,
-	[IRQ_DA8XX_GPIO5]		= 7,
-	[IRQ_DA8XX_GPIO6]		= 7,
-	[IRQ_DA8XX_GPIO7]		= 7,
-	[IRQ_DA8XX_GPIO8]		= 7,
-	[IRQ_DA8XX_I2CINT1]		= 7,
-	[IRQ_DA8XX_LCDINT]		= 7,
-	[IRQ_DA8XX_UARTINT1]		= 7,
-	[IRQ_DA8XX_MCASPINT]		= 7,
-	[IRQ_DA8XX_ALLINT1]		= 7,
-	[IRQ_DA8XX_SPINT1]		= 7,
-	[IRQ_DA8XX_UHPI_INT1]		= 7,
-	[IRQ_DA8XX_USB_INT]		= 7,
-	[IRQ_DA8XX_IRQN]		= 7,
-	[IRQ_DA8XX_RWAKEUP]		= 7,
-	[IRQ_DA8XX_UARTINT2]		= 7,
-	[IRQ_DA8XX_DFTSSINT]		= 7,
-	[IRQ_DA8XX_EHRPWM0]		= 7,
-	[IRQ_DA8XX_EHRPWM0TZ]		= 7,
-	[IRQ_DA8XX_EHRPWM1]		= 7,
-	[IRQ_DA8XX_EHRPWM1TZ]		= 7,
-	[IRQ_DA830_EHRPWM2]		= 7,
-	[IRQ_DA830_EHRPWM2TZ]		= 7,
-	[IRQ_DA8XX_ECAP0]		= 7,
-	[IRQ_DA8XX_ECAP1]		= 7,
-	[IRQ_DA8XX_ECAP2]		= 7,
-	[IRQ_DA830_EQEP0]		= 7,
-	[IRQ_DA830_EQEP1]		= 7,
-	[IRQ_DA830_T12CMPINT0_0]	= 7,
-	[IRQ_DA830_T12CMPINT1_0]	= 7,
-	[IRQ_DA830_T12CMPINT2_0]	= 7,
-	[IRQ_DA830_T12CMPINT3_0]	= 7,
-	[IRQ_DA830_T12CMPINT4_0]	= 7,
-	[IRQ_DA830_T12CMPINT5_0]	= 7,
-	[IRQ_DA830_T12CMPINT6_0]	= 7,
-	[IRQ_DA830_T12CMPINT7_0]	= 7,
-	[IRQ_DA830_T12CMPINT0_1]	= 7,
-	[IRQ_DA830_T12CMPINT1_1]	= 7,
-	[IRQ_DA830_T12CMPINT2_1]	= 7,
-	[IRQ_DA830_T12CMPINT3_1]	= 7,
-	[IRQ_DA830_T12CMPINT4_1]	= 7,
-	[IRQ_DA830_T12CMPINT5_1]	= 7,
-	[IRQ_DA830_T12CMPINT6_1]	= 7,
-	[IRQ_DA830_T12CMPINT7_1]	= 7,
-	[IRQ_DA8XX_ARMCLKSTOPREQ]	= 7,
+static u8 da830_cp_intc_prios[] = {
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,

arch/arm/mach-davinci/da830.c const short da830_eqep1_pins[] __initconst = { · line 641

Quoted 10 lines
arch/arm/mach-davinci/da830.c +8 -0
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
+	7, 7, 7, 7, 7, 7, 7, 7,
  };
 

Technically, any holes in the array that are being deleted here have a default priority of 15 assigned in the cp_intc driver instead of 7. I don't think this is a problem, but it might be worth mentioning in the commit message. Same goes for DA850.

#19 lore raw

Re: [PATCH 05/35] ARM: davinci: drop irq defines from default_priorites

wt., 5 lut 2019 o 01:20 David Lechner <[email protected]> napisał(a):

Quoted 12 lines · Bartosz Golaszewski
Quoted 10 lines

From: Bartosz Golaszewski <[email protected]>

In order to select SPARSE_IRQ we need to make the interrupt numbers dynamic (at least at build-time for the top-level controller). The interrupt numbers are used as array indexes for irq priorities.

Drop the defines and just initialize the arrays in a linear manner.

---

[snip!]

Quoted 8 lines
Quoted 1 line

Technically, any holes in the array that are being deleted here have a default priority of 15 assigned in the cp_intc driver instead of 7. I don't think this is a problem, but it might be worth mentioning in the commit message. Same goes for DA850.

Actually the defaulting is only done if no priorities have been defined at all. I'll double check though if there are no holes here.

Bart

#20 lore raw

PATCH 6/35 ARM: davinci: wrap interrupt definitions with a macro for SPARSE_IRQ

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This is done in preparation for selecting CONFIG_SPARSE_IRQ. The interrupt numbers will then start at the predefined NR_IRQS offset.

For now wrap all interrupt numbers with a macro and define DAVINCI_INTC_START to 0. Logically nothing changes for now.

---
 arch/arm/mach-davinci/include/mach/irqs.h | 689 +++++++++++-----------
 1 file changed, 346 insertions(+), 343 deletions(-)
arch/arm/mach-davinci/include/mach/irqs.h +346 -343
index 03c446635301..14fa668d4e8d 100644
@@ -30,371 +30,374 @@
 /* Base address */
 #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
+#define DAVINCI_INTC_START		0
+#define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
+
 /* Interrupt lines */
-#define IRQ_VDINT0       0
-#define IRQ_VDINT1       1
-#define IRQ_VDINT2       2
-#define IRQ_HISTINT      3
-#define IRQ_H3AINT       4
-#define IRQ_PRVUINT      5
-#define IRQ_RSZINT       6
-#define IRQ_VFOCINT      7
-#define IRQ_VENCINT      8
-#define IRQ_ASQINT       9
-#define IRQ_IMXINT       10
-#define IRQ_VLCDINT      11
-#define IRQ_USBINT       12
-#define IRQ_EMACINT      13
+#define IRQ_VDINT0       DAVINCI_INTC_IRQ(0)
+#define IRQ_VDINT1       DAVINCI_INTC_IRQ(1)
+#define IRQ_VDINT2       DAVINCI_INTC_IRQ(2)
+#define IRQ_HISTINT      DAVINCI_INTC_IRQ(3)
+#define IRQ_H3AINT       DAVINCI_INTC_IRQ(4)
+#define IRQ_PRVUINT      DAVINCI_INTC_IRQ(5)
+#define IRQ_RSZINT       DAVINCI_INTC_IRQ(6)
+#define IRQ_VFOCINT      DAVINCI_INTC_IRQ(7)
+#define IRQ_VENCINT      DAVINCI_INTC_IRQ(8)
+#define IRQ_ASQINT       DAVINCI_INTC_IRQ(9)
+#define IRQ_IMXINT       DAVINCI_INTC_IRQ(10)
+#define IRQ_VLCDINT      DAVINCI_INTC_IRQ(11)
+#define IRQ_USBINT       DAVINCI_INTC_IRQ(12)
+#define IRQ_EMACINT      DAVINCI_INTC_IRQ(13)
 
-#define IRQ_CCINT0       16
-#define IRQ_CCERRINT     17
-#define IRQ_TCERRINT0    18
-#define IRQ_TCERRINT     19
-#define IRQ_PSCIN        20
+#define IRQ_CCINT0       DAVINCI_INTC_IRQ(16)
+#define IRQ_CCERRINT     DAVINCI_INTC_IRQ(17)
+#define IRQ_TCERRINT0    DAVINCI_INTC_IRQ(18)
+#define IRQ_TCERRINT     DAVINCI_INTC_IRQ(19)
+#define IRQ_PSCIN        DAVINCI_INTC_IRQ(20)
 
-#define IRQ_IDE          22
-#define IRQ_HPIINT       23
-#define IRQ_MBXINT       24
-#define IRQ_MBRINT       25
-#define IRQ_MMCINT       26
-#define IRQ_SDIOINT      27
-#define IRQ_MSINT        28
-#define IRQ_DDRINT       29
-#define IRQ_AEMIFINT     30
-#define IRQ_VLQINT       31
-#define IRQ_TINT0_TINT12 32
-#define IRQ_TINT0_TINT34 33
-#define IRQ_TINT1_TINT12 34
-#define IRQ_TINT1_TINT34 35
-#define IRQ_PWMINT0      36
-#define IRQ_PWMINT1      37
-#define IRQ_PWMINT2      38
-#define IRQ_I2C          39
-#define IRQ_UARTINT0     40
-#define IRQ_UARTINT1     41
-#define IRQ_UARTINT2     42
-#define IRQ_SPINT0       43
-#define IRQ_SPINT1       44
+#define IRQ_IDE          DAVINCI_INTC_IRQ(22)
+#define IRQ_HPIINT       DAVINCI_INTC_IRQ(23)
+#define IRQ_MBXINT       DAVINCI_INTC_IRQ(24)
+#define IRQ_MBRINT       DAVINCI_INTC_IRQ(25)
+#define IRQ_MMCINT       DAVINCI_INTC_IRQ(26)
+#define IRQ_SDIOINT      DAVINCI_INTC_IRQ(27)
+#define IRQ_MSINT        DAVINCI_INTC_IRQ(28)
+#define IRQ_DDRINT       DAVINCI_INTC_IRQ(29)
+#define IRQ_AEMIFINT     DAVINCI_INTC_IRQ(30)
+#define IRQ_VLQINT       DAVINCI_INTC_IRQ(31)
+#define IRQ_TINT0_TINT12 DAVINCI_INTC_IRQ(32)
+#define IRQ_TINT0_TINT34 DAVINCI_INTC_IRQ(33)
+#define IRQ_TINT1_TINT12 DAVINCI_INTC_IRQ(34)
+#define IRQ_TINT1_TINT34 DAVINCI_INTC_IRQ(35)
+#define IRQ_PWMINT0      DAVINCI_INTC_IRQ(36)
+#define IRQ_PWMINT1      DAVINCI_INTC_IRQ(37)
+#define IRQ_PWMINT2      DAVINCI_INTC_IRQ(38)
+#define IRQ_I2C          DAVINCI_INTC_IRQ(39)
+#define IRQ_UARTINT0     DAVINCI_INTC_IRQ(40)
+#define IRQ_UARTINT1     DAVINCI_INTC_IRQ(41)
+#define IRQ_UARTINT2     DAVINCI_INTC_IRQ(42)
+#define IRQ_SPINT0       DAVINCI_INTC_IRQ(43)
+#define IRQ_SPINT1       DAVINCI_INTC_IRQ(44)
 
-#define IRQ_DSP2ARM0     46
-#define IRQ_DSP2ARM1     47
-#define IRQ_GPIO0        48
-#define IRQ_GPIO1        49
-#define IRQ_GPIO2        50
-#define IRQ_GPIO3        51
-#define IRQ_GPIO4        52
-#define IRQ_GPIO5        53
-#define IRQ_GPIO6        54
-#define IRQ_GPIO7        55
-#define IRQ_GPIOBNK0     56
-#define IRQ_GPIOBNK1     57
-#define IRQ_GPIOBNK2     58
-#define IRQ_GPIOBNK3     59
-#define IRQ_GPIOBNK4     60
-#define IRQ_COMMTX       61
-#define IRQ_COMMRX       62
-#define IRQ_EMUINT       63
+#define IRQ_DSP2ARM0     DAVINCI_INTC_IRQ(46)
+#define IRQ_DSP2ARM1     DAVINCI_INTC_IRQ(47)
+#define IRQ_GPIO0        DAVINCI_INTC_IRQ(48)
+#define IRQ_GPIO1        DAVINCI_INTC_IRQ(49)
+#define IRQ_GPIO2        DAVINCI_INTC_IRQ(50)
+#define IRQ_GPIO3        DAVINCI_INTC_IRQ(51)
+#define IRQ_GPIO4        DAVINCI_INTC_IRQ(52)
+#define IRQ_GPIO5        DAVINCI_INTC_IRQ(53)
+#define IRQ_GPIO6        DAVINCI_INTC_IRQ(54)
+#define IRQ_GPIO7        DAVINCI_INTC_IRQ(55)
+#define IRQ_GPIOBNK0     DAVINCI_INTC_IRQ(56)
+#define IRQ_GPIOBNK1     DAVINCI_INTC_IRQ(57)
+#define IRQ_GPIOBNK2     DAVINCI_INTC_IRQ(58)
+#define IRQ_GPIOBNK3     DAVINCI_INTC_IRQ(59)
+#define IRQ_GPIOBNK4     DAVINCI_INTC_IRQ(60)
+#define IRQ_COMMTX       DAVINCI_INTC_IRQ(61)
+#define IRQ_COMMRX       DAVINCI_INTC_IRQ(62)
+#define IRQ_EMUINT       DAVINCI_INTC_IRQ(63)
 
 #define DAVINCI_N_AINTC_IRQ	64
 
 #define ARCH_TIMER_IRQ IRQ_TINT1_TINT34
 
 /* DaVinci DM6467-specific Interrupts */
-#define IRQ_DM646X_VP_VERTINT0  0
-#define IRQ_DM646X_VP_VERTINT1  1
-#define IRQ_DM646X_VP_VERTINT2  2
-#define IRQ_DM646X_VP_VERTINT3  3
-#define IRQ_DM646X_VP_ERRINT    4
-#define IRQ_DM646X_RESERVED_1   5
-#define IRQ_DM646X_RESERVED_2   6
-#define IRQ_DM646X_WDINT        7
-#define IRQ_DM646X_CRGENINT0    8
-#define IRQ_DM646X_CRGENINT1    9
-#define IRQ_DM646X_TSIFINT0     10
-#define IRQ_DM646X_TSIFINT1     11
-#define IRQ_DM646X_VDCEINT      12
-#define IRQ_DM646X_USBINT       13
-#define IRQ_DM646X_USBDMAINT    14
-#define IRQ_DM646X_PCIINT       15
-#define IRQ_DM646X_TCERRINT2    20
-#define IRQ_DM646X_TCERRINT3    21
-#define IRQ_DM646X_IDE          22
-#define IRQ_DM646X_HPIINT       23
-#define IRQ_DM646X_EMACRXTHINT  24
-#define IRQ_DM646X_EMACRXINT    25
-#define IRQ_DM646X_EMACTXINT    26
-#define IRQ_DM646X_EMACMISCINT  27
-#define IRQ_DM646X_MCASP0TXINT  28
-#define IRQ_DM646X_MCASP0RXINT  29
-#define IRQ_DM646X_MCASP1TXINT  30
-#define IRQ_DM646X_RESERVED_3   31
-#define IRQ_DM646X_VLQINT       38
-#define IRQ_DM646X_UARTINT2     42
-#define IRQ_DM646X_SPINT0       43
-#define IRQ_DM646X_SPINT1       44
-#define IRQ_DM646X_DSP2ARMINT   45
-#define IRQ_DM646X_RESERVED_4   46
-#define IRQ_DM646X_PSCINT       47
-#define IRQ_DM646X_GPIO0        48
-#define IRQ_DM646X_GPIO1        49
-#define IRQ_DM646X_GPIO2        50
-#define IRQ_DM646X_GPIO3        51
-#define IRQ_DM646X_GPIO4        52
-#define IRQ_DM646X_GPIO5        53
-#define IRQ_DM646X_GPIO6        54
-#define IRQ_DM646X_GPIO7        55
-#define IRQ_DM646X_GPIOBNK0     56
-#define IRQ_DM646X_GPIOBNK1     57
-#define IRQ_DM646X_GPIOBNK2     58
-#define IRQ_DM646X_DDRINT       59
-#define IRQ_DM646X_AEMIFINT     60
+#define IRQ_DM646X_VP_VERTINT0  DAVINCI_INTC_IRQ(0)
+#define IRQ_DM646X_VP_VERTINT1  DAVINCI_INTC_IRQ(1)
+#define IRQ_DM646X_VP_VERTINT2  DAVINCI_INTC_IRQ(2)
+#define IRQ_DM646X_VP_VERTINT3  DAVINCI_INTC_IRQ(3)
+#define IRQ_DM646X_VP_ERRINT    DAVINCI_INTC_IRQ(4)
+#define IRQ_DM646X_RESERVED_1   DAVINCI_INTC_IRQ(5)
+#define IRQ_DM646X_RESERVED_2   DAVINCI_INTC_IRQ(6)
+#define IRQ_DM646X_WDINT        DAVINCI_INTC_IRQ(7)
+#define IRQ_DM646X_CRGENINT0    DAVINCI_INTC_IRQ(8)
+#define IRQ_DM646X_CRGENINT1    DAVINCI_INTC_IRQ(9)
+#define IRQ_DM646X_TSIFINT0     DAVINCI_INTC_IRQ(10)
+#define IRQ_DM646X_TSIFINT1     DAVINCI_INTC_IRQ(11)
+#define IRQ_DM646X_VDCEINT      DAVINCI_INTC_IRQ(12)
+#define IRQ_DM646X_USBINT       DAVINCI_INTC_IRQ(13)
+#define IRQ_DM646X_USBDMAINT    DAVINCI_INTC_IRQ(14)
+#define IRQ_DM646X_PCIINT       DAVINCI_INTC_IRQ(15)
+#define IRQ_DM646X_TCERRINT2    DAVINCI_INTC_IRQ(20)
+#define IRQ_DM646X_TCERRINT3    DAVINCI_INTC_IRQ(21)
+#define IRQ_DM646X_IDE          DAVINCI_INTC_IRQ(22)
+#define IRQ_DM646X_HPIINT       DAVINCI_INTC_IRQ(23)
+#define IRQ_DM646X_EMACRXTHINT  DAVINCI_INTC_IRQ(24)
+#define IRQ_DM646X_EMACRXINT    DAVINCI_INTC_IRQ(25)
+#define IRQ_DM646X_EMACTXINT    DAVINCI_INTC_IRQ(26)
+#define IRQ_DM646X_EMACMISCINT  DAVINCI_INTC_IRQ(27)
+#define IRQ_DM646X_MCASP0TXINT  DAVINCI_INTC_IRQ(28)
+#define IRQ_DM646X_MCASP0RXINT  DAVINCI_INTC_IRQ(29)
+#define IRQ_DM646X_MCASP1TXINT  DAVINCI_INTC_IRQ(30)
+#define IRQ_DM646X_RESERVED_3   DAVINCI_INTC_IRQ(31)
+#define IRQ_DM646X_VLQINT       DAVINCI_INTC_IRQ(38)
+#define IRQ_DM646X_UARTINT2     DAVINCI_INTC_IRQ(42)
+#define IRQ_DM646X_SPINT0       DAVINCI_INTC_IRQ(43)
+#define IRQ_DM646X_SPINT1       DAVINCI_INTC_IRQ(44)
+#define IRQ_DM646X_DSP2ARMINT   DAVINCI_INTC_IRQ(45)
+#define IRQ_DM646X_RESERVED_4   DAVINCI_INTC_IRQ(46)
+#define IRQ_DM646X_PSCINT       DAVINCI_INTC_IRQ(47)
+#define IRQ_DM646X_GPIO0        DAVINCI_INTC_IRQ(48)
+#define IRQ_DM646X_GPIO1        DAVINCI_INTC_IRQ(49)
+#define IRQ_DM646X_GPIO2        DAVINCI_INTC_IRQ(50)
+#define IRQ_DM646X_GPIO3        DAVINCI_INTC_IRQ(51)
+#define IRQ_DM646X_GPIO4        DAVINCI_INTC_IRQ(52)
+#define IRQ_DM646X_GPIO5        DAVINCI_INTC_IRQ(53)
+#define IRQ_DM646X_GPIO6        DAVINCI_INTC_IRQ(54)
+#define IRQ_DM646X_GPIO7        DAVINCI_INTC_IRQ(55)
+#define IRQ_DM646X_GPIOBNK0     DAVINCI_INTC_IRQ(56)
+#define IRQ_DM646X_GPIOBNK1     DAVINCI_INTC_IRQ(57)
+#define IRQ_DM646X_GPIOBNK2     DAVINCI_INTC_IRQ(58)
+#define IRQ_DM646X_DDRINT       DAVINCI_INTC_IRQ(59)
+#define IRQ_DM646X_AEMIFINT     DAVINCI_INTC_IRQ(60)
 
 /* DaVinci DM355-specific Interrupts */
-#define IRQ_DM355_CCDC_VDINT0	0
-#define IRQ_DM355_CCDC_VDINT1	1
-#define IRQ_DM355_CCDC_VDINT2	2
-#define IRQ_DM355_IPIPE_HST	3
-#define IRQ_DM355_H3AINT	4
-#define IRQ_DM355_IPIPE_SDR	5
-#define IRQ_DM355_IPIPEIFINT	6
-#define IRQ_DM355_OSDINT	7
-#define IRQ_DM355_VENCINT	8
-#define IRQ_DM355_IMCOPINT	11
-#define IRQ_DM355_RTOINT	13
-#define IRQ_DM355_TINT4		13
-#define IRQ_DM355_TINT2_TINT12	13
-#define IRQ_DM355_UARTINT2	14
-#define IRQ_DM355_TINT5		14
-#define IRQ_DM355_TINT2_TINT34	14
-#define IRQ_DM355_TINT6		15
-#define IRQ_DM355_TINT3_TINT12	15
-#define IRQ_DM355_SPINT1_0	17
-#define IRQ_DM355_SPINT1_1	18
-#define IRQ_DM355_SPINT2_0	19
-#define IRQ_DM355_SPINT2_1	21
-#define IRQ_DM355_TINT7		22
-#define IRQ_DM355_TINT3_TINT34	22
-#define IRQ_DM355_SDIOINT0	23
-#define IRQ_DM355_MMCINT0	26
-#define IRQ_DM355_MSINT		26
-#define IRQ_DM355_MMCINT1	27
-#define IRQ_DM355_PWMINT3	28
-#define IRQ_DM355_SDIOINT1	31
-#define IRQ_DM355_SPINT0_0	42
-#define IRQ_DM355_SPINT0_1	43
-#define IRQ_DM355_GPIO0		44
-#define IRQ_DM355_GPIO1		45
-#define IRQ_DM355_GPIO2		46
-#define IRQ_DM355_GPIO3		47
-#define IRQ_DM355_GPIO4		48
-#define IRQ_DM355_GPIO5		49
-#define IRQ_DM355_GPIO6		50
-#define IRQ_DM355_GPIO7		51
-#define IRQ_DM355_GPIO8		52
-#define IRQ_DM355_GPIO9		53
-#define IRQ_DM355_GPIOBNK0	54
-#define IRQ_DM355_GPIOBNK1	55
-#define IRQ_DM355_GPIOBNK2	56
-#define IRQ_DM355_GPIOBNK3	57
-#define IRQ_DM355_GPIOBNK4	58
-#define IRQ_DM355_GPIOBNK5	59
-#define IRQ_DM355_GPIOBNK6	60
+#define IRQ_DM355_CCDC_VDINT0	DAVINCI_INTC_IRQ(0)
+#define IRQ_DM355_CCDC_VDINT1	DAVINCI_INTC_IRQ(1)
+#define IRQ_DM355_CCDC_VDINT2	DAVINCI_INTC_IRQ(2)
+#define IRQ_DM355_IPIPE_HST	DAVINCI_INTC_IRQ(3)
+#define IRQ_DM355_H3AINT	DAVINCI_INTC_IRQ(4)
+#define IRQ_DM355_IPIPE_SDR	DAVINCI_INTC_IRQ(5)
+#define IRQ_DM355_IPIPEIFINT	DAVINCI_INTC_IRQ(6)
+#define IRQ_DM355_OSDINT	DAVINCI_INTC_IRQ(7)
+#define IRQ_DM355_VENCINT	DAVINCI_INTC_IRQ(8)
+#define IRQ_DM355_IMCOPINT	DAVINCI_INTC_IRQ(11)
+#define IRQ_DM355_RTOINT	DAVINCI_INTC_IRQ(13)
+#define IRQ_DM355_TINT4		DAVINCI_INTC_IRQ(13)
+#define IRQ_DM355_TINT2_TINT12	DAVINCI_INTC_IRQ(13)
+#define IRQ_DM355_UARTINT2	DAVINCI_INTC_IRQ(14)
+#define IRQ_DM355_TINT5		DAVINCI_INTC_IRQ(14)
+#define IRQ_DM355_TINT2_TINT34	DAVINCI_INTC_IRQ(14)
+#define IRQ_DM355_TINT6		DAVINCI_INTC_IRQ(15)
+#define IRQ_DM355_TINT3_TINT12	DAVINCI_INTC_IRQ(15)
+#define IRQ_DM355_SPINT1_0	DAVINCI_INTC_IRQ(17)
+#define IRQ_DM355_SPINT1_1	DAVINCI_INTC_IRQ(18)
+#define IRQ_DM355_SPINT2_0	DAVINCI_INTC_IRQ(19)
+#define IRQ_DM355_SPINT2_1	DAVINCI_INTC_IRQ(21)
+#define IRQ_DM355_TINT7		DAVINCI_INTC_IRQ(22)
+#define IRQ_DM355_TINT3_TINT34	DAVINCI_INTC_IRQ(22)
+#define IRQ_DM355_SDIOINT0	DAVINCI_INTC_IRQ(23)
+#define IRQ_DM355_MMCINT0	DAVINCI_INTC_IRQ(26)
+#define IRQ_DM355_MSINT		DAVINCI_INTC_IRQ(26)
+#define IRQ_DM355_MMCINT1	DAVINCI_INTC_IRQ(27)
+#define IRQ_DM355_PWMINT3	DAVINCI_INTC_IRQ(28)
+#define IRQ_DM355_SDIOINT1	DAVINCI_INTC_IRQ(31)
+#define IRQ_DM355_SPINT0_0	DAVINCI_INTC_IRQ(42)
+#define IRQ_DM355_SPINT0_1	DAVINCI_INTC_IRQ(43)
+#define IRQ_DM355_GPIO0		DAVINCI_INTC_IRQ(44)
+#define IRQ_DM355_GPIO1		DAVINCI_INTC_IRQ(45)
+#define IRQ_DM355_GPIO2		DAVINCI_INTC_IRQ(46)
+#define IRQ_DM355_GPIO3		DAVINCI_INTC_IRQ(47)
+#define IRQ_DM355_GPIO4		DAVINCI_INTC_IRQ(48)
+#define IRQ_DM355_GPIO5		DAVINCI_INTC_IRQ(49)
+#define IRQ_DM355_GPIO6		DAVINCI_INTC_IRQ(50)
+#define IRQ_DM355_GPIO7		DAVINCI_INTC_IRQ(51)
+#define IRQ_DM355_GPIO8		DAVINCI_INTC_IRQ(52)
+#define IRQ_DM355_GPIO9		DAVINCI_INTC_IRQ(53)
+#define IRQ_DM355_GPIOBNK0	DAVINCI_INTC_IRQ(54)
+#define IRQ_DM355_GPIOBNK1	DAVINCI_INTC_IRQ(55)
+#define IRQ_DM355_GPIOBNK2	DAVINCI_INTC_IRQ(56)
+#define IRQ_DM355_GPIOBNK3	DAVINCI_INTC_IRQ(57)
+#define IRQ_DM355_GPIOBNK4	DAVINCI_INTC_IRQ(58)
+#define IRQ_DM355_GPIOBNK5	DAVINCI_INTC_IRQ(59)
+#define IRQ_DM355_GPIOBNK6	DAVINCI_INTC_IRQ(60)
 
 /* DaVinci DM365-specific Interrupts */
-#define IRQ_DM365_INSFINT	7
-#define IRQ_DM365_IMXINT1	8
-#define IRQ_DM365_IMXINT0	10
-#define IRQ_DM365_KLD_ARMINT	10
-#define IRQ_DM365_IMCOPINT	11
-#define IRQ_DM365_RTOINT	13
-#define IRQ_DM365_TINT5		14
-#define IRQ_DM365_TINT6		15
-#define IRQ_DM365_SPINT2_1	21
-#define IRQ_DM365_TINT7		22
-#define IRQ_DM365_SDIOINT0	23
-#define IRQ_DM365_MMCINT1	27
-#define IRQ_DM365_PWMINT3	28
-#define IRQ_DM365_RTCINT	29
-#define IRQ_DM365_SDIOINT1	31
-#define IRQ_DM365_SPIINT0_0	42
-#define IRQ_DM365_SPIINT3_0	43
-#define IRQ_DM365_GPIO0		44
-#define IRQ_DM365_GPIO1		45
-#define IRQ_DM365_GPIO2		46
-#define IRQ_DM365_GPIO3		47
-#define IRQ_DM365_GPIO4		48
-#define IRQ_DM365_GPIO5		49
-#define IRQ_DM365_GPIO6		50
-#define IRQ_DM365_GPIO7		51
-#define IRQ_DM365_EMAC_RXTHRESH	52
-#define IRQ_DM365_EMAC_RXPULSE	53
-#define IRQ_DM365_EMAC_TXPULSE	54
-#define IRQ_DM365_EMAC_MISCPULSE 55
-#define IRQ_DM365_GPIO12	56
-#define IRQ_DM365_GPIO13	57
-#define IRQ_DM365_GPIO14	58
-#define IRQ_DM365_GPIO15	59
-#define IRQ_DM365_ADCINT	59
-#define IRQ_DM365_KEYINT	60
-#define IRQ_DM365_TCERRINT2	61
-#define IRQ_DM365_TCERRINT3	62
-#define IRQ_DM365_EMUINT	63
+#define IRQ_DM365_INSFINT	DAVINCI_INTC_IRQ(7)
+#define IRQ_DM365_IMXINT1	DAVINCI_INTC_IRQ(8)
+#define IRQ_DM365_IMXINT0	DAVINCI_INTC_IRQ(10)
+#define IRQ_DM365_KLD_ARMINT	DAVINCI_INTC_IRQ(10)
+#define IRQ_DM365_IMCOPINT	DAVINCI_INTC_IRQ(11)
+#define IRQ_DM365_RTOINT	DAVINCI_INTC_IRQ(13)
+#define IRQ_DM365_TINT5		DAVINCI_INTC_IRQ(14)
+#define IRQ_DM365_TINT6		DAVINCI_INTC_IRQ(15)
+#define IRQ_DM365_SPINT2_1	DAVINCI_INTC_IRQ(21)
+#define IRQ_DM365_TINT7		DAVINCI_INTC_IRQ(22)
+#define IRQ_DM365_SDIOINT0	DAVINCI_INTC_IRQ(23)
+#define IRQ_DM365_MMCINT1	DAVINCI_INTC_IRQ(27)
+#define IRQ_DM365_PWMINT3	DAVINCI_INTC_IRQ(28)
+#define IRQ_DM365_RTCINT	DAVINCI_INTC_IRQ(29)
+#define IRQ_DM365_SDIOINT1	DAVINCI_INTC_IRQ(31)
+#define IRQ_DM365_SPIINT0_0	DAVINCI_INTC_IRQ(42)
+#define IRQ_DM365_SPIINT3_0	DAVINCI_INTC_IRQ(43)
+#define IRQ_DM365_GPIO0		DAVINCI_INTC_IRQ(44)
+#define IRQ_DM365_GPIO1		DAVINCI_INTC_IRQ(45)
+#define IRQ_DM365_GPIO2		DAVINCI_INTC_IRQ(46)
+#define IRQ_DM365_GPIO3		DAVINCI_INTC_IRQ(47)
+#define IRQ_DM365_GPIO4		DAVINCI_INTC_IRQ(48)
+#define IRQ_DM365_GPIO5		DAVINCI_INTC_IRQ(49)
+#define IRQ_DM365_GPIO6		DAVINCI_INTC_IRQ(50)
+#define IRQ_DM365_GPIO7		DAVINCI_INTC_IRQ(51)
+#define IRQ_DM365_EMAC_RXTHRESH	DAVINCI_INTC_IRQ(52)
+#define IRQ_DM365_EMAC_RXPULSE	DAVINCI_INTC_IRQ(53)
+#define IRQ_DM365_EMAC_TXPULSE	DAVINCI_INTC_IRQ(54)
+#define IRQ_DM365_EMAC_MISCPULSE DAVINCI_INTC_IRQ(55)
+#define IRQ_DM365_GPIO12	DAVINCI_INTC_IRQ(56)
+#define IRQ_DM365_GPIO13	DAVINCI_INTC_IRQ(57)
+#define IRQ_DM365_GPIO14	DAVINCI_INTC_IRQ(58)
+#define IRQ_DM365_GPIO15	DAVINCI_INTC_IRQ(59)
+#define IRQ_DM365_ADCINT	DAVINCI_INTC_IRQ(59)
+#define IRQ_DM365_KEYINT	DAVINCI_INTC_IRQ(60)
+#define IRQ_DM365_TCERRINT2	DAVINCI_INTC_IRQ(61)
+#define IRQ_DM365_TCERRINT3	DAVINCI_INTC_IRQ(62)
+#define IRQ_DM365_EMUINT	DAVINCI_INTC_IRQ(63)
 
 /* DA8XX interrupts */
-#define IRQ_DA8XX_COMMTX		0
-#define IRQ_DA8XX_COMMRX		1
-#define IRQ_DA8XX_NINT			2
-#define IRQ_DA8XX_EVTOUT0		3
-#define IRQ_DA8XX_EVTOUT1		4
-#define IRQ_DA8XX_EVTOUT2		5
-#define IRQ_DA8XX_EVTOUT3		6
-#define IRQ_DA8XX_EVTOUT4		7
-#define IRQ_DA8XX_EVTOUT5		8
-#define IRQ_DA8XX_EVTOUT6		9
-#define IRQ_DA8XX_EVTOUT7		10
-#define IRQ_DA8XX_CCINT0		11
-#define IRQ_DA8XX_CCERRINT		12
-#define IRQ_DA8XX_TCERRINT0		13
-#define IRQ_DA8XX_AEMIFINT		14
-#define IRQ_DA8XX_I2CINT0		15
-#define IRQ_DA8XX_MMCSDINT0		16
-#define IRQ_DA8XX_MMCSDINT1		17
-#define IRQ_DA8XX_ALLINT0		18
-#define IRQ_DA8XX_RTC			19
-#define IRQ_DA8XX_SPINT0		20
-#define IRQ_DA8XX_TINT12_0		21
-#define IRQ_DA8XX_TINT34_0		22
-#define IRQ_DA8XX_TINT12_1		23
-#define IRQ_DA8XX_TINT34_1		24
-#define IRQ_DA8XX_UARTINT0		25
-#define IRQ_DA8XX_KEYMGRINT		26
-#define IRQ_DA8XX_SECINT		26
-#define IRQ_DA8XX_SECKEYERR		26
-#define IRQ_DA8XX_CHIPINT0		28
-#define IRQ_DA8XX_CHIPINT1		29
-#define IRQ_DA8XX_CHIPINT2		30
-#define IRQ_DA8XX_CHIPINT3		31
-#define IRQ_DA8XX_TCERRINT1		32
-#define IRQ_DA8XX_C0_RX_THRESH_PULSE	33
-#define IRQ_DA8XX_C0_RX_PULSE		34
-#define IRQ_DA8XX_C0_TX_PULSE		35
-#define IRQ_DA8XX_C0_MISC_PULSE		36
-#define IRQ_DA8XX_C1_RX_THRESH_PULSE	37
-#define IRQ_DA8XX_C1_RX_PULSE		38
-#define IRQ_DA8XX_C1_TX_PULSE		39
-#define IRQ_DA8XX_C1_MISC_PULSE		40
-#define IRQ_DA8XX_MEMERR		41
-#define IRQ_DA8XX_GPIO0			42
-#define IRQ_DA8XX_GPIO1			43
-#define IRQ_DA8XX_GPIO2			44
-#define IRQ_DA8XX_GPIO3			45
-#define IRQ_DA8XX_GPIO4			46
-#define IRQ_DA8XX_GPIO5			47
-#define IRQ_DA8XX_GPIO6			48
-#define IRQ_DA8XX_GPIO7			49
-#define IRQ_DA8XX_GPIO8			50
-#define IRQ_DA8XX_I2CINT1		51
-#define IRQ_DA8XX_LCDINT		52
-#define IRQ_DA8XX_UARTINT1		53
-#define IRQ_DA8XX_MCASPINT		54
-#define IRQ_DA8XX_ALLINT1		55
-#define IRQ_DA8XX_SPINT1		56
-#define IRQ_DA8XX_UHPI_INT1		57
-#define IRQ_DA8XX_USB_INT		58
-#define IRQ_DA8XX_IRQN			59
-#define IRQ_DA8XX_RWAKEUP		60
-#define IRQ_DA8XX_UARTINT2		61
-#define IRQ_DA8XX_DFTSSINT		62
-#define IRQ_DA8XX_EHRPWM0		63
-#define IRQ_DA8XX_EHRPWM0TZ		64
-#define IRQ_DA8XX_EHRPWM1		65
-#define IRQ_DA8XX_EHRPWM1TZ		66
-#define IRQ_DA8XX_ECAP0			69
-#define IRQ_DA8XX_ECAP1			70
-#define IRQ_DA8XX_ECAP2			71
-#define IRQ_DA8XX_ARMCLKSTOPREQ		90
+#define IRQ_DA8XX_COMMTX		DAVINCI_INTC_IRQ(0)
+#define IRQ_DA8XX_COMMRX		DAVINCI_INTC_IRQ(1)
+#define IRQ_DA8XX_NINT			DAVINCI_INTC_IRQ(2)
+#define IRQ_DA8XX_EVTOUT0		DAVINCI_INTC_IRQ(3)
+#define IRQ_DA8XX_EVTOUT1		DAVINCI_INTC_IRQ(4)
+#define IRQ_DA8XX_EVTOUT2		DAVINCI_INTC_IRQ(5)
+#define IRQ_DA8XX_EVTOUT3		DAVINCI_INTC_IRQ(6)
+#define IRQ_DA8XX_EVTOUT4		DAVINCI_INTC_IRQ(7)
+#define IRQ_DA8XX_EVTOUT5		DAVINCI_INTC_IRQ(8)
+#define IRQ_DA8XX_EVTOUT6		DAVINCI_INTC_IRQ(9)
+#define IRQ_DA8XX_EVTOUT7		DAVINCI_INTC_IRQ(10)
+#define IRQ_DA8XX_CCINT0		DAVINCI_INTC_IRQ(11)
+#define IRQ_DA8XX_CCERRINT		DAVINCI_INTC_IRQ(12)
+#define IRQ_DA8XX_TCERRINT0		DAVINCI_INTC_IRQ(13)
+#define IRQ_DA8XX_AEMIFINT		DAVINCI_INTC_IRQ(14)
+#define IRQ_DA8XX_I2CINT0		DAVINCI_INTC_IRQ(15)
+#define IRQ_DA8XX_MMCSDINT0		DAVINCI_INTC_IRQ(16)
+#define IRQ_DA8XX_MMCSDINT1		DAVINCI_INTC_IRQ(17)
+#define IRQ_DA8XX_ALLINT0		DAVINCI_INTC_IRQ(18)
+#define IRQ_DA8XX_RTC			DAVINCI_INTC_IRQ(19)
+#define IRQ_DA8XX_SPINT0		DAVINCI_INTC_IRQ(20)
+#define IRQ_DA8XX_TINT12_0		DAVINCI_INTC_IRQ(21)
+#define IRQ_DA8XX_TINT34_0		DAVINCI_INTC_IRQ(22)
+#define IRQ_DA8XX_TINT12_1		DAVINCI_INTC_IRQ(23)
+#define IRQ_DA8XX_TINT34_1		DAVINCI_INTC_IRQ(24)
+#define IRQ_DA8XX_UARTINT0		DAVINCI_INTC_IRQ(25)
+#define IRQ_DA8XX_KEYMGRINT		DAVINCI_INTC_IRQ(26)
+#define IRQ_DA8XX_SECINT		DAVINCI_INTC_IRQ(26)
+#define IRQ_DA8XX_SECKEYERR		DAVINCI_INTC_IRQ(26)
+#define IRQ_DA8XX_CHIPINT0		DAVINCI_INTC_IRQ(28)
+#define IRQ_DA8XX_CHIPINT1		DAVINCI_INTC_IRQ(29)
+#define IRQ_DA8XX_CHIPINT2		DAVINCI_INTC_IRQ(30)
+#define IRQ_DA8XX_CHIPINT3		DAVINCI_INTC_IRQ(31)
+#define IRQ_DA8XX_TCERRINT1		DAVINCI_INTC_IRQ(32)
+#define IRQ_DA8XX_C0_RX_THRESH_PULSE	DAVINCI_INTC_IRQ(33)
+#define IRQ_DA8XX_C0_RX_PULSE		DAVINCI_INTC_IRQ(34)
+#define IRQ_DA8XX_C0_TX_PULSE		DAVINCI_INTC_IRQ(35)
+#define IRQ_DA8XX_C0_MISC_PULSE		DAVINCI_INTC_IRQ(36)
+#define IRQ_DA8XX_C1_RX_THRESH_PULSE	DAVINCI_INTC_IRQ(37)
+#define IRQ_DA8XX_C1_RX_PULSE		DAVINCI_INTC_IRQ(38)
+#define IRQ_DA8XX_C1_TX_PULSE		DAVINCI_INTC_IRQ(39)
+#define IRQ_DA8XX_C1_MISC_PULSE		DAVINCI_INTC_IRQ(40)
+#define IRQ_DA8XX_MEMERR		DAVINCI_INTC_IRQ(41)
+#define IRQ_DA8XX_GPIO0			DAVINCI_INTC_IRQ(42)
+#define IRQ_DA8XX_GPIO1			DAVINCI_INTC_IRQ(43)
+#define IRQ_DA8XX_GPIO2			DAVINCI_INTC_IRQ(44)
+#define IRQ_DA8XX_GPIO3			DAVINCI_INTC_IRQ(45)
+#define IRQ_DA8XX_GPIO4			DAVINCI_INTC_IRQ(46)
+#define IRQ_DA8XX_GPIO5			DAVINCI_INTC_IRQ(47)
+#define IRQ_DA8XX_GPIO6			DAVINCI_INTC_IRQ(48)
+#define IRQ_DA8XX_GPIO7			DAVINCI_INTC_IRQ(49)
+#define IRQ_DA8XX_GPIO8			DAVINCI_INTC_IRQ(50)
+#define IRQ_DA8XX_I2CINT1		DAVINCI_INTC_IRQ(51)
+#define IRQ_DA8XX_LCDINT		DAVINCI_INTC_IRQ(52)
+#define IRQ_DA8XX_UARTINT1		DAVINCI_INTC_IRQ(53)
+#define IRQ_DA8XX_MCASPINT		DAVINCI_INTC_IRQ(54)
+#define IRQ_DA8XX_ALLINT1		DAVINCI_INTC_IRQ(55)
+#define IRQ_DA8XX_SPINT1		DAVINCI_INTC_IRQ(56)
+#define IRQ_DA8XX_UHPI_INT1		DAVINCI_INTC_IRQ(57)
+#define IRQ_DA8XX_USB_INT		DAVINCI_INTC_IRQ(58)
+#define IRQ_DA8XX_IRQN			DAVINCI_INTC_IRQ(59)
+#define IRQ_DA8XX_RWAKEUP		DAVINCI_INTC_IRQ(60)
+#define IRQ_DA8XX_UARTINT2		DAVINCI_INTC_IRQ(61)
+#define IRQ_DA8XX_DFTSSINT		DAVINCI_INTC_IRQ(62)
+#define IRQ_DA8XX_EHRPWM0		DAVINCI_INTC_IRQ(63)
+#define IRQ_DA8XX_EHRPWM0TZ		DAVINCI_INTC_IRQ(64)
+#define IRQ_DA8XX_EHRPWM1		DAVINCI_INTC_IRQ(65)
+#define IRQ_DA8XX_EHRPWM1TZ		DAVINCI_INTC_IRQ(66)
+#define IRQ_DA8XX_ECAP0			DAVINCI_INTC_IRQ(69)
+#define IRQ_DA8XX_ECAP1			DAVINCI_INTC_IRQ(70)
+#define IRQ_DA8XX_ECAP2			DAVINCI_INTC_IRQ(71)
+#define IRQ_DA8XX_ARMCLKSTOPREQ		DAVINCI_INTC_IRQ(90)
 
 /* DA830 specific interrupts */
-#define IRQ_DA830_MPUERR		27
-#define IRQ_DA830_IOPUERR		27
-#define IRQ_DA830_BOOTCFGERR		27
-#define IRQ_DA830_EHRPWM2		67
-#define IRQ_DA830_EHRPWM2TZ		68
-#define IRQ_DA830_EQEP0			72
-#define IRQ_DA830_EQEP1			73
-#define IRQ_DA830_T12CMPINT0_0		74
-#define IRQ_DA830_T12CMPINT1_0		75
-#define IRQ_DA830_T12CMPINT2_0		76
-#define IRQ_DA830_T12CMPINT3_0		77
-#define IRQ_DA830_T12CMPINT4_0		78
-#define IRQ_DA830_T12CMPINT5_0		79
-#define IRQ_DA830_T12CMPINT6_0		80
-#define IRQ_DA830_T12CMPINT7_0		81
-#define IRQ_DA830_T12CMPINT0_1		82
-#define IRQ_DA830_T12CMPINT1_1		83
-#define IRQ_DA830_T12CMPINT2_1		84
-#define IRQ_DA830_T12CMPINT3_1		85
-#define IRQ_DA830_T12CMPINT4_1		86
-#define IRQ_DA830_T12CMPINT5_1		87
-#define IRQ_DA830_T12CMPINT6_1		88
-#define IRQ_DA830_T12CMPINT7_1		89
+#define IRQ_DA830_MPUERR		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA830_IOPUERR		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA830_BOOTCFGERR		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA830_EHRPWM2		DAVINCI_INTC_IRQ(67)
+#define IRQ_DA830_EHRPWM2TZ		DAVINCI_INTC_IRQ(68)
+#define IRQ_DA830_EQEP0			DAVINCI_INTC_IRQ(72)
+#define IRQ_DA830_EQEP1			DAVINCI_INTC_IRQ(73)
+#define IRQ_DA830_T12CMPINT0_0		DAVINCI_INTC_IRQ(74)
+#define IRQ_DA830_T12CMPINT1_0		DAVINCI_INTC_IRQ(75)
+#define IRQ_DA830_T12CMPINT2_0		DAVINCI_INTC_IRQ(76)
+#define IRQ_DA830_T12CMPINT3_0		DAVINCI_INTC_IRQ(77)
+#define IRQ_DA830_T12CMPINT4_0		DAVINCI_INTC_IRQ(78)
+#define IRQ_DA830_T12CMPINT5_0		DAVINCI_INTC_IRQ(79)
+#define IRQ_DA830_T12CMPINT6_0		DAVINCI_INTC_IRQ(80)
+#define IRQ_DA830_T12CMPINT7_0		DAVINCI_INTC_IRQ(81)
+#define IRQ_DA830_T12CMPINT0_1		DAVINCI_INTC_IRQ(82)
+#define IRQ_DA830_T12CMPINT1_1		DAVINCI_INTC_IRQ(83)
+#define IRQ_DA830_T12CMPINT2_1		DAVINCI_INTC_IRQ(84)
+#define IRQ_DA830_T12CMPINT3_1		DAVINCI_INTC_IRQ(85)
+#define IRQ_DA830_T12CMPINT4_1		DAVINCI_INTC_IRQ(86)
+#define IRQ_DA830_T12CMPINT5_1		DAVINCI_INTC_IRQ(87)
+#define IRQ_DA830_T12CMPINT6_1		DAVINCI_INTC_IRQ(88)
+#define IRQ_DA830_T12CMPINT7_1		DAVINCI_INTC_IRQ(89)
 
 #define DA830_N_CP_INTC_IRQ		96
 
 /* DA850 speicific interrupts */
-#define IRQ_DA850_MPUADDRERR0		27
-#define IRQ_DA850_MPUPROTERR0		27
-#define IRQ_DA850_IOPUADDRERR0		27
-#define IRQ_DA850_IOPUPROTERR0		27
-#define IRQ_DA850_IOPUADDRERR1		27
-#define IRQ_DA850_IOPUPROTERR1		27
-#define IRQ_DA850_IOPUADDRERR2		27
-#define IRQ_DA850_IOPUPROTERR2		27
-#define IRQ_DA850_BOOTCFG_ADDR_ERR	27
-#define IRQ_DA850_BOOTCFG_PROT_ERR	27
-#define IRQ_DA850_MPUADDRERR1		27
-#define IRQ_DA850_MPUPROTERR1		27
-#define IRQ_DA850_IOPUADDRERR3		27
-#define IRQ_DA850_IOPUPROTERR3		27
-#define IRQ_DA850_IOPUADDRERR4		27
-#define IRQ_DA850_IOPUPROTERR4		27
-#define IRQ_DA850_IOPUADDRERR5		27
-#define IRQ_DA850_IOPUPROTERR5		27
-#define IRQ_DA850_MIOPU_BOOTCFG_ERR	27
-#define IRQ_DA850_SATAINT		67
-#define IRQ_DA850_TINT12_2		68
-#define IRQ_DA850_TINT34_2		68
-#define IRQ_DA850_TINTALL_2		68
-#define IRQ_DA850_MMCSDINT0_1		72
-#define IRQ_DA850_MMCSDINT1_1		73
-#define IRQ_DA850_T12CMPINT0_2		74
-#define IRQ_DA850_T12CMPINT1_2		75
-#define IRQ_DA850_T12CMPINT2_2		76
-#define IRQ_DA850_T12CMPINT3_2		77
-#define IRQ_DA850_T12CMPINT4_2		78
-#define IRQ_DA850_T12CMPINT5_2		79
-#define IRQ_DA850_T12CMPINT6_2		80
-#define IRQ_DA850_T12CMPINT7_2		81
-#define IRQ_DA850_T12CMPINT0_3		82
-#define IRQ_DA850_T12CMPINT1_3		83
-#define IRQ_DA850_T12CMPINT2_3		84
-#define IRQ_DA850_T12CMPINT3_3		85
-#define IRQ_DA850_T12CMPINT4_3		86
-#define IRQ_DA850_T12CMPINT5_3		87
-#define IRQ_DA850_T12CMPINT6_3		88
-#define IRQ_DA850_T12CMPINT7_3		89
-#define IRQ_DA850_RPIINT		91
-#define IRQ_DA850_VPIFINT		92
-#define IRQ_DA850_CCINT1		93
-#define IRQ_DA850_CCERRINT1		94
-#define IRQ_DA850_TCERRINT2		95
-#define IRQ_DA850_TINT12_3		96
-#define IRQ_DA850_TINT34_3		96
-#define IRQ_DA850_TINTALL_3		96
-#define IRQ_DA850_MCBSP0RINT		97
-#define IRQ_DA850_MCBSP0XINT		98
-#define IRQ_DA850_MCBSP1RINT		99
-#define IRQ_DA850_MCBSP1XINT		100
+#define IRQ_DA850_MPUADDRERR0		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_MPUPROTERR0		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR0		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR0		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR1		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR1		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR2		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR2		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_BOOTCFG_ADDR_ERR	DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_BOOTCFG_PROT_ERR	DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_MPUADDRERR1		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_MPUPROTERR1		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR3		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR3		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR4		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR4		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUADDRERR5		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_IOPUPROTERR5		DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_MIOPU_BOOTCFG_ERR	DAVINCI_INTC_IRQ(27)
+#define IRQ_DA850_SATAINT		DAVINCI_INTC_IRQ(67)
+#define IRQ_DA850_TINT12_2		DAVINCI_INTC_IRQ(68)
+#define IRQ_DA850_TINT34_2		DAVINCI_INTC_IRQ(68)
+#define IRQ_DA850_TINTALL_2		DAVINCI_INTC_IRQ(68)
+#define IRQ_DA850_MMCSDINT0_1		DAVINCI_INTC_IRQ(72)
+#define IRQ_DA850_MMCSDINT1_1		DAVINCI_INTC_IRQ(73)
+#define IRQ_DA850_T12CMPINT0_2		DAVINCI_INTC_IRQ(74)
+#define IRQ_DA850_T12CMPINT1_2		DAVINCI_INTC_IRQ(75)
+#define IRQ_DA850_T12CMPINT2_2		DAVINCI_INTC_IRQ(76)
+#define IRQ_DA850_T12CMPINT3_2		DAVINCI_INTC_IRQ(77)
+#define IRQ_DA850_T12CMPINT4_2		DAVINCI_INTC_IRQ(78)
+#define IRQ_DA850_T12CMPINT5_2		DAVINCI_INTC_IRQ(79)
+#define IRQ_DA850_T12CMPINT6_2		DAVINCI_INTC_IRQ(80)
+#define IRQ_DA850_T12CMPINT7_2		DAVINCI_INTC_IRQ(81)
+#define IRQ_DA850_T12CMPINT0_3		DAVINCI_INTC_IRQ(82)
+#define IRQ_DA850_T12CMPINT1_3		DAVINCI_INTC_IRQ(83)
+#define IRQ_DA850_T12CMPINT2_3		DAVINCI_INTC_IRQ(84)
+#define IRQ_DA850_T12CMPINT3_3		DAVINCI_INTC_IRQ(85)
+#define IRQ_DA850_T12CMPINT4_3		DAVINCI_INTC_IRQ(86)
+#define IRQ_DA850_T12CMPINT5_3		DAVINCI_INTC_IRQ(87)
+#define IRQ_DA850_T12CMPINT6_3		DAVINCI_INTC_IRQ(88)
+#define IRQ_DA850_T12CMPINT7_3		DAVINCI_INTC_IRQ(89)
+#define IRQ_DA850_RPIINT		DAVINCI_INTC_IRQ(91)
+#define IRQ_DA850_VPIFINT		DAVINCI_INTC_IRQ(92)
+#define IRQ_DA850_CCINT1		DAVINCI_INTC_IRQ(93)
+#define IRQ_DA850_CCERRINT1		DAVINCI_INTC_IRQ(94)
+#define IRQ_DA850_TCERRINT2		DAVINCI_INTC_IRQ(95)
+#define IRQ_DA850_TINT12_3		DAVINCI_INTC_IRQ(96)
+#define IRQ_DA850_TINT34_3		DAVINCI_INTC_IRQ(96)
+#define IRQ_DA850_TINTALL_3		DAVINCI_INTC_IRQ(96)
+#define IRQ_DA850_MCBSP0RINT		DAVINCI_INTC_IRQ(97)
+#define IRQ_DA850_MCBSP0XINT		DAVINCI_INTC_IRQ(98)
+#define IRQ_DA850_MCBSP1RINT		DAVINCI_INTC_IRQ(99)
+#define IRQ_DA850_MCBSP1XINT		DAVINCI_INTC_IRQ(100)
 
 #define DA850_N_CP_INTC_IRQ		101
 
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 6/35
#21 lore raw

Re: [PATCH 06/35] ARM: davinci: wrap interrupt definitions with a macro for SPARSE_IRQ

Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This is done in preparation for selecting CONFIG_SPARSE_IRQ. The interrupt numbers will then start at the predefined NR_IRQS offset.

For now wrap all interrupt numbers with a macro and define DAVINCI_INTC_START to 0. Logically nothing changes for now.

---

arch/arm/mach-davinci/include/mach/irqs.h line 34

Quoted 10 lines
arch/arm/mach-davinci/include/mach/irqs.h +2 -0
index 03c446635301..14fa668d4e8d 100644
@@ -30,371 +30,374 @@
  /* Base address */
  #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
+#define DAVINCI_INTC_START		0
+#define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))

Almost not worth mentioning, but DAVINCI_INTC_START is only ever used once, so it could be omitted.

#22 lore raw

Re: [PATCH 06/35] ARM: davinci: wrap interrupt definitions with a macro for SPARSE_IRQ

pon., 4 lut 2019 o 23:32 David Lechner <[email protected]> napisał(a):

Quoted 23 lines · Bartosz Golaszewski
Quoted 10 lines

From: Bartosz Golaszewski <[email protected]>

This is done in preparation for selecting CONFIG_SPARSE_IRQ. The interrupt numbers will then start at the predefined NR_IRQS offset.

For now wrap all interrupt numbers with a macro and define DAVINCI_INTC_START to 0. Logically nothing changes for now.

---

Quoted 8 lines
arch/arm/mach-davinci/include/mach/irqs.h +0 -0
index 03c446635301..14fa668d4e8d 100644
@@ -30,371 +30,374 @@
  /* Base address */
  #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
Quoted 5 lines

arch/arm/mach-davinci/include/mach/irqs.h line 34

Quoted 2 lines
arch/arm/mach-davinci/include/mach/irqs.h +2 -0
+#define DAVINCI_INTC_START           0
+#define DAVINCI_INTC_IRQ(_irqnum)    (DAVINCI_INTC_START + (_irqnum))

Almost not worth mentioning, but DAVINCI_INTC_START is only ever used once, so it could be omitted.

I'd like to leave it here - it's more readable that way.

Bart

#23 lore raw

PATCH 7/35 ARM: davinci: aintc: use irq domain

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We need to create an irq domain if we want to select SPARSE_IRQ. The cp-intc driver already supports it, but aintc doesn't. Use the helpers provided by the generic irq chip abstraction.

---
 arch/arm/mach-davinci/irq.c | 38 ++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/irq.c +27 -11
index e539bc65d4ef..c874ea269411 100644
@@ -23,6 +23,7 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/io.h>
+#include <linux/irqdomain.h>
 
 #include <mach/hardware.h>
 #include <mach/cputype.h>
@@ -43,6 +44,7 @@
 #define IRQ_INTPRI7_REG_OFFSET	0x004C
 
 static void __iomem *davinci_intc_base;
+static struct irq_domain *davinci_irq_domain;
 
 static inline void davinci_irq_writel(unsigned long value, int offset)
 {
@@ -55,17 +57,15 @@ static inline unsigned long davinci_irq_readl(int offset)
 }
 
 static __init void
-davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
+davinci_irq_setup_gc(void __iomem *base,
+		     unsigned int irq_start, unsigned int num)
 {
 	struct irq_chip_generic *gc;
 	struct irq_chip_type *ct;
 
-	gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq);
-	if (!gc) {
-		pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n",
-		       __func__, irq_start);
-		return;
-	}
+	gc = irq_get_domain_generic_chip(davinci_irq_domain, irq_start);
+	gc->reg_base = base;
+	gc->irq_base = irq_start;
 
 	ct = gc->chip_types;
 	ct->chip.irq_ack = irq_gc_ack_set_bit;
@@ -82,13 +82,11 @@ static asmlinkage void __exception_irq_entry
 davinci_handle_irq(struct pt_regs *regs)
 {
 	int irqnr = davinci_irq_readl(IRQ_IRQENTRY_OFFSET);
-	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	irqnr >>= 2;
 	irqnr -= 1;
 
-	generic_handle_irq(irqnr);
-	set_irq_regs(old_regs);
+	handle_domain_irq(davinci_irq_domain, irqnr, regs);
 }
 
 /* ARM Interrupt Controller Initialization */
@@ -96,6 +94,7 @@ void __init davinci_irq_init(void)
 {
 	unsigned i, j;
 	const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios;
+	int rv, irq_base;
 
 	davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_4K);
 	if (WARN_ON(!davinci_intc_base))
@@ -131,8 +130,25 @@ void __init davinci_irq_init(void)
 		davinci_irq_writel(pri, i);
 	}
 
+	irq_base = irq_alloc_descs(-1, 0, davinci_soc_info.intc_irq_num, 0);
+	if (WARN_ON(irq_base < 0))
+		return;
+
+	davinci_irq_domain = irq_domain_add_legacy(NULL,
+					davinci_soc_info.intc_irq_num,
+					irq_base, 0, &irq_domain_simple_ops,
+					NULL);
+	if (WARN_ON(!davinci_irq_domain))
+		return;
+
+	rv = irq_alloc_domain_generic_chips(davinci_irq_domain, 32, 1,
+					    "AINTC", handle_edge_irq,
+					    IRQ_NOREQUEST | IRQ_NOPROBE, 0, 0);
+	if (WARN_ON(rv))
+		return;
+
 	for (i = 0, j = 0; i < davinci_soc_info.intc_irq_num; i += 32, j += 0x04)
-		davinci_alloc_gc(davinci_intc_base + j, i, 32);
+		davinci_irq_setup_gc(davinci_intc_base + j, irq_base + i, 32);
 
 	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
 	set_handle_irq(davinci_handle_irq);
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#24 lore raw

Re: [PATCH 07/35] ARM: davinci: aintc: use irq domain

Quoted 39 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We need to create an irq domain if we want to select SPARSE_IRQ. The cp-intc driver already supports it, but aintc doesn't. Use the helpers provided by the generic irq chip abstraction.

---
  arch/arm/mach-davinci/irq.c | 38 ++++++++++++++++++++++++++-----------
  1 file changed, 27 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/irq.c +4 -1
index e539bc65d4ef..c874ea269411 100644
@@ -23,6 +23,7 @@
  #include <linux/interrupt.h>
  #include <linux/irq.h>
  #include <linux/io.h>
+#include <linux/irqdomain.h>
 
  #include <mach/hardware.h>
  #include <mach/cputype.h>
@@ -43,6 +44,7 @@
  #define IRQ_INTPRI7_REG_OFFSET	0x004C
 
  static void __iomem *davinci_intc_base;
+static struct irq_domain *davinci_irq_domain;
 
  static inline void davinci_irq_writel(unsigned long value, int offset)
  {
@@ -55,17 +57,15 @@ static inline unsigned long davinci_irq_readl(int offset)
  }
 
  static __init void
-davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
+davinci_irq_setup_gc(void __iomem *base,
+		     unsigned int irq_start, unsigned int num)
  {

arch/arm/mach-davinci/irq.c static inline unsigned long davinci_irq_readl(int offset) · line 66

Quoted 10 lines
arch/arm/mach-davinci/irq.c +1 -6
  	struct irq_chip_generic *gc;
  	struct irq_chip_type *ct;
 
-	gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq);
-	if (!gc) {
-		pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n",
-		       __func__, irq_start);
-		return;
-	}
+	gc = irq_get_domain_generic_chip(davinci_irq_domain, irq_start);

check for (gc == NULL) here?

#25 lore raw

Re: [PATCH 07/35] ARM: davinci: aintc: use irq domain

pon., 4 lut 2019 o 23:42 David Lechner <[email protected]> napisał(a):

Quoted 44 lines · Bartosz Golaszewski
Quoted 42 lines

From: Bartosz Golaszewski <[email protected]>

We need to create an irq domain if we want to select SPARSE_IRQ. The cp-intc driver already supports it, but aintc doesn't. Use the helpers provided by the generic irq chip abstraction.

---
  arch/arm/mach-davinci/irq.c | 38 ++++++++++++++++++++++++++-----------
  1 file changed, 27 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/irq.c +4 -1
index e539bc65d4ef..c874ea269411 100644
@@ -23,6 +23,7 @@
  #include <linux/interrupt.h>
  #include <linux/irq.h>
  #include <linux/io.h>
+#include <linux/irqdomain.h>
 
  #include <mach/hardware.h>
  #include <mach/cputype.h>
@@ -43,6 +44,7 @@
  #define IRQ_INTPRI7_REG_OFFSET      0x004C
 
  static void __iomem *davinci_intc_base;
+static struct irq_domain *davinci_irq_domain;
 
  static inline void davinci_irq_writel(unsigned long value, int offset)
  {
@@ -55,17 +57,15 @@ static inline unsigned long davinci_irq_readl(int offset)
  }
 
  static __init void
-davinci_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num)
+davinci_irq_setup_gc(void __iomem *base,
+                  unsigned int irq_start, unsigned int num)
  {
      struct irq_chip_generic *gc;
      struct irq_chip_type *ct;
 
Quoted 10 lines

arch/arm/mach-davinci/irq.c static inline unsigned long davinci_irq_readl(int offset) · line 66

Quoted 7 lines
arch/arm/mach-davinci/irq.c +1 -6
-     gc = irq_alloc_generic_chip("AINTC", 1, irq_start, base, handle_edge_irq);
-     if (!gc) {
-             pr_err("%s: irq_alloc_generic_chip for IRQ %u failed\n",
-                    __func__, irq_start);
-             return;
-     }
+     gc = irq_get_domain_generic_chip(davinci_irq_domain, irq_start);

check for (gc == NULL) here?

I can add it, but it's not really needed. We know we pass correct parameters to this routine and if it fails, the system won't boot anyway.

Bart

#26 lore raw

Re: [PATCH 07/35] ARM: davinci: aintc: use irq domain

In reply to Bartosz Golaszewski

arch/arm/mach-davinci/irq.c static asmlinkage void __exception_irq_entry · line 90

Quoted 13 lines · Bartosz Golaszewski
arch/arm/mach-davinci/irq.c +1 -3
@@ -82,13 +82,11 @@ static asmlinkage void __exception_irq_entry
 davinci_handle_irq(struct pt_regs *regs)
 {
 	int irqnr = davinci_irq_readl(IRQ_IRQENTRY_OFFSET);
-	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	irqnr >>= 2;
 	irqnr -= 1;
 
-	generic_handle_irq(irqnr);
-	set_irq_regs(old_regs);
+	handle_domain_irq(davinci_irq_domain, irqnr, regs);
 }

Is it possible to bring 2/35 after this patch so you dont end up removing code added there?

Thanks,
Sekhar

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#27 lore raw

PATCH 8/35 ARM: davinci: select SPARSE_IRQ

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Everything is in place now for SPARSE_IRQ. Select it and set DAVINCI_INTC_START to NR_IRQS.

We now need to include mach/irqs.h in a couple places as it is no longer indirectly included after selecting SPARSE_IRQ.

---
 arch/arm/Kconfig                          | 1 +
 arch/arm/mach-davinci/board-da830-evm.c   | 1 +
 arch/arm/mach-davinci/board-da850-evm.c   | 1 +
 arch/arm/mach-davinci/board-dm644x-evm.c  | 1 +
 arch/arm/mach-davinci/devices-da8xx.c     | 1 +
 arch/arm/mach-davinci/include/mach/irqs.h | 5 +++--
 arch/arm/mach-davinci/irq.c               | 1 +
 7 files changed, 9 insertions(+), 2 deletions(-)
arch/arm/Kconfig +1 -0
index f7770fdcad68..1037f49e050f 100644
@@ -595,6 +595,7 @@ config ARCH_DAVINCI
 	select PM_GENERIC_DOMAINS if PM
 	select PM_GENERIC_DOMAINS_OF if PM && OF
 	select RESET_CONTROLLER
+	select SPARSE_IRQ
 	select USE_OF
 	select ZONE_DMA
 	help
arch/arm/mach-davinci/board-da830-evm.c +1 -0
index c4da635ee4ce..41f5a51fee9a 100644
@@ -36,6 +36,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
+#include <mach/irqs.h>
 #include "cp_intc.h"
 #include <mach/mux.h>
 #include <mach/da8xx.h>
arch/arm/mach-davinci/board-da850-evm.c +1 -0
index 44bca048dfd0..317f48560534 100644
@@ -46,6 +46,7 @@
 #include "cp_intc.h"
 #include <mach/da8xx.h>
 #include <mach/mux.h>
+#include <mach/irqs.h>
 #include "sram.h"
 
 #include <asm/mach-types.h>
arch/arm/mach-davinci/board-dm644x-evm.c +1 -0
index b80c4ee76217..16ffed2525e6 100644
@@ -36,6 +36,7 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
+#include <mach/irqs.h>
 #include <linux/platform_data/i2c-davinci.h>
 #include <mach/serial.h>
 #include <mach/mux.h>
arch/arm/mach-davinci/devices-da8xx.c +1 -0
index cf78da5ab054..65edd2aa9db5 100644
@@ -25,6 +25,7 @@
 #include <mach/cputype.h>
 #include <mach/da8xx.h>
 #include <mach/time.h>
+#include <mach/irqs.h>
 
 #include "asp.h"
 #include "cpuidle.h"
arch/arm/mach-davinci/include/mach/irqs.h +3 -2
index 14fa668d4e8d..317cbc42e5cd 100644
@@ -27,10 +27,12 @@
 #ifndef __ASM_ARCH_IRQS_H
 #define __ASM_ARCH_IRQS_H
 
+#include <asm/irq.h>
+
 /* Base address */
 #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
-#define DAVINCI_INTC_START		0
+#define DAVINCI_INTC_START		NR_IRQS
 #define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
 
 /* Interrupt lines */
@@ -404,6 +406,5 @@
 /* da850 currently has the most gpio pins (144) */
 #define DAVINCI_N_GPIO			144
 /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */
-#define NR_IRQS				(DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO)
 
 #endif /* __ASM_ARCH_IRQS_H */
arch/arm/mach-davinci/irq.c +1 -0
index c874ea269411..2b8b653aeb98 100644
@@ -28,6 +28,7 @@
 #include <mach/hardware.h>
 #include <mach/cputype.h>
 #include <mach/common.h>
+#include <mach/irqs.h>
 #include <asm/mach/irq.h>
 #include <asm/exception.h>
 
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 8/35
#28 lore raw

Re: [PATCH 08/35] ARM: davinci: select SPARSE_IRQ

Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Everything is in place now for SPARSE_IRQ. Select it and set DAVINCI_INTC_START to NR_IRQS.

We now need to include mach/irqs.h in a couple places as it is no longer indirectly included after selecting SPARSE_IRQ.

---

...

Quoted 19 lines
arch/arm/mach-davinci/include/mach/irqs.h +3 -1
index 14fa668d4e8d..317cbc42e5cd 100644
@@ -27,10 +27,12 @@
  #ifndef __ASM_ARCH_IRQS_H
  #define __ASM_ARCH_IRQS_H
 
+#include <asm/irq.h>
+
  /* Base address */
  #define DAVINCI_ARM_INTC_BASE 0x01C48000
 
-#define DAVINCI_INTC_START		0
+#define DAVINCI_INTC_START		NR_IRQS
  #define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
 
  /* Interrupt lines */

arch/arm/mach-davinci/include/mach/irqs.h line 408

Quoted 3 lines
arch/arm/mach-davinci/include/mach/irqs.h +0 -0
@@ -404,6 +406,5 @@
  /* da850 currently has the most gpio pins (144) */
  #define DAVINCI_N_GPIO			144
  /* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */

It would make sense to delete this comment in this patch as well (although it gets deleted later anyway).

Quoted 3 lines
arch/arm/mach-davinci/include/mach/irqs.h +0 -1
-#define NR_IRQS				(DA850_N_CP_INTC_IRQ + DAVINCI_N_GPIO)
 
  #endif /* __ASM_ARCH_IRQS_H */
#29 lore raw

PATCH 9/35 ARM: davinci: aintc: drop GPL license boilerplate

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Replace the GPLv2 or later license boilerplate with an SPDX identifier.

---
 arch/arm/mach-davinci/irq.c | 26 ++++++--------------------
 1 file changed, 6 insertions(+), 20 deletions(-)
arch/arm/mach-davinci/irq.c +6 -20
index 2b8b653aeb98..b908b4903b9a 100644
@@ -1,23 +1,9 @@
-/*
- * Interrupt handler for DaVinci boards.
- *
- * Copyright (C) 2006 Texas Instruments.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
+// SPDX-License-Identifier: GPL-2.0-or-later
+//
+// Copyright (C) 2006, 2019 Texas Instruments.
+//
+// Interrupt handler for DaVinci boards.
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
Signature · 1 line
2.20.1
#30 lore raw

PATCH 10/35 ARM: davinci: aintc: wrap davinci_irq_init() with a helper

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We're going to extend the davinci_irq_init() function with a config structure so we can drop the intc-related fields from davinci_soc_info.

Once we do it, we won't be able to use this routine directly as the init_irq callback. Wrap the calls in additional helpers that don't take parameters and can be assigned to init_irq.

---
 arch/arm/mach-davinci/board-dm355-evm.c     | 2 +-
 arch/arm/mach-davinci/board-dm355-leopard.c | 2 +-
 arch/arm/mach-davinci/board-dm365-evm.c     | 2 +-
 arch/arm/mach-davinci/board-dm644x-evm.c    | 2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c    | 4 ++--
 arch/arm/mach-davinci/board-neuros-osd2.c   | 2 +-
 arch/arm/mach-davinci/board-sffsdr.c        | 2 +-
 arch/arm/mach-davinci/davinci.h             | 4 ++++
 arch/arm/mach-davinci/dm355.c               | 5 +++++
 arch/arm/mach-davinci/dm365.c               | 5 +++++
 arch/arm/mach-davinci/dm644x.c              | 5 +++++
 arch/arm/mach-davinci/dm646x.c              | 5 +++++
 12 files changed, 32 insertions(+), 8 deletions(-)
arch/arm/mach-davinci/board-dm355-evm.c +1 -1
index f7fa960c23e3..3d0303fb792f 100644
@@ -438,7 +438,7 @@ static __init void dm355_evm_init(void)
 MACHINE_START(DAVINCI_DM355_EVM, "DaVinci DM355 EVM")
 	.atag_offset  = 0x100,
 	.map_io	      = dm355_evm_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm355_init_irqs,
 	.init_time	= dm355_init_time,
 	.init_machine = dm355_evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-dm355-leopard.c +1 -1
index 0fdf1d03eb11..91e9772b9399 100644
@@ -273,7 +273,7 @@ static __init void dm355_leopard_init(void)
 MACHINE_START(DM355_LEOPARD, "DaVinci DM355 leopard")
 	.atag_offset  = 0x100,
 	.map_io	      = dm355_leopard_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm355_init_irqs,
 	.init_time	= dm355_init_time,
 	.init_machine = dm355_leopard_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-dm365-evm.c +1 -1
index e3b0b701e395..be1cfcc412f7 100644
@@ -834,7 +834,7 @@ static __init void dm365_evm_init(void)
 MACHINE_START(DAVINCI_DM365_EVM, "DaVinci DM365 EVM")
 	.atag_offset	= 0x100,
 	.map_io		= dm365_evm_map_io,
-	.init_irq	= davinci_irq_init,
+	.init_irq	= dm365_init_irqs,
 	.init_time	= dm365_init_time,
 	.init_machine	= dm365_evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
index 16ffed2525e6..f23a29e5116f 100644
@@ -890,7 +890,7 @@ MACHINE_START(DAVINCI_EVM, "DaVinci DM644x EVM")
 	/* Maintainer: MontaVista Software <[email protected]> */
 	.atag_offset  = 0x100,
 	.map_io	      = davinci_evm_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm644x_init_irqs,
 	.init_time	= dm644x_init_time,
 	.init_machine = davinci_evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-dm646x-evm.c +2 -2
index 8d5be6dd2019..ebf07d92224e 100644
@@ -863,7 +863,7 @@ static __init void evm_init(void)
 MACHINE_START(DAVINCI_DM6467_EVM, "DaVinci DM646x EVM")
 	.atag_offset  = 0x100,
 	.map_io       = davinci_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm646x_init_irqs,
 	.init_time	= dm646x_evm_init_time,
 	.init_machine = evm_init,
 	.init_late	= davinci_init_late,
@@ -873,7 +873,7 @@ MACHINE_END
 MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM")
 	.atag_offset  = 0x100,
 	.map_io       = davinci_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm646x_init_irqs,
 	.init_time	= dm6467t_evm_init_time,
 	.init_machine = evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-neuros-osd2.c +1 -1
index efdaa27241c5..fb4c5b3ba8f7 100644
@@ -231,7 +231,7 @@ MACHINE_START(NEUROS_OSD2, "Neuros OSD2")
 	/* Maintainer: Neuros Technologies <[email protected]> */
 	.atag_offset	= 0x100,
 	.map_io		 = davinci_ntosd2_map_io,
-	.init_irq	= davinci_irq_init,
+	.init_irq	= dm644x_init_irqs,
 	.init_time	= dm644x_init_time,
 	.init_machine = davinci_ntosd2_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-sffsdr.c +1 -1
index 792bb84d5011..2fc6f23285b5 100644
@@ -153,7 +153,7 @@ static __init void davinci_sffsdr_init(void)
 MACHINE_START(SFFSDR, "Lyrtech SFFSDR")
 	.atag_offset  = 0x100,
 	.map_io	      = davinci_sffsdr_map_io,
-	.init_irq     = davinci_irq_init,
+	.init_irq     = dm644x_init_irqs,
 	.init_time	= dm644x_init_time,
 	.init_machine = davinci_sffsdr_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/davinci.h +4 -0
index db4c95ef4d5c..49958cc161d7 100644
@@ -88,6 +88,7 @@ int davinci_init_wdt(void);
 /* DM355 function declarations */
 void dm355_init(void);
 void dm355_init_time(void);
+void dm355_init_irqs(void);
 void dm355_register_clocks(void);
 void dm355_init_spi0(unsigned chipselect_mask,
 		const struct spi_board_info *info, unsigned len);
@@ -97,6 +98,7 @@ int dm355_gpio_register(void);
 
 /* DM365 function declarations */
 void dm365_init(void);
+void dm365_init_irqs(void);
 void dm365_init_time(void);
 void dm365_register_clocks(void);
 void dm365_init_asp(void);
@@ -110,6 +112,7 @@ int dm365_gpio_register(void);
 
 /* DM644x function declarations */
 void dm644x_init(void);
+void dm644x_init_irqs(void);
 void dm644x_init_devices(void);
 void dm644x_init_time(void);
 void dm644x_register_clocks(void);
@@ -119,6 +122,7 @@ int dm644x_gpio_register(void);
 
 /* DM646x function declarations */
 void dm646x_init(void);
+void dm646x_init_irqs(void);
 void dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate);
 void dm646x_register_clocks(void);
 void dm646x_init_mcasp0(struct snd_platform_data *pdata);
arch/arm/mach-davinci/dm355.c +5 -0
index a31f56c70d1d..2795b5ee0069 100644
@@ -738,6 +738,11 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+void __init dm355_init_irqs(void)
+{
+	davinci_irq_init();
+}
+
 static int __init dm355_init_devices(void)
 {
 	struct platform_device *edma_pdev;
arch/arm/mach-davinci/dm365.c +5 -0
index 42b2012d25cc..3222873ff9c6 100644
@@ -995,6 +995,11 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+void __init dm365_init_irqs(void)
+{
+	davinci_irq_init();
+}
+
 static int __init dm365_init_devices(void)
 {
 	struct platform_device *edma_pdev;
arch/arm/mach-davinci/dm644x.c +5 -0
index bf7ebdcf6c18..cfc6e2d481d7 100644
@@ -672,6 +672,11 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+void __init dm644x_init_irqs(void)
+{
+	davinci_irq_init();
+}
+
 void __init dm644x_init_devices(void)
 {
 	struct platform_device *edma_pdev;
arch/arm/mach-davinci/dm646x.c +5 -0
index 64b4ae5a4202..5cb087f68efe 100644
@@ -633,6 +633,11 @@ void __init dm646x_register_clocks(void)
 	platform_device_register(&dm646x_pll2_device);
 }
 
+void __init dm646x_init_irqs(void)
+{
+	davinci_irq_init();
+}
+
 static int __init dm646x_init_devices(void)
 {
 	int ret = 0;
Signature · 7 lines
2.20.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Reviewed-by on v1 10/35
#31 lore raw

Re: [PATCH 10/35] ARM: davinci: aintc: wrap davinci_irq_init() with a helper

Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We're going to extend the davinci_irq_init() function with a config structure so we can drop the intc-related fields from davinci_soc_info.

Once we do it, we won't be able to use this routine directly as the init_irq callback. Wrap the calls in additional helpers that don't take parameters and can be assigned to init_irq.

---

One bikeshed comment: I would use xxx_init_irq instead of xxx_init_irqs so that the function names exactly match the .init_irq field.

#32 lore raw

PATCH 11/35 ARM: davinci: aintc: use a common prefix for symbols in the driver

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In preparation for moving the driver to drivers/irqchip do some
cleanup: use a common prefix for all symbols.

---
 arch/arm/mach-davinci/dm355.c               |  2 +-
 arch/arm/mach-davinci/dm365.c               |  2 +-
 arch/arm/mach-davinci/dm644x.c              |  2 +-
 arch/arm/mach-davinci/dm646x.c              |  2 +-
 arch/arm/mach-davinci/include/mach/common.h |  2 +-
 arch/arm/mach-davinci/irq.c                 | 98 ++++++++++-----------
 6 files changed, 54 insertions(+), 54 deletions(-)
arch/arm/mach-davinci/dm355.c +1 -1
index 2795b5ee0069..cf574956ce1d 100644
@@ -740,7 +740,7 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
 
 void __init dm355_init_irqs(void)
 {
-	davinci_irq_init();
+	davinci_aintc_init();
 }
 
 static int __init dm355_init_devices(void)
arch/arm/mach-davinci/dm365.c +1 -1
index 3222873ff9c6..e63153a6ae41 100644
@@ -997,7 +997,7 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
 
 void __init dm365_init_irqs(void)
 {
-	davinci_irq_init();
+	davinci_aintc_init();
 }
 
 static int __init dm365_init_devices(void)
arch/arm/mach-davinci/dm644x.c +1 -1
index cfc6e2d481d7..0904baa1d008 100644
@@ -674,7 +674,7 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
 
 void __init dm644x_init_irqs(void)
 {
-	davinci_irq_init();
+	davinci_aintc_init();
 }
 
 void __init dm644x_init_devices(void)
arch/arm/mach-davinci/dm646x.c +1 -1
index 5cb087f68efe..27831d6fc5a5 100644
@@ -635,7 +635,7 @@ void __init dm646x_register_clocks(void)
 
 void __init dm646x_init_irqs(void)
 {
-	davinci_irq_init();
+	davinci_aintc_init();
 }
 
 static int __init dm646x_init_devices(void)
arch/arm/mach-davinci/include/mach/common.h +1 -1
index 3d45b73b9a64..9cf3a36a802a 100644
@@ -19,7 +19,7 @@
 
 void davinci_timer_init(struct clk *clk);
 
-extern void davinci_irq_init(void);
+extern void davinci_aintc_init(void);
 
 struct davinci_timer_instance {
 	u32		base;
arch/arm/mach-davinci/irq.c +49 -49

172 lines not on this page · raw message

Signature · 1 line
2.20.1
#34 lore raw

PATCH 12/35 ARM: davinci: aintc: drop the 00 prefix from register offsets

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Since no offset goes past 0xff - let's drop the 00 prefix for better readability. While we're at it: convert all hex numbers to lower-case.

---
 arch/arm/mach-davinci/irq.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
arch/arm/mach-davinci/irq.c +11 -11
index c43aee686b78..b31821e89a46 100644
@@ -18,17 +18,17 @@
 #include <asm/mach/irq.h>
 #include <asm/exception.h>
 
-#define DAVINCI_AINTC_FIQ_REG0		0x0000
-#define DAVINCI_AINTC_FIQ_REG1		0x0004
-#define DAVINCI_AINTC_IRQ_REG0		0x0008
-#define DAVINCI_AINTC_IRQ_REG1		0x000C
-#define DAVINCI_AINTC_IRQ_IRQENTRY	0x0014
-#define DAVINCI_AINTC_IRQ_ENT_REG0	0x0018
-#define DAVINCI_AINTC_IRQ_ENT_REG1	0x001C
-#define DAVINCI_AINTC_IRQ_INCTL_REG	0x0020
-#define DAVINCI_AINTC_IRQ_EABASE_REG	0x0024
-#define DAVINCI_AINTC_IRQ_INTPRI0_REG	0x0030
-#define DAVINCI_AINTC_IRQ_INTPRI7_REG	0x004C
+#define DAVINCI_AINTC_FIQ_REG0		0x00
+#define DAVINCI_AINTC_FIQ_REG1		0x04
+#define DAVINCI_AINTC_IRQ_REG0		0x08
+#define DAVINCI_AINTC_IRQ_REG1		0x0c
+#define DAVINCI_AINTC_IRQ_IRQENTRY	0x14
+#define DAVINCI_AINTC_IRQ_ENT_REG0	0x18
+#define DAVINCI_AINTC_IRQ_ENT_REG1	0x1c
+#define DAVINCI_AINTC_IRQ_INCTL_REG	0x20
+#define DAVINCI_AINTC_IRQ_EABASE_REG	0x24
+#define DAVINCI_AINTC_IRQ_INTPRI0_REG	0x30
+#define DAVINCI_AINTC_IRQ_INTPRI7_REG	0x4c
 
 static void __iomem *davinci_aintc_base;
 static struct irq_domain *davinci_aintc_irq_domain;
Signature · 1 line
2.20.1
#36 lore raw

PATCH 13/35 ARM: davinci: aintc: add a new config structure

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a config structure that will be used by aintc-based platforms. It contains the register range resource, number of interrupts and a list of priorities.

---
 include/linux/irqchip/irq-davinci-aintc.h | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 include/linux/irqchip/irq-davinci-aintc.h
include/linux/irqchip/irq-davinci-aintc.h new file +17 -0
new file mode 100644
index 000000000000..d488e798bbef
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Texas Instruments
+ */
+
+#ifndef _LINUX_IRQ_DAVINCI_AINTC_
+#define _LINUX_IRQ_DAVINCI_AINTC_
+
+#include <linux/ioport.h>
+
+struct davinci_aintc_config {
+	struct resource reg;
+	unsigned int num_irqs;
+	u8 *prios;
+};
+
+#endif /* _LINUX_IRQ_DAVINCI_AINTC_ */
Signature · 1 line
2.20.1
#37 lore raw

Re: [PATCH 13/35] ARM: davinci: aintc: add a new config structure

Quoted 18 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a config structure that will be used by aintc-based platforms. It contains the register range resource, number of interrupts and a list of priorities.

---
  include/linux/irqchip/irq-davinci-aintc.h | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

create mode 100644 include/linux/irqchip/irq-davinci-aintc.h

include/linux/irqchip/irq-davinci-aintc.h new file +0 -0
new file mode 100644
index 000000000000..d488e798bbef

include/linux/irqchip/irq-davinci-aintc.h line 1

Quoted 1 line
include/linux/irqchip/irq-davinci-aintc.h new file +1 -0
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */

GPL-2.0-or-later ?

include/linux/irqchip/irq-davinci-aintc.h line 10

Quoted 9 lines
include/linux/irqchip/irq-davinci-aintc.h new file +9 -0
+/*
+ * Copyright (C) 2019 Texas Instruments
+ */
+
+#ifndef _LINUX_IRQ_DAVINCI_AINTC_
+#define _LINUX_IRQ_DAVINCI_AINTC_
+
+#include <linux/ioport.h>
+

doc comment would be nice here, especially to say that "prios" is short for priorities and that the length of the array is num_irqs.

Quoted 8 lines
include/linux/irqchip/irq-davinci-aintc.h new file +7 -0
+struct davinci_aintc_config {
+	struct resource reg;
+	unsigned int num_irqs;
+	u8 *prios;
+};
+
+#endif /* _LINUX_IRQ_DAVINCI_AINTC_ */
#38 lore raw

Re: [PATCH 13/35] ARM: davinci: aintc: add a new config structure

In reply to Bartosz Golaszewski
Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a config structure that will be used by aintc-based platforms. It contains the register range resource, number of interrupts and a list of priorities.

Subject prefix needs to be adjusted (not a mach-davinci patch)

Thanks,
Sekhar

#39 lore raw

PATCH 14/35 ARM: davinci: aintc: use the new irqchip config structure in dm* SoCs

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the new-style config structures for dm* SoCs. They will be used once we make the aintc driver stop using davinci_soc_info.

---
 arch/arm/mach-davinci/dm355.c  | 11 +++++++++++
 arch/arm/mach-davinci/dm365.c  | 11 +++++++++++
 arch/arm/mach-davinci/dm644x.c | 11 +++++++++++
 arch/arm/mach-davinci/dm646x.c | 11 +++++++++++
 4 files changed, 44 insertions(+)
arch/arm/mach-davinci/dm355.c +11 -0
index cf574956ce1d..0dcfcbec522a 100644
@@ -15,6 +15,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_data/spi-davinci.h>
@@ -738,6 +739,16 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+static const struct davinci_aintc_config dm355_aintc_config = {
+	.reg = {
+		.start		= DAVINCI_ARM_INTC_BASE,
+		.end		= DAVINCI_ARM_INTC_BASE + SZ_4K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= 64,
+	.prios			= dm355_aintc_prios,
+};
+
 void __init dm355_init_irqs(void)
 {
 	davinci_aintc_init();
arch/arm/mach-davinci/dm365.c +11 -0
index e63153a6ae41..1878c97e5df5 100644
@@ -19,6 +19,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_data/keyscan-davinci.h>
@@ -995,6 +996,16 @@ int __init dm365_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+static const struct davinci_aintc_config dm365_aintc_config = {
+	.reg = {
+		.start		= DAVINCI_ARM_INTC_BASE,
+		.end		= DAVINCI_ARM_INTC_BASE + SZ_4K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= 64,
+	.prios			= dm365_aintc_prios,
+};
+
 void __init dm365_init_irqs(void)
 {
 	davinci_aintc_init();
arch/arm/mach-davinci/dm644x.c +11 -0
index 0904baa1d008..5c48a5e4090b 100644
@@ -14,6 +14,7 @@
 #include <linux/clkdev.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_device.h>
@@ -672,6 +673,16 @@ int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
 	return 0;
 }
 
+static const struct davinci_aintc_config dm644x_aintc_config = {
+	.reg = {
+		.start		= DAVINCI_ARM_INTC_BASE,
+		.end		= DAVINCI_ARM_INTC_BASE + SZ_4K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= 64,
+	.prios			= dm644x_aintc_prios,
+};
+
 void __init dm644x_init_irqs(void)
 {
 	davinci_aintc_init();
arch/arm/mach-davinci/dm646x.c +11 -0
index 27831d6fc5a5..e06ea3b61011 100644
@@ -15,6 +15,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
 #include <linux/platform_device.h>
@@ -633,6 +634,16 @@ void __init dm646x_register_clocks(void)
 	platform_device_register(&dm646x_pll2_device);
 }
 
+static const struct davinci_aintc_config dm646x_aintc_config = {
+	.reg = {
+		.start		= DAVINCI_ARM_INTC_BASE,
+		.end		= DAVINCI_ARM_INTC_BASE + SZ_4K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= 64,
+	.prios			= dm646x_aintc_prios,
+};
+
 void __init dm646x_init_irqs(void)
 {
 	davinci_aintc_init();
Signature · 1 line
2.20.1
#40 lore raw

Re: [PATCH 14/35] ARM: davinci: aintc: use the new irqchip config structure in dm* SoCs

Quoted 26 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the new-style config structures for dm* SoCs. They will be used once we make the aintc driver stop using davinci_soc_info.

---
  arch/arm/mach-davinci/dm355.c  | 11 +++++++++++
  arch/arm/mach-davinci/dm365.c  | 11 +++++++++++
  arch/arm/mach-davinci/dm644x.c | 11 +++++++++++
  arch/arm/mach-davinci/dm646x.c | 11 +++++++++++
  4 files changed, 44 insertions(+)
arch/arm/mach-davinci/dm355.c +1 -0
index cf574956ce1d..0dcfcbec522a 100644
@@ -15,6 +15,7 @@
  #include <linux/dma-mapping.h>
  #include <linux/dmaengine.h>
  #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
  #include <linux/platform_data/edma.h>
  #include <linux/platform_data/gpio-davinci.h>
  #include <linux/platform_data/spi-davinci.h>

arch/arm/mach-davinci/dm355.c int __init dm355_init_video(struct vpfe_config *vpfe_cfg, · line 745

Quoted 7 lines
arch/arm/mach-davinci/dm355.c +4 -0
@@ -738,6 +739,16 @@ int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
  	return 0;
  }
 
+static const struct davinci_aintc_config dm355_aintc_config = {
+	.reg = {
+		.start		= DAVINCI_ARM_INTC_BASE,
+		.end		= DAVINCI_ARM_INTC_BASE + SZ_4K,

missing a minus 1 after SZ_4K?

+ .end = DAVINCI_ARM_INTC_BASE + SZ_4K - 1,

(repeated 3 more times below)

Quoted 9 lines
arch/arm/mach-davinci/dm355.c +6 -0
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= 64,
+	.prios			= dm355_aintc_prios,
+};
+
  void __init dm355_init_irqs(void)
  {
  	davinci_aintc_init();
#41 lore raw

PATCH 15/35 ARM: davinci: aintc: use the new config structure

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Modify the aintc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_aintc_init() to irq-davinci-aintc.h and make it take the new config structure as parameter. Convert all users to the new version.

---
 arch/arm/mach-davinci/dm355.c               |  2 +-
 arch/arm/mach-davinci/dm365.c               |  2 +-
 arch/arm/mach-davinci/dm644x.c              |  2 +-
 arch/arm/mach-davinci/dm646x.c              |  2 +-
 arch/arm/mach-davinci/include/mach/common.h |  2 --
 arch/arm/mach-davinci/irq.c                 | 35 ++++++++++++---------
 include/linux/irqchip/irq-davinci-aintc.h   |  2 ++
 7 files changed, 26 insertions(+), 21 deletions(-)
arch/arm/mach-davinci/dm355.c +1 -1
index 0dcfcbec522a..a0bfb3602136 100644
@@ -751,7 +751,7 @@ static const struct davinci_aintc_config dm355_aintc_config = {
 
 void __init dm355_init_irqs(void)
 {
-	davinci_aintc_init();
+	davinci_aintc_init(&dm355_aintc_config);
 }
 
 static int __init dm355_init_devices(void)
arch/arm/mach-davinci/dm365.c +1 -1
index 1878c97e5df5..eab575873255 100644
@@ -1008,7 +1008,7 @@ static const struct davinci_aintc_config dm365_aintc_config = {
 
 void __init dm365_init_irqs(void)
 {
-	davinci_aintc_init();
+	davinci_aintc_init(&dm365_aintc_config);
 }
 
 static int __init dm365_init_devices(void)
arch/arm/mach-davinci/dm644x.c +1 -1
index 5c48a5e4090b..24ad7a09aa15 100644
@@ -685,7 +685,7 @@ static const struct davinci_aintc_config dm644x_aintc_config = {
 
 void __init dm644x_init_irqs(void)
 {
-	davinci_aintc_init();
+	davinci_aintc_init(&dm644x_aintc_config);
 }
 
 void __init dm644x_init_devices(void)
arch/arm/mach-davinci/dm646x.c +1 -1
index e06ea3b61011..ab02cc93813a 100644
@@ -646,7 +646,7 @@ static const struct davinci_aintc_config dm646x_aintc_config = {
 
 void __init dm646x_init_irqs(void)
 {
-	davinci_aintc_init();
+	davinci_aintc_init(&dm646x_aintc_config);
 }
 
 static int __init dm646x_init_devices(void)
arch/arm/mach-davinci/include/mach/common.h +0 -2
index 9cf3a36a802a..9e06974c85bb 100644
@@ -19,8 +19,6 @@
 
 void davinci_timer_init(struct clk *clk);
 
-extern void davinci_aintc_init(void);
-
 struct davinci_timer_instance {
 	u32		base;
 	u32		bottom_irq;
arch/arm/mach-davinci/irq.c +20 -15
index b31821e89a46..d67f443a471d 100644
@@ -8,6 +8,7 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/irq.h>
+#include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/io.h>
 #include <linux/irqdomain.h>
 
@@ -77,13 +78,14 @@ davinci_aintc_handle_irq(struct pt_regs *regs)
 }
 
 /* ARM Interrupt Controller Initialization */
-void __init davinci_aintc_init(void)
+void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 {
-	unsigned i, j;
-	const u8 *davinci_def_priorities = davinci_soc_info.intc_irq_prios;
+	unsigned int irq_off, reg_off, prio, shift;
 	int rv, irq_base;
+	const u8 *prios;
 
-	davinci_aintc_base = ioremap(davinci_soc_info.intc_base, SZ_4K);
+	davinci_aintc_base = ioremap(config->reg.start,
+				     resource_size(&config->reg));
 	if (WARN_ON(!davinci_aintc_base))
 		return;
 
@@ -109,22 +111,22 @@ void __init davinci_aintc_init(void)
 	davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG0);
 	davinci_aintc_writel(~0x0, DAVINCI_AINTC_IRQ_REG1);
 
-	for (i = DAVINCI_AINTC_IRQ_INTPRI0_REG; i <= DAVINCI_AINTC_IRQ_INTPRI7_REG; i += 4) {
-		u32		pri;
+	prios = config->prios;
 
-		for (j = 0, pri = 0; j < 32; j += 4, davinci_def_priorities++)
-			pri |= (*davinci_def_priorities & 0x07) << j;
-		davinci_aintc_writel(pri, i);
+	for (reg_off = DAVINCI_AINTC_IRQ_INTPRI0_REG;
+	     reg_off <= DAVINCI_AINTC_IRQ_INTPRI7_REG; reg_off += 4) {
+		for (shift = 0, prio = 0; shift < 32; shift += 4, prios++)
+			prio |= (*prios & 0x07) << shift;
+		davinci_aintc_writel(prio, reg_off);
 	}
 
-	irq_base = irq_alloc_descs(-1, 0, davinci_soc_info.intc_irq_num, 0);
+	irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0);
 	if (WARN_ON(irq_base < 0))
 		return;
 
 	davinci_aintc_irq_domain = irq_domain_add_legacy(NULL,
-					davinci_soc_info.intc_irq_num,
-					irq_base, 0, &irq_domain_simple_ops,
-					NULL);
+						config->num_irqs, irq_base, 0,
+						&irq_domain_simple_ops, NULL);
 	if (WARN_ON(!davinci_aintc_irq_domain))
 		return;
 
@@ -134,8 +136,11 @@ void __init davinci_aintc_init(void)
 	if (WARN_ON(rv))
 		return;
 
-	for (i = 0, j = 0; i < davinci_soc_info.intc_irq_num; i += 32, j += 0x04)
-		davinci_aintc_setup_gc(davinci_aintc_base + j, irq_base + i, 32);
+	for (irq_off = 0, reg_off = 0;
+	     irq_off < config->num_irqs;
+	     irq_off += 32, reg_off += 0x04)
+		davinci_aintc_setup_gc(davinci_aintc_base + reg_off,
+				       irq_base + irq_off, 32);
 
 	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
 	set_handle_irq(davinci_aintc_handle_irq);
include/linux/irqchip/irq-davinci-aintc.h +2 -0
index d488e798bbef..cc851d58f07f 100644
@@ -14,4 +14,6 @@ struct davinci_aintc_config {
 	u8 *prios;
 };
 
+void davinci_aintc_init(const struct davinci_aintc_config *config);
+
 #endif /* _LINUX_IRQ_DAVINCI_AINTC_ */
Signature · 1 line
2.20.1
Reviewed-by on v1 15/35
#42 lore raw

Re: [PATCH 15/35] ARM: davinci: aintc: use the new config structure

Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Modify the aintc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_aintc_init() to irq-davinci-aintc.h and make it take the new config structure as parameter. Convert all users to the new version.

---

#43 lore raw

PATCH 16/35 ARM: davinci: aintc: move timer-specific irq_set_handler() out of irq.c

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

I've been unable to figure out exactly why, but it seems that the IRQ_TINT1_TINT34 interrupt for timer 1 needs to be handled as a level irq, not edge like all others.

This timer is used by the dsp on dm64* boards only.

Let's move the handler setup out of the aintc driver where it's lived since the beginning and into the dm64* SoC-specific files where it belongs.

---
 arch/arm/mach-davinci/dm644x.c | 4 ++++
 arch/arm/mach-davinci/dm646x.c | 4 ++++
 arch/arm/mach-davinci/irq.c    | 1 -
 3 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/dm644x.c +4 -0
index 24ad7a09aa15..beb97101c881 100644
@@ -14,6 +14,7 @@
 #include <linux/clkdev.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
@@ -616,6 +617,9 @@ void __init dm644x_init_time(void)
 	void __iomem *pll1, *psc;
 	struct clk *clk;
 
+	/* Needed by the dsp. */
+	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
+
 	clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ);
 
 	pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
arch/arm/mach-davinci/dm646x.c +4 -0
index ab02cc93813a..70505c92d5fb 100644
@@ -15,6 +15,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/dmaengine.h>
 #include <linux/init.h>
+#include <linux/irq.h>
 #include <linux/irqchip/irq-davinci-aintc.h>
 #include <linux/platform_data/edma.h>
 #include <linux/platform_data/gpio-davinci.h>
@@ -599,6 +600,9 @@ void __init dm646x_init_time(unsigned long ref_clk_rate,
 	void __iomem *pll1, *psc;
 	struct clk *clk;
 
+	/* Needed by the dsp. */
+	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
+
 	clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate);
 	clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate);
 
arch/arm/mach-davinci/irq.c +0 -1
index d67f443a471d..2e114ad83adc 100644
@@ -142,6 +142,5 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
 		davinci_aintc_setup_gc(davinci_aintc_base + reg_off,
 				       irq_base + irq_off, 32);
 
-	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
 	set_handle_irq(davinci_aintc_handle_irq);
 }
Signature · 1 line
2.20.1
#44 lore raw

Re: [PATCH 16/35] ARM: davinci: aintc: move timer-specific irq_set_handler() out of irq.c

Quoted 32 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

I've been unable to figure out exactly why, but it seems that the IRQ_TINT1_TINT34 interrupt for timer 1 needs to be handled as a level irq, not edge like all others.

This timer is used by the dsp on dm64* boards only.

Let's move the handler setup out of the aintc driver where it's lived since the beginning and into the dm64* SoC-specific files where it belongs.

---
  arch/arm/mach-davinci/dm644x.c | 4 ++++
  arch/arm/mach-davinci/dm646x.c | 4 ++++
  arch/arm/mach-davinci/irq.c    | 1 -
  3 files changed, 8 insertions(+), 1 deletion(-)
arch/arm/mach-davinci/dm644x.c +1 -0
index 24ad7a09aa15..beb97101c881 100644
@@ -14,6 +14,7 @@
  #include <linux/clkdev.h>
  #include <linux/dmaengine.h>
  #include <linux/init.h>
+#include <linux/irq.h>
  #include <linux/irqchip/irq-davinci-aintc.h>
  #include <linux/platform_data/edma.h>
  #include <linux/platform_data/gpio-davinci.h>

arch/arm/mach-davinci/dm644x.c void __init dm644x_init_time(void) · line 621

Quoted 5 lines
arch/arm/mach-davinci/dm644x.c +2 -0
@@ -616,6 +617,9 @@ void __init dm644x_init_time(void)
  	void __iomem *pll1, *psc;
  	struct clk *clk;
 
+	/* Needed by the dsp. */
+	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);

Does this actually need to be called before the clocks are inited? If not, it would seem more logical to have this right before davinci_timer_init().

Also, since the IRQ_TINT1_TINT34 macro is removed later, the comment could do a better job explaining what it is doing.

Quoted 17 lines
arch/arm/mach-davinci/dm644x.c +1 -0
+
  	clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, DM644X_REF_FREQ);
 
  	pll1 = ioremap(DAVINCI_PLL1_BASE, SZ_1K);
arch/arm/mach-davinci/dm646x.c +1 -0
index ab02cc93813a..70505c92d5fb 100644
@@ -15,6 +15,7 @@
  #include <linux/dma-mapping.h>
  #include <linux/dmaengine.h>
  #include <linux/init.h>
+#include <linux/irq.h>
  #include <linux/irqchip/irq-davinci-aintc.h>
  #include <linux/platform_data/edma.h>
  #include <linux/platform_data/gpio-davinci.h>

arch/arm/mach-davinci/dm646x.c void __init dm646x_init_time(unsigned long ref_clk_rate, · line 604

Quoted 5 lines
arch/arm/mach-davinci/dm646x.c +2 -0
@@ -599,6 +600,9 @@ void __init dm646x_init_time(unsigned long ref_clk_rate,
  	void __iomem *pll1, *psc;
  	struct clk *clk;
 
+	/* Needed by the dsp. */
+	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);

same here.

Quoted 16 lines
arch/arm/mach-davinci/dm646x.c +1 -0
+
  	clk_register_fixed_rate(NULL, "ref_clk", NULL, 0, ref_clk_rate);
  	clk_register_fixed_rate(NULL, "aux_clkin", NULL, 0, aux_clkin_rate);
 
arch/arm/mach-davinci/irq.c +0 -1
index d67f443a471d..2e114ad83adc 100644
@@ -142,6 +142,5 @@ void __init davinci_aintc_init(const struct davinci_aintc_config *config)
  		davinci_aintc_setup_gc(davinci_aintc_base + reg_off,
  				       irq_base + irq_off, 32);
 
-	irq_set_handler(IRQ_TINT1_TINT34, handle_level_irq);
  	set_handle_irq(davinci_aintc_handle_irq);
  }
#45 lore raw

Re: [PATCH 16/35] ARM: davinci: aintc: move timer-specific irq_set_handler() out of irq.c

In reply to Bartosz Golaszewski
Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

I've been unable to figure out exactly why, but it seems that the IRQ_TINT1_TINT34 interrupt for timer 1 needs to be handled as a level irq, not edge like all others.

Not sure of the history myself. This has been this way since beginning of DaVinci support in kernel.

Quoted 2 lines

This timer is used by the dsp on dm64* boards only.

This would be T1_TOP in code, which is actually marked as unused. T1_BOT is the one used for DSPs.

Quoted 10 lines

Let's move the handler setup out of the aintc driver where it's lived since the beginning and into the dm64* SoC-specific files where it belongs.

---
 arch/arm/mach-davinci/dm644x.c | 4 ++++
 arch/arm/mach-davinci/dm646x.c | 4 ++++
 arch/arm/mach-davinci/irq.c    | 1 -

I think this should be done for DM355 too?

Thanks,
Sekhar

#46 lore raw

PATCH 17/35 ARM: davinci: aintc: remove unnecessary includes

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

These includes are no longer required. Remove them.

---
 arch/arm/mach-davinci/irq.c | 5 -----
 1 file changed, 5 deletions(-)
arch/arm/mach-davinci/irq.c +0 -5
index 2e114ad83adc..ce4625d9cad7 100644
@@ -12,11 +12,6 @@
 #include <linux/io.h>
 #include <linux/irqdomain.h>
 
-#include <mach/hardware.h>
-#include <mach/cputype.h>
-#include <mach/common.h>
-#include <mach/irqs.h>
-#include <asm/mach/irq.h>
 #include <asm/exception.h>
 
 #define DAVINCI_AINTC_FIQ_REG0		0x00
Signature · 1 line
2.20.1
#48 lore raw

PATCH 18/35 irqchip: davinci-aintc: move the driver to drivers/irqchip

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The aintc driver has now been cleaned up. Move it to drivers/irqchip where it belongs. There's no device-tree support for any dm* board so there's no IRQCHIP_OF_DECLARE() - there's only the exported init function called from machine code.

---
 arch/arm/mach-davinci/Kconfig                         | 11 ++++-------
 arch/arm/mach-davinci/Makefile                        |  1 -
 drivers/irqchip/Kconfig                               |  5 +++++
 drivers/irqchip/Makefile                              |  1 +
 .../irq.c => drivers/irqchip/irq-davinci-aintc.c      |  0
 5 files changed, 10 insertions(+), 8 deletions(-)
 rename arch/arm/mach-davinci/irq.c => drivers/irqchip/irq-davinci-aintc.c (100%)
arch/arm/mach-davinci/Kconfig +4 -7
index da8a039d65f9..71a4d875dd39 100644
@@ -1,9 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 if ARCH_DAVINCI
 
-config AINTC
-	bool
-
 config CP_INTC
 	bool
 	select IRQ_DOMAIN
@@ -17,17 +14,17 @@ comment "DaVinci Core Type"
 
 config ARCH_DAVINCI_DM644x
 	bool "DaVinci 644x based system"
-	select AINTC
+	select DAVINCI_AINTC
 	select ARCH_DAVINCI_DMx
 
 config ARCH_DAVINCI_DM355
 	bool "DaVinci 355 based system"
-	select AINTC
+	select DAVINCI_AINTC
 	select ARCH_DAVINCI_DMx
 
 config ARCH_DAVINCI_DM646x
 	bool "DaVinci 646x based system"
-	select AINTC
+	select DAVINCI_AINTC
 	select ARCH_DAVINCI_DMx
 
 config ARCH_DAVINCI_DA830
@@ -49,7 +46,7 @@ config ARCH_DAVINCI_DA8XX
 
 config ARCH_DAVINCI_DM365
 	bool "DaVinci 365 based system"
-	select AINTC
+	select DAVINCI_AINTC
 	select ARCH_DAVINCI_DMx
 
 comment "DaVinci Board Type"
arch/arm/mach-davinci/Makefile +0 -1
index 93d271b4d84b..983865a99616 100644
@@ -18,7 +18,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM365)	+= dm365.o devices.o
 obj-$(CONFIG_ARCH_DAVINCI_DA830)	+= da830.o devices-da8xx.o usb-da8xx.o
 obj-$(CONFIG_ARCH_DAVINCI_DA850)	+= da850.o devices-da8xx.o usb-da8xx.o
 
-obj-$(CONFIG_AINTC)			+= irq.o
 obj-$(CONFIG_CP_INTC)			+= cp_intc.o
 
 # Board specific
drivers/irqchip/Kconfig +5 -0
index 3d1e60779078..ea0eb82bf1d2 100644
@@ -129,6 +129,11 @@ config BRCMSTB_L2_IRQ
 	select GENERIC_IRQ_CHIP
 	select IRQ_DOMAIN
 
+config DAVINCI_AINTC
+	bool
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN
+
 config DW_APB_ICTL
 	bool
 	select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
index c93713d24b86..623e0ec5f9d0 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_ATH79)			+= irq-ath79-cpu.o
 obj-$(CONFIG_ATH79)			+= irq-ath79-misc.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2835.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2836.o
+obj-$(CONFIG_DAVINCI_AINTC)		+= irq-davinci-aintc.o
 obj-$(CONFIG_ARCH_EXYNOS)		+= exynos-combiner.o
 obj-$(CONFIG_FARADAY_FTINTC010)		+= irq-ftintc010.o
 obj-$(CONFIG_ARCH_HIP04)		+= irq-hip04.o
drivers/irqchip/irq-davinci-aintc.c renamed from arch/arm/mach-davinci/irq.c +0 -0
similarity index 100%
rename from arch/arm/mach-davinci/irq.c
rename to drivers/irqchip/irq-davinci-aintc.c
Signature · 1 line
2.20.1
Reviewed-by on v1 18/35
#49 lore raw

Re: [PATCH 18/35] irqchip: davinci-aintc: move the driver to drivers/irqchip

Quoted 9 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The aintc driver has now been cleaned up. Move it to drivers/irqchip where it belongs. There's no device-tree support for any dm* board so there's no IRQCHIP_OF_DECLARE() - there's only the exported init function called from machine code.

---

drivers/irqchip/Kconfig config BRCMSTB_L2_IRQ · line 135

Quoted 12 lines
drivers/irqchip/Kconfig +4 -0
index 3d1e60779078..ea0eb82bf1d2 100644
@@ -129,6 +129,11 @@ config BRCMSTB_L2_IRQ
  	select GENERIC_IRQ_CHIP
  	select IRQ_DOMAIN
 
+config DAVINCI_AINTC
+	bool
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN

No help section? :-)

Quoted 4 lines
drivers/irqchip/Kconfig +1 -0
+
  config DW_APB_ICTL
  	bool
  	select GENERIC_IRQ_CHIP
#50 lore raw

Re: [PATCH 18/35] irqchip: davinci-aintc: move the driver to drivers/irqchip

wt., 5 lut 2019 o 00:43 David Lechner <[email protected]> napisał(a):

Quoted 23 lines · Bartosz Golaszewski
Quoted 9 lines

From: Bartosz Golaszewski <[email protected]>

The aintc driver has now been cleaned up. Move it to drivers/irqchip where it belongs. There's no device-tree support for any dm* board so there's no IRQCHIP_OF_DECLARE() - there's only the exported init function called from machine code.

---

Quoted 8 lines
drivers/irqchip/Kconfig +0 -0
index 3d1e60779078..ea0eb82bf1d2 100644
@@ -129,6 +129,11 @@ config BRCMSTB_L2_IRQ
      select GENERIC_IRQ_CHIP
      select IRQ_DOMAIN
 
Quoted 7 lines

drivers/irqchip/Kconfig config BRCMSTB_L2_IRQ · line 135

Quoted 4 lines
drivers/irqchip/Kconfig +4 -0
+config DAVINCI_AINTC
+     bool
+     select GENERIC_IRQ_CHIP
+     select IRQ_DOMAIN

No help section? :-)

Most Kconfig options that cannot be interactively selected don't have one.

I'll leave it as is.

Bart

Quoted 5 lines
Quoted 4 lines
drivers/irqchip/Kconfig +1 -0
+
  config DW_APB_ICTL
      bool
      select GENERIC_IRQ_CHIP
#51 lore raw

PATCH 19/35 ARM: davinci: cp-intc: remove cp_intc.h

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

There's no need to have a local header for cp-intc. Move the only declaration for a public function to common.h. Move all register offsets into the driver source file and drop all unused defines. Make cp_intc_of_init() static.

---
 arch/arm/mach-davinci/board-da830-evm.c     |  1 -
 arch/arm/mach-davinci/board-da850-evm.c     |  1 -
 arch/arm/mach-davinci/board-mityomapl138.c  |  1 -
 arch/arm/mach-davinci/board-omapl138-hawk.c |  1 -
 arch/arm/mach-davinci/cp_intc.c             | 20 +++++++-
 arch/arm/mach-davinci/cp_intc.h             | 57 ---------------------
 arch/arm/mach-davinci/include/mach/common.h |  1 +
 7 files changed, 19 insertions(+), 63 deletions(-)
 delete mode 100644 arch/arm/mach-davinci/cp_intc.h
arch/arm/mach-davinci/board-da830-evm.c +0 -1
index 41f5a51fee9a..4c1836fa654e 100644
@@ -37,7 +37,6 @@
 
 #include <mach/common.h>
 #include <mach/irqs.h>
-#include "cp_intc.h"
 #include <mach/mux.h>
 #include <mach/da8xx.h>
 
arch/arm/mach-davinci/board-da850-evm.c +0 -1
index 317f48560534..548a3c351c02 100644
@@ -43,7 +43,6 @@
 #include <linux/spi/flash.h>
 
 #include <mach/common.h>
-#include "cp_intc.h"
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 #include <mach/irqs.h>
arch/arm/mach-davinci/board-mityomapl138.c +0 -1
index 8df16e81b69e..eb6a9465f229 100644
@@ -27,7 +27,6 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <mach/common.h>
-#include "cp_intc.h"
 #include <mach/da8xx.h>
 #include <linux/platform_data/mtd-davinci.h>
 #include <linux/platform_data/mtd-davinci-aemif.h>
arch/arm/mach-davinci/board-omapl138-hawk.c +0 -1
index 94c4f126ef86..7f852722ff08 100644
@@ -27,7 +27,6 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
-#include "cp_intc.h"
 #include <mach/da8xx.h>
 #include <mach/mux.h>
 
arch/arm/mach-davinci/cp_intc.c +18 -2
index 384b72fbefca..817b7616753c 100644
@@ -21,7 +21,22 @@
 
 #include <asm/exception.h>
 #include <mach/common.h>
-#include "cp_intc.h"
+
+#define CP_INTC_CTRL			0x04
+#define CP_INTC_HOST_CTRL		0x0C
+#define CP_INTC_GLOBAL_ENABLE		0x10
+#define CP_INTC_SYS_STAT_IDX_CLR	0x24
+#define CP_INTC_SYS_ENABLE_IDX_SET	0x28
+#define CP_INTC_SYS_ENABLE_IDX_CLR	0x2C
+#define CP_INTC_HOST_ENABLE_IDX_SET	0x34
+#define CP_INTC_HOST_ENABLE_IDX_CLR	0x38
+#define CP_INTC_PRIO_IDX		0x80
+#define CP_INTC_SYS_STAT_CLR(n)		(0x0280 + (n << 2))
+#define CP_INTC_SYS_ENABLE_CLR(n)	(0x0380 + (n << 2))
+#define CP_INTC_CHAN_MAP(n)		(0x0400 + (n << 2))
+#define CP_INTC_SYS_POLARITY(n)		(0x0D00 + (n << 2))
+#define CP_INTC_SYS_TYPE(n)		(0x0D80 + (n << 2))
+#define CP_INTC_HOST_ENABLE(n)		(0x1500 + (n << 2))
 
 static void __iomem *davinci_intc_base;
 
@@ -126,7 +141,8 @@ static const struct irq_domain_ops cp_intc_host_ops = {
 	.xlate = irq_domain_xlate_onetwocell,
 };
 
-int __init cp_intc_of_init(struct device_node *node, struct device_node *parent)
+static int __init cp_intc_of_init(struct device_node *node,
+				  struct device_node *parent)
 {
 	u32 num_irq		= davinci_soc_info.intc_irq_num;
 	u8 *irq_prio		= davinci_soc_info.intc_irq_prios;
arch/arm/mach-davinci/cp_intc.h deleted +0 -57

57 lines not on this page · raw message

arch/arm/mach-davinci/include/mach/common.h +1 -0
index 9e06974c85bb..4177a71db64c 100644
@@ -17,6 +17,7 @@
 #include <linux/types.h>
 #include <linux/reboot.h>
 
+void cp_intc_init(void);
 void davinci_timer_init(struct clk *clk);
 
 struct davinci_timer_instance {
Signature · 1 line
2.20.1
Reviewed-by on v1 19/35
#52 lore raw

Re: [PATCH 19/35] ARM: davinci: cp-intc: remove cp_intc.h

Quoted 9 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

There's no need to have a local header for cp-intc. Move the only declaration for a public function to common.h. Move all register offsets into the driver source file and drop all unused defines. Make cp_intc_of_init() static.

---

#53 lore raw

PATCH 20/35 ARM: davinci: cp-intc: add a wrapper around cp_intc_init()

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We're going to extend the cp_intc_init() function with a config structure so we can drop the intc-related fields from davinci_soc_info.

Once we do it, we won't be able to use this routine directly as the init_irq callback. Wrap the calls in additional helpers that don't take parameters and can be assigned to init_irq.

---
 arch/arm/mach-davinci/board-da830-evm.c     | 2 +-
 arch/arm/mach-davinci/board-da850-evm.c     | 2 +-
 arch/arm/mach-davinci/board-mityomapl138.c  | 2 +-
 arch/arm/mach-davinci/board-omapl138-hawk.c | 2 +-
 arch/arm/mach-davinci/da830.c               | 5 +++++
 arch/arm/mach-davinci/da850.c               | 5 +++++
 arch/arm/mach-davinci/include/mach/da8xx.h  | 2 ++
 7 files changed, 16 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +1 -1
index 4c1836fa654e..b3a0148f7f1a 100644
@@ -693,7 +693,7 @@ static void __init da830_evm_map_io(void)
 MACHINE_START(DAVINCI_DA830_EVM, "DaVinci DA830/OMAP-L137/AM17x EVM")
 	.atag_offset	= 0x100,
 	.map_io		= da830_evm_map_io,
-	.init_irq	= cp_intc_init,
+	.init_irq	= da830_init_irqs,
 	.init_time	= da830_init_time,
 	.init_machine	= da830_evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-da850-evm.c +1 -1
index 548a3c351c02..efc9a33da6e1 100644
@@ -1521,7 +1521,7 @@ static void __init da850_evm_map_io(void)
 MACHINE_START(DAVINCI_DA850_EVM, "DaVinci DA850/OMAP-L138/AM18x EVM")
 	.atag_offset	= 0x100,
 	.map_io		= da850_evm_map_io,
-	.init_irq	= cp_intc_init,
+	.init_irq	= da850_init_irqs,
 	.init_time	= da850_init_time,
 	.init_machine	= da850_evm_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-mityomapl138.c +1 -1
index eb6a9465f229..59a6f5db4222 100644
@@ -623,7 +623,7 @@ static void __init mityomapl138_map_io(void)
 MACHINE_START(MITYOMAPL138, "MityDSP-L138/MityARM-1808")
 	.atag_offset	= 0x100,
 	.map_io		= mityomapl138_map_io,
-	.init_irq	= cp_intc_init,
+	.init_irq	= da850_init_irqs,
 	.init_time	= da850_init_time,
 	.init_machine	= mityomapl138_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/board-omapl138-hawk.c +1 -1
index 7f852722ff08..af6580ce71eb 100644
@@ -461,7 +461,7 @@ static void __init omapl138_hawk_map_io(void)
 MACHINE_START(OMAPL138_HAWKBOARD, "AM18x/OMAP-L138 Hawkboard")
 	.atag_offset	= 0x100,
 	.map_io		= omapl138_hawk_map_io,
-	.init_irq	= cp_intc_init,
+	.init_irq	= da850_init_irqs,
 	.init_time	= da850_init_time,
 	.init_machine	= omapl138_hawk_init,
 	.init_late	= davinci_init_late,
arch/arm/mach-davinci/da830.c +5 -0
index f1e7b6c644e5..8b9220badef5 100644
@@ -742,6 +742,11 @@ void __init da830_init(void)
 	WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
 }
 
+void __init da830_init_irqs(void)
+{
+	cp_intc_init();
+}
+
 void __init da830_init_time(void)
 {
 	void __iomem *pll;
arch/arm/mach-davinci/da850.c +5 -0
index 40b90730e847..9f48e1ac61fb 100644
@@ -671,6 +671,11 @@ void __init da850_init(void)
 	WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module");
 }
 
+void __init da850_init_irqs(void)
+{
+	cp_intc_init();
+}
+
 void __init da850_init_time(void)
 {
 	void __iomem *pll0;
arch/arm/mach-davinci/include/mach/da8xx.h +2 -0
index ab4a57f433f4..a5b4b1b964fd 100644
@@ -88,10 +88,12 @@ extern unsigned int da850_max_speed;
 #define DA8XX_ARM_RAM_BASE	0xffff0000
 
 void da830_init(void);
+void da830_init_irqs(void);
 void da830_init_time(void);
 void da830_register_clocks(void);
 
 void da850_init(void);
+void da850_init_irqs(void);
 void da850_init_time(void);
 void da850_register_clocks(void);
 
Signature · 1 line
2.20.1
Reviewed-by on v1 20/35
#54 lore raw

Re: [PATCH 20/35] ARM: davinci: cp-intc: add a wrapper around cp_intc_init()

Quoted 11 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We're going to extend the cp_intc_init() function with a config structure so we can drop the intc-related fields from davinci_soc_info.

Once we do it, we won't be able to use this routine directly as the init_irq callback. Wrap the calls in additional helpers that don't take parameters and can be assigned to init_irq.

---

Also, same bikeshed comment about xxx_init_irq vs. xxx_init_irqs.

#55 lore raw

PATCH 21/35 ARM: davinci: cp-intc: add a new config structure

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a config structure that will be used by cp-intc-based platforms. It contains the register range resource and the number of interrupts.

---
 include/linux/irqchip/irq-davinci-cp-intc.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 include/linux/irqchip/irq-davinci-cp-intc.h
include/linux/irqchip/irq-davinci-cp-intc.h new file +16 -0
new file mode 100644
index 000000000000..9b0c7d6189eb
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2019 Texas Instruments
+ */
+
+#ifndef _LINUX_IRQ_DAVINCI_CP_INTC_
+#define _LINUX_IRQ_DAVINCI_CP_INTC_
+
+#include <linux/ioport.h>
+
+struct davinci_cp_intc_config {
+	struct resource reg;
+	unsigned int num_irqs;
+};
+
+#endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */
Signature · 1 line
2.20.1
#56 lore raw

Re: [PATCH 21/35] ARM: davinci: cp-intc: add a new config structure

subject should probably be irqchip: rather than ARM:

Quoted 17 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add a config structure that will be used by cp-intc-based platforms. It contains the register range resource and the number of interrupts.

---
  include/linux/irqchip/irq-davinci-cp-intc.h | 16 ++++++++++++++++
  1 file changed, 16 insertions(+)

create mode 100644 include/linux/irqchip/irq-davinci-cp-intc.h

include/linux/irqchip/irq-davinci-cp-intc.h new file +0 -0
new file mode 100644
index 000000000000..9b0c7d6189eb

include/linux/irqchip/irq-davinci-cp-intc.h line 1

Quoted 1 line
include/linux/irqchip/irq-davinci-cp-intc.h new file +1 -0
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */

GPL-2.0-or-later ?

Quoted 16 lines
include/linux/irqchip/irq-davinci-cp-intc.h new file +15 -0
+/*
+ * Copyright (C) 2019 Texas Instruments
+ */
+
+#ifndef _LINUX_IRQ_DAVINCI_CP_INTC_
+#define _LINUX_IRQ_DAVINCI_CP_INTC_
+
+#include <linux/ioport.h>
+
+struct davinci_cp_intc_config {
+	struct resource reg;
+	unsigned int num_irqs;
+};
+
+#endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */
#57 lore raw

PATCH 22/35 ARM: davinci: cp-intc: add the new config structures for da8xx SoCs

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the new-style config structures for dm* SoCs. They will be used once we make the cp-intc driver stop using davinci_soc_info.

---
 arch/arm/mach-davinci/da830.c | 10 ++++++++++
 arch/arm/mach-davinci/da850.c | 10 ++++++++++
 2 files changed, 20 insertions(+)
arch/arm/mach-davinci/da830.c +10 -0
index 8b9220badef5..6d3da4364f7a 100644
@@ -12,6 +12,7 @@
 #include <linux/clk/davinci.h>
 #include <linux/gpio.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-cp-intc.h>
 #include <linux/platform_data/gpio-davinci.h>
 
 #include <asm/mach/map.h>
@@ -742,6 +743,15 @@ void __init da830_init(void)
 	WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
 }
 
+static const struct davinci_cp_intc_config da830_cp_intc_config = {
+	.reg = {
+		.start		= DA8XX_CP_INTC_BASE,
+		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= DA830_N_CP_INTC_IRQ,
+};
+
 void __init da830_init_irqs(void)
 {
 	cp_intc_init();
arch/arm/mach-davinci/da850.c +10 -0
index 9f48e1ac61fb..5e7f2c962abf 100644
@@ -18,6 +18,7 @@
 #include <linux/cpufreq.h>
 #include <linux/gpio.h>
 #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-cp-intc.h>
 #include <linux/mfd/da8xx-cfgchip.h>
 #include <linux/platform_data/clk-da8xx-cfgchip.h>
 #include <linux/platform_data/clk-davinci-pll.h>
@@ -671,6 +672,15 @@ void __init da850_init(void)
 	WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module");
 }
 
+static const struct davinci_cp_intc_config da850_cp_intc_config = {
+	.reg = {
+		.start		= DA8XX_CP_INTC_BASE,
+		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= DA850_N_CP_INTC_IRQ,
+};
+
 void __init da850_init_irqs(void)
 {
 	cp_intc_init();
Signature · 1 line
2.20.1
#58 lore raw

Re: [PATCH 22/35] ARM: davinci: cp-intc: add the new config structures for da8xx SoCs

Quoted 24 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the new-style config structures for dm* SoCs. They will be used once we make the cp-intc driver stop using davinci_soc_info.

---
  arch/arm/mach-davinci/da830.c | 10 ++++++++++
  arch/arm/mach-davinci/da850.c | 10 ++++++++++
  2 files changed, 20 insertions(+)
arch/arm/mach-davinci/da830.c +1 -0
index 8b9220badef5..6d3da4364f7a 100644
@@ -12,6 +12,7 @@
  #include <linux/clk/davinci.h>
  #include <linux/gpio.h>
  #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-cp-intc.h>
  #include <linux/platform_data/gpio-davinci.h>
 
  #include <asm/mach/map.h>

arch/arm/mach-davinci/da830.c void __init da830_init(void) · line 749

Quoted 7 lines
arch/arm/mach-davinci/da830.c +4 -0
@@ -742,6 +743,15 @@ void __init da830_init(void)
  	WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module");
  }
 
+static const struct davinci_cp_intc_config da830_cp_intc_config = {
+	.reg = {
+		.start		= DA8XX_CP_INTC_BASE,
+		.end		= DA8XX_CP_INTC_BASE + SZ_8K,

Missing minus one?

+ .end = DA8XX_CP_INTC_BASE + SZ_8K - 1,

Quoted 21 lines
arch/arm/mach-davinci/da830.c +5 -0
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= DA830_N_CP_INTC_IRQ,
+};
+
  void __init da830_init_irqs(void)
  {
  	cp_intc_init();
arch/arm/mach-davinci/da850.c +1 -0
index 9f48e1ac61fb..5e7f2c962abf 100644
@@ -18,6 +18,7 @@
  #include <linux/cpufreq.h>
  #include <linux/gpio.h>
  #include <linux/init.h>
+#include <linux/irqchip/irq-davinci-cp-intc.h>
  #include <linux/mfd/da8xx-cfgchip.h>
  #include <linux/platform_data/clk-da8xx-cfgchip.h>
  #include <linux/platform_data/clk-davinci-pll.h>

arch/arm/mach-davinci/da850.c void __init da850_init(void) · line 678

Quoted 7 lines
arch/arm/mach-davinci/da850.c +4 -0
@@ -671,6 +672,15 @@ void __init da850_init(void)
  	WARN(!da8xx_syscfg1_base, "Unable to map syscfg1 module");
  }
 
+static const struct davinci_cp_intc_config da850_cp_intc_config = {
+	.reg = {
+		.start		= DA8XX_CP_INTC_BASE,
+		.end		= DA8XX_CP_INTC_BASE + SZ_8K,

same here

arch/arm/mach-davinci/da850.c void __init da850_init(void) · line 686

Quoted 9 lines
arch/arm/mach-davinci/da850.c +5 -0
+		.flags		= IORESOURCE_MEM,
+	},
+	.num_irqs		= DA850_N_CP_INTC_IRQ,
+};
+
  void __init da850_init_irqs(void)
  {
  	cp_intc_init();

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#59 lore raw

Re: [PATCH 22/35] ARM: davinci: cp-intc: add the new config structures for da8xx SoCs

In reply to Bartosz Golaszewski
Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the new-style config structures for dm* SoCs. They will be used

da* SoCs.

Quoted 7 lines

once we make the cp-intc driver stop using davinci_soc_info.

---
 arch/arm/mach-davinci/da830.c | 10 ++++++++++
 arch/arm/mach-davinci/da850.c | 10 ++++++++++
 2 files changed, 20 insertions(+)

Thanks,
Sekhar

#60 lore raw

PATCH 23/35 ARM: davinci: cp-intc: use a common prefix for all symbols

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In preparation for moving the driver to drivers/irqchip do some
cleanup: use a common prefix for all symbols.

---
 arch/arm/mach-davinci/cp_intc.c             | 143 ++++++++++----------
 arch/arm/mach-davinci/da830.c               |   2 +-
 arch/arm/mach-davinci/da850.c               |   2 +-
 arch/arm/mach-davinci/include/mach/common.h |   2 +-
 4 files changed, 77 insertions(+), 72 deletions(-)
arch/arm/mach-davinci/cp_intc.c +74 -69
index 817b7616753c..3a99a3146d8e 100644
@@ -22,60 +22,65 @@
 #include <asm/exception.h>
 #include <mach/common.h>
 
-#define CP_INTC_CTRL			0x04
-#define CP_INTC_HOST_CTRL		0x0C
-#define CP_INTC_GLOBAL_ENABLE		0x10
-#define CP_INTC_SYS_STAT_IDX_CLR	0x24
-#define CP_INTC_SYS_ENABLE_IDX_SET	0x28
-#define CP_INTC_SYS_ENABLE_IDX_CLR	0x2C
-#define CP_INTC_HOST_ENABLE_IDX_SET	0x34
-#define CP_INTC_HOST_ENABLE_IDX_CLR	0x38
-#define CP_INTC_PRIO_IDX		0x80
-#define CP_INTC_SYS_STAT_CLR(n)		(0x0280 + (n << 2))
-#define CP_INTC_SYS_ENABLE_CLR(n)	(0x0380 + (n << 2))
-#define CP_INTC_CHAN_MAP(n)		(0x0400 + (n << 2))
-#define CP_INTC_SYS_POLARITY(n)		(0x0D00 + (n << 2))
-#define CP_INTC_SYS_TYPE(n)		(0x0D80 + (n << 2))
-#define CP_INTC_HOST_ENABLE(n)		(0x1500 + (n << 2))
-
-static void __iomem *davinci_intc_base;
-
-static inline unsigned int cp_intc_read(unsigned offset)
+#define DAVINCI_CP_INTC_CTRL			0x04
+#define DAVINCI_CP_INTC_HOST_CTRL		0x0C
+#define DAVINCI_CP_INTC_GLOBAL_ENABLE		0x10
+#define DAVINCI_CP_INTC_SYS_STAT_IDX_CLR	0x24
+#define DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET	0x28
+#define DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR	0x2C
+#define DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET	0x34
+#define DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR	0x38
+#define DAVINCI_CP_INTC_PRIO_IDX		0x80
+#define DAVINCI_CP_INTC_SYS_STAT_CLR(n)		(0x0280 + (n << 2))
+#define DAVINCI_CP_INTC_SYS_ENABLE_CLR(n)	(0x0380 + (n << 2))
+#define DAVINCI_CP_INTC_CHAN_MAP(n)		(0x0400 + (n << 2))
+#define DAVINCI_CP_INTC_SYS_POLARITY(n)		(0x0D00 + (n << 2))
+#define DAVINCI_CP_INTC_SYS_TYPE(n)		(0x0D80 + (n << 2))
+#define DAVINCI_CP_INTC_HOST_ENABLE(n)		(0x1500 + (n << 2))
+
+static void __iomem *davinci_cp_intc_base;
+static struct irq_domain *davinci_cp_intc_irq_domain;
+
+static inline unsigned int davinci_cp_intc_read(unsigned int offset)
 {
-	return __raw_readl(davinci_intc_base + offset);
+	return __raw_readl(davinci_cp_intc_base + offset);
 }
 
-static inline void cp_intc_write(unsigned long value, unsigned offset)
+static inline void davinci_cp_intc_write(unsigned long value,
+					 unsigned int offset)
 {
-	__raw_writel(value, davinci_intc_base + offset);
+	__raw_writel(value, davinci_cp_intc_base + offset);
 }
 
-static void cp_intc_ack_irq(struct irq_data *d)
+static void davinci_cp_intc_ack_irq(struct irq_data *d)
 {
-	cp_intc_write(d->hwirq, CP_INTC_SYS_STAT_IDX_CLR);
+	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_STAT_IDX_CLR);
 }
 
 /* Disable interrupt */
-static void cp_intc_mask_irq(struct irq_data *d)
+static void davinci_cp_intc_mask_irq(struct irq_data *d)
 {
 	/* XXX don't know why we need to disable nIRQ here... */
-	cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_CLR);
-	cp_intc_write(d->hwirq, CP_INTC_SYS_ENABLE_IDX_CLR);
-	cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET);
+	davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR);
+	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR);
+	davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET);
 }
 
 /* Enable interrupt */
 static void cp_intc_unmask_irq(struct irq_data *d)
 {
-	cp_intc_write(d->hwirq, CP_INTC_SYS_ENABLE_IDX_SET);
+	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET);
 }
 
-static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type)
+static int davinci_cp_intc_set_irq_type(struct irq_data *d,
+					unsigned int flow_type)
 {
 	unsigned reg		= BIT_WORD(d->hwirq);
 	unsigned mask		= BIT_MASK(d->hwirq);
-	unsigned polarity	= cp_intc_read(CP_INTC_SYS_POLARITY(reg));
-	unsigned type		= cp_intc_read(CP_INTC_SYS_TYPE(reg));
+	unsigned polarity	= davinci_cp_intc_read(
+					DAVINCI_CP_INTC_SYS_POLARITY(reg));
+	unsigned type		= davinci_cp_intc_read(
+					DAVINCI_CP_INTC_SYS_TYPE(reg));
 
 	switch (flow_type) {
 	case IRQ_TYPE_EDGE_RISING:
@@ -98,51 +103,49 @@ static int cp_intc_set_irq_type(struct irq_data *d, unsigned int flow_type)
 		return -EINVAL;
 	}
 
-	cp_intc_write(polarity, CP_INTC_SYS_POLARITY(reg));
-	cp_intc_write(type, CP_INTC_SYS_TYPE(reg));
+	davinci_cp_intc_write(polarity, DAVINCI_CP_INTC_SYS_POLARITY(reg));
+	davinci_cp_intc_write(type, DAVINCI_CP_INTC_SYS_TYPE(reg));
 
 	return 0;
 }
 
-static struct irq_chip cp_intc_irq_chip = {
+static struct irq_chip davinci_cp_intc_irq_chip = {
 	.name		= "cp_intc",
-	.irq_ack	= cp_intc_ack_irq,
-	.irq_mask	= cp_intc_mask_irq,
+	.irq_ack	= davinci_cp_intc_ack_irq,
+	.irq_mask	= davinci_cp_intc_mask_irq,
 	.irq_unmask	= cp_intc_unmask_irq,
-	.irq_set_type	= cp_intc_set_irq_type,
+	.irq_set_type	= davinci_cp_intc_set_irq_type,
 	.flags		= IRQCHIP_SKIP_SET_WAKE,
 };
 
-static struct irq_domain *cp_intc_domain;
-
 static asmlinkage void __exception_irq_entry
-cp_intc_handle_irq(struct pt_regs *regs)
+davinci_cp_intc_handle_irq(struct pt_regs *regs)
 {
-	int irqnr = cp_intc_read(CP_INTC_PRIO_IDX);
+	int irqnr = davinci_cp_intc_read(DAVINCI_CP_INTC_PRIO_IDX);
 
 	irqnr &= 0xff;
 
-	handle_domain_irq(cp_intc_domain, irqnr, regs);
+	handle_domain_irq(davinci_cp_intc_irq_domain, irqnr, regs);
 }
 
-static int cp_intc_host_map(struct irq_domain *h, unsigned int virq,
+static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq,
 			  irq_hw_number_t hw)
 {
 	pr_debug("cp_intc_host_map(%d, 0x%lx)\n", virq, hw);
 
-	irq_set_chip(virq, &cp_intc_irq_chip);
+	irq_set_chip(virq, &davinci_cp_intc_irq_chip);
 	irq_set_probe(virq);
 	irq_set_handler(virq, handle_edge_irq);
 	return 0;
 }
 
-static const struct irq_domain_ops cp_intc_host_ops = {
-	.map = cp_intc_host_map,
+static const struct irq_domain_ops davinci_cp_intc_irq_domain_ops = {
+	.map = davinci_cp_intc_host_map,
 	.xlate = irq_domain_xlate_onetwocell,
 };
 
-static int __init cp_intc_of_init(struct device_node *node,
-				  struct device_node *parent)
+static int __init davinci_cp_intc_of_init(struct device_node *node,
+					  struct device_node *parent)
 {
 	u32 num_irq		= davinci_soc_info.intc_irq_num;
 	u8 *irq_prio		= davinci_soc_info.intc_irq_prios;
@@ -150,35 +153,35 @@ static int __init cp_intc_of_init(struct device_node *node,
 	int i, irq_base;
 
 	if (node) {
-		davinci_intc_base = of_iomap(node, 0);
+		davinci_cp_intc_base = of_iomap(node, 0);
 		if (of_property_read_u32(node, "ti,intc-size", &num_irq))
 			pr_warn("unable to get intc-size, default to %d\n",
 				num_irq);
 	} else {
-		davinci_intc_base = ioremap(davinci_soc_info.intc_base, SZ_8K);
+		davinci_cp_intc_base = ioremap(davinci_soc_info.intc_base, SZ_8K);
 	}
-	if (WARN_ON(!davinci_intc_base))
+	if (WARN_ON(!davinci_cp_intc_base))
 		return -EINVAL;
 
-	cp_intc_write(0, CP_INTC_GLOBAL_ENABLE);
+	davinci_cp_intc_write(0, DAVINCI_CP_INTC_GLOBAL_ENABLE);
 
 	/* Disable all host interrupts */
-	cp_intc_write(0, CP_INTC_HOST_ENABLE(0));
+	davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_ENABLE(0));
 
 	/* Disable system interrupts */
 	for (i = 0; i < num_reg; i++)
-		cp_intc_write(~0, CP_INTC_SYS_ENABLE_CLR(i));
+		davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_ENABLE_CLR(i));
 
 	/* Set to normal mode, no nesting, no priority hold */
-	cp_intc_write(0, CP_INTC_CTRL);
-	cp_intc_write(0, CP_INTC_HOST_CTRL);
+	davinci_cp_intc_write(0, DAVINCI_CP_INTC_CTRL);
+	davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_CTRL);
 
 	/* Clear system interrupt status */
 	for (i = 0; i < num_reg; i++)
-		cp_intc_write(~0, CP_INTC_SYS_STAT_CLR(i));
+		davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_STAT_CLR(i));
 
 	/* Enable nIRQ (what about nFIQ?) */
-	cp_intc_write(1, CP_INTC_HOST_ENABLE_IDX_SET);
+	davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET);
 
 	/*
 	 * Priority is determined by host channel: lower channel number has
@@ -197,7 +200,7 @@ static int __init cp_intc_of_init(struct device_node *node,
 					val |= irq_prio[k] << 24;
 			}
 
-			cp_intc_write(val, CP_INTC_CHAN_MAP(i));
+			davinci_cp_intc_write(val, DAVINCI_CP_INTC_CHAN_MAP(i));
 		}
 	} else	{
 		/*
@@ -206,7 +209,8 @@ static int __init cp_intc_of_init(struct device_node *node,
 		 * are mapped to nIRQ.
 		 */
 		for (i = 0; i < num_reg; i++)
-			cp_intc_write(0x0f0f0f0f, CP_INTC_CHAN_MAP(i));
+			davinci_cp_intc_write(0x0f0f0f0f,
+					      DAVINCI_CP_INTC_CHAN_MAP(i));
 	}
 
 	irq_base = irq_alloc_descs(-1, 0, num_irq, 0);
@@ -216,25 +220,26 @@ static int __init cp_intc_of_init(struct device_node *node,
 	}
 
 	/* create a legacy host */
-	cp_intc_domain = irq_domain_add_legacy(node, num_irq,
-					irq_base, 0, &cp_intc_host_ops, NULL);
+	davinci_cp_intc_irq_domain = irq_domain_add_legacy(
+					node, num_irq, irq_base, 0,
+					&davinci_cp_intc_irq_domain_ops, NULL);
 
-	if (!cp_intc_domain) {
+	if (!davinci_cp_intc_irq_domain) {
 		pr_err("cp_intc: failed to allocate irq host!\n");
 		return -EINVAL;
 	}
 
-	set_handle_irq(cp_intc_handle_irq);
+	set_handle_irq(davinci_cp_intc_handle_irq);
 
 	/* Enable global interrupt */
-	cp_intc_write(1, CP_INTC_GLOBAL_ENABLE);
+	davinci_cp_intc_write(1, DAVINCI_CP_INTC_GLOBAL_ENABLE);
 
 	return 0;
 }
 
-void __init cp_intc_init(void)
+void __init davinci_cp_intc_init(void)
 {
-	cp_intc_of_init(NULL, NULL);
+	davinci_cp_intc_of_init(NULL, NULL);
 }
 
-IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", cp_intc_of_init);
+IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", davinci_cp_intc_of_init);
arch/arm/mach-davinci/da830.c +1 -1
index 6d3da4364f7a..565c306e5252 100644
@@ -754,7 +754,7 @@ static const struct davinci_cp_intc_config da830_cp_intc_config = {
 
 void __init da830_init_irqs(void)
 {
-	cp_intc_init();
+	davinci_cp_intc_init();
 }
 
 void __init da830_init_time(void)
arch/arm/mach-davinci/da850.c +1 -1
index 5e7f2c962abf..794ddbe78534 100644
@@ -683,7 +683,7 @@ static const struct davinci_cp_intc_config da850_cp_intc_config = {
 
 void __init da850_init_irqs(void)
 {
-	cp_intc_init();
+	davinci_cp_intc_init();
 }
 
 void __init da850_init_time(void)
arch/arm/mach-davinci/include/mach/common.h +1 -1
index 4177a71db64c..0a6607ea4560 100644
@@ -17,7 +17,7 @@
 #include <linux/types.h>
 #include <linux/reboot.h>
 
-void cp_intc_init(void);
+void davinci_cp_intc_init(void);
 void davinci_timer_init(struct clk *clk);
 
 struct davinci_timer_instance {
Signature · 1 line
2.20.1
#62 lore raw

Re: [PATCH 23/35] ARM: davinci: cp-intc: use a common prefix for all symbols

In reply to Bartosz Golaszewski
Quoted 16 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

In preparation for moving the driver to drivers/irqchip do some
cleanup: use a common prefix for all symbols.

---
 arch/arm/mach-davinci/cp_intc.c             | 143 ++++++++++----------
 arch/arm/mach-davinci/da830.c               |   2 +-
 arch/arm/mach-davinci/da850.c               |   2 +-
 arch/arm/mach-davinci/include/mach/common.h |   2 +-
 4 files changed, 77 insertions(+), 72 deletions(-)

/* Enable interrupt */
static void cp_intc_unmask_irq(struct irq_data *d) {

arch/arm/mach-davinci/cp_intc.c line 73

Quoted 3 lines
arch/arm/mach-davinci/cp_intc.c +1 -1
-	cp_intc_write(d->hwirq, CP_INTC_SYS_ENABLE_IDX_SET);
+	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET);
 }

For consistency, can you please add davinci_ prefix to this function too?

Thanks,
Sekhar

#63 lore raw

PATCH 24/35 ARM: davinci: cp-intc: convert all hex numbers to lowercase

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Use lowercase letters in hexadecimal numbers as is done in most of the kernel code base.

---
 arch/arm/mach-davinci/cp_intc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-davinci/cp_intc.c +4 -4
index 3a99a3146d8e..1f55d68672db 100644
@@ -23,19 +23,19 @@
 #include <mach/common.h>
 
 #define DAVINCI_CP_INTC_CTRL			0x04
-#define DAVINCI_CP_INTC_HOST_CTRL		0x0C
+#define DAVINCI_CP_INTC_HOST_CTRL		0x0c
 #define DAVINCI_CP_INTC_GLOBAL_ENABLE		0x10
 #define DAVINCI_CP_INTC_SYS_STAT_IDX_CLR	0x24
 #define DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET	0x28
-#define DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR	0x2C
+#define DAVINCI_CP_INTC_SYS_ENABLE_IDX_CLR	0x2c
 #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET	0x34
 #define DAVINCI_CP_INTC_HOST_ENABLE_IDX_CLR	0x38
 #define DAVINCI_CP_INTC_PRIO_IDX		0x80
 #define DAVINCI_CP_INTC_SYS_STAT_CLR(n)		(0x0280 + (n << 2))
 #define DAVINCI_CP_INTC_SYS_ENABLE_CLR(n)	(0x0380 + (n << 2))
 #define DAVINCI_CP_INTC_CHAN_MAP(n)		(0x0400 + (n << 2))
-#define DAVINCI_CP_INTC_SYS_POLARITY(n)		(0x0D00 + (n << 2))
-#define DAVINCI_CP_INTC_SYS_TYPE(n)		(0x0D80 + (n << 2))
+#define DAVINCI_CP_INTC_SYS_POLARITY(n)		(0x0d00 + (n << 2))
+#define DAVINCI_CP_INTC_SYS_TYPE(n)		(0x0d80 + (n << 2))
 #define DAVINCI_CP_INTC_HOST_ENABLE(n)		(0x1500 + (n << 2))
 
 static void __iomem *davinci_cp_intc_base;
Signature · 1 line
2.20.1
#65 lore raw

PATCH 25/35 ARM: davinci: cp-intc: use the new-style config structure

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Modify the cp-intc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_cp_intc_init() to irq-davinci-cp-intc.h and make it take the new config structure as parameter. Convert all users to the new version.

Also: since the two da8xx SoCs default all irq priorities to 7, just drop the priority configuration at all and hardcode the channels to 7.

It will simplify the driver code and make our lives easier when it comes to device-tree support.

---
 arch/arm/mach-davinci/cp_intc.c             | 92 +++++++++------------
 arch/arm/mach-davinci/da830.c               |  2 +-
 arch/arm/mach-davinci/da850.c               |  2 +-
 arch/arm/mach-davinci/include/mach/common.h |  1 -
 include/linux/irqchip/irq-davinci-cp-intc.h |  2 +
 5 files changed, 44 insertions(+), 55 deletions(-)
arch/arm/mach-davinci/cp_intc.c +40 -52
index 1f55d68672db..2ce0b7653c88 100644
@@ -13,6 +13,7 @@
 #include <linux/init.h>
 #include <linux/irq.h>
 #include <linux/irqchip.h>
+#include <linux/irqchip/irq-davinci-cp-intc.h>
 #include <linux/irqdomain.h>
 #include <linux/io.h>
 #include <linux/of.h>
@@ -144,22 +145,15 @@ static const struct irq_domain_ops davinci_cp_intc_irq_domain_ops = {
 	.xlate = irq_domain_xlate_onetwocell,
 };
 
-static int __init davinci_cp_intc_of_init(struct device_node *node,
-					  struct device_node *parent)
+static int __init
+davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
+			struct device_node *node)
 {
-	u32 num_irq		= davinci_soc_info.intc_irq_num;
-	u8 *irq_prio		= davinci_soc_info.intc_irq_prios;
-	unsigned num_reg	= BITS_TO_LONGS(num_irq);
-	int i, irq_base;
-
-	if (node) {
-		davinci_cp_intc_base = of_iomap(node, 0);
-		if (of_property_read_u32(node, "ti,intc-size", &num_irq))
-			pr_warn("unable to get intc-size, default to %d\n",
-				num_irq);
-	} else {
-		davinci_cp_intc_base = ioremap(davinci_soc_info.intc_base, SZ_8K);
-	}
+	unsigned int num_regs = BITS_TO_LONGS(config->num_irqs);
+	int offset, irq_base;
+
+	davinci_cp_intc_base = ioremap(config->reg.start,
+				       resource_size(&config->reg));
 	if (WARN_ON(!davinci_cp_intc_base))
 		return -EINVAL;
 
@@ -169,51 +163,29 @@ static int __init davinci_cp_intc_of_init(struct device_node *node,
 	davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_ENABLE(0));
 
 	/* Disable system interrupts */
-	for (i = 0; i < num_reg; i++)
-		davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_ENABLE_CLR(i));
+	for (offset = 0; offset < num_regs; offset++)
+		davinci_cp_intc_write(~0,
+			DAVINCI_CP_INTC_SYS_ENABLE_CLR(offset));
 
 	/* Set to normal mode, no nesting, no priority hold */
 	davinci_cp_intc_write(0, DAVINCI_CP_INTC_CTRL);
 	davinci_cp_intc_write(0, DAVINCI_CP_INTC_HOST_CTRL);
 
 	/* Clear system interrupt status */
-	for (i = 0; i < num_reg; i++)
-		davinci_cp_intc_write(~0, DAVINCI_CP_INTC_SYS_STAT_CLR(i));
+	for (offset = 0; offset < num_regs; offset++)
+		davinci_cp_intc_write(~0,
+			DAVINCI_CP_INTC_SYS_STAT_CLR(offset));
 
 	/* Enable nIRQ (what about nFIQ?) */
 	davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET);
 
-	/*
-	 * Priority is determined by host channel: lower channel number has
-	 * higher priority i.e. channel 0 has highest priority and channel 31
-	 * had the lowest priority.
-	 */
-	num_reg = (num_irq + 3) >> 2;	/* 4 channels per register */
-	if (irq_prio) {
-		unsigned j, k;
-		u32 val;
-
-		for (k = i = 0; i < num_reg; i++) {
-			for (val = j = 0; j < 4; j++, k++) {
-				val >>= 8;
-				if (k < num_irq)
-					val |= irq_prio[k] << 24;
-			}
-
-			davinci_cp_intc_write(val, DAVINCI_CP_INTC_CHAN_MAP(i));
-		}
-	} else	{
-		/*
-		 * Default everything to channel 15 if priority not specified.
-		 * Note that channel 0-1 are mapped to nFIQ and channels 2-31
-		 * are mapped to nIRQ.
-		 */
-		for (i = 0; i < num_reg; i++)
-			davinci_cp_intc_write(0x0f0f0f0f,
-					      DAVINCI_CP_INTC_CHAN_MAP(i));
-	}
+	/* Default all priorities to channel 7. */
+	num_regs = (config->num_irqs + 3) >> 2;	/* 4 channels per register */
+	for (offset = 0; offset < num_regs; offset++)
+		davinci_cp_intc_write(0x07070707,
+			DAVINCI_CP_INTC_CHAN_MAP(offset));
 
-	irq_base = irq_alloc_descs(-1, 0, num_irq, 0);
+	irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0);
 	if (irq_base < 0) {
 		pr_warn("Couldn't allocate IRQ numbers\n");
 		irq_base = 0;
@@ -221,7 +193,7 @@ static int __init davinci_cp_intc_of_init(struct device_node *node,
 
 	/* create a legacy host */
 	davinci_cp_intc_irq_domain = irq_domain_add_legacy(
-					node, num_irq, irq_base, 0,
+					node, config->num_irqs, irq_base, 0,
 					&davinci_cp_intc_irq_domain_ops, NULL);
 
 	if (!davinci_cp_intc_irq_domain) {
@@ -237,9 +209,25 @@ static int __init davinci_cp_intc_of_init(struct device_node *node,
 	return 0;
 }
 
-void __init davinci_cp_intc_init(void)
+int __init davinci_cp_intc_init(const struct davinci_cp_intc_config *config)
 {
-	davinci_cp_intc_of_init(NULL, NULL);
+	return davinci_cp_intc_do_init(config, NULL);
 }
 
+static int __init davinci_cp_intc_of_init(struct device_node *node,
+					  struct device_node *parent)
+{
+	struct davinci_cp_intc_config config = { };
+	int rv;
+
+	rv = of_address_to_resource(node, 0, &config.reg);
+	if (WARN_ON(rv))
+		return rv;
+
+	rv = of_property_read_u32(node, "ti,intc-size", &config.num_irqs);
+	if (WARN_ON(rv))
+		return rv;
+
+	return davinci_cp_intc_do_init(&config, node);
+}
 IRQCHIP_DECLARE(cp_intc, "ti,cp-intc", davinci_cp_intc_of_init);
arch/arm/mach-davinci/da830.c +1 -1
index 565c306e5252..bdbd66ffd2ea 100644
@@ -754,7 +754,7 @@ static const struct davinci_cp_intc_config da830_cp_intc_config = {
 
 void __init da830_init_irqs(void)
 {
-	davinci_cp_intc_init();
+	davinci_cp_intc_init(&da830_cp_intc_config);
 }
 
 void __init da830_init_time(void)
arch/arm/mach-davinci/da850.c +1 -1
index 794ddbe78534..fe370e85aeb1 100644
@@ -683,7 +683,7 @@ static const struct davinci_cp_intc_config da850_cp_intc_config = {
 
 void __init da850_init_irqs(void)
 {
-	davinci_cp_intc_init();
+	davinci_cp_intc_init(&da850_cp_intc_config);
 }
 
 void __init da850_init_time(void)
arch/arm/mach-davinci/include/mach/common.h +0 -1
index 0a6607ea4560..9e06974c85bb 100644
@@ -17,7 +17,6 @@
 #include <linux/types.h>
 #include <linux/reboot.h>
 
-void davinci_cp_intc_init(void);
 void davinci_timer_init(struct clk *clk);
 
 struct davinci_timer_instance {
include/linux/irqchip/irq-davinci-cp-intc.h +2 -0
index 9b0c7d6189eb..596145c2f3d1 100644
@@ -13,4 +13,6 @@ struct davinci_cp_intc_config {
 	unsigned int num_irqs;
 };
 
+int davinci_cp_intc_init(const struct davinci_cp_intc_config *config);
+
 #endif /* _LINUX_IRQ_DAVINCI_CP_INTC_ */
Signature · 1 line
2.20.1
#66 lore raw

Re: [PATCH 25/35] ARM: davinci: cp-intc: use the new-style config structure

Quoted 10 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Modify the cp-intc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_cp_intc_init() to irq-davinci-cp-intc.h and make it take the new config structure as parameter. Convert all users to the new version.

Also: since the two da8xx SoCs default all irq priorities to 7, just drop the priority configuration at all and hardcode the channels to 7.

As mentioned in a comment on a different patch, this isn't strictly true (although in practice, it probably is).

This patch deletes a code path with the comment "Default everything to channel 15 if priority not specified.", so it is possible (although unlikely) that this patch could change a priority of some IRQ that is being used.

Quoted 6 lines

It will simplify the driver code and make our lives easier when it comes to device-tree support.

---

#67 lore raw

Re: [PATCH 25/35] ARM: davinci: cp-intc: use the new-style config structure

wt., 5 lut 2019 o 01:29 David Lechner <[email protected]> napisał(a):

Quoted 13 lines · Bartosz Golaszewski
Quoted 10 lines

From: Bartosz Golaszewski <[email protected]>

Modify the cp-intc driver to take all its configuration from the new config structure. Stop referencing davinci_soc_info in any way. Move the declaration for davinci_cp_intc_init() to irq-davinci-cp-intc.h and make it take the new config structure as parameter. Convert all users to the new version.

Also: since the two da8xx SoCs default all irq priorities to 7, just drop the priority configuration at all and hardcode the channels to 7.

Quoted 8 lines

As mentioned in a comment on a different patch, this isn't strictly true (although in practice, it probably is).

This patch deletes a code path with the comment "Default everything to channel 15 if priority not specified.", so it is possible (although unlikely) that this patch could change a priority of some IRQ that is being used.

This only happens if no priorities are specified. Otherwise we just iterate over the provided array and set priorities for all interrupts.

Bart

Quoted 6 lines
Quoted 6 lines

It will simplify the driver code and make our lives easier when it comes to device-tree support.

---

#68 lore raw

Re: [PATCH 25/35] ARM: davinci: cp-intc: use the new-style config structure

In reply to Bartosz Golaszewski

arch/arm/mach-davinci/cp_intc.c static int __init davinci_cp_intc_of_init(struct device_node *node, · line 221

Quoted 5 lines · Bartosz Golaszewski
arch/arm/mach-davinci/cp_intc.c +5 -0
+static int __init davinci_cp_intc_of_init(struct device_node *node,
+					  struct device_node *parent)
+{
+	struct davinci_cp_intc_config config = { };
+	int rv;

I think you agreed to use 'ret' elsewhere. If yes, please change this too for consistency.

Thanks,
Sekhar

#69 lore raw

PATCH 26/35 ARM: davinci: cp-intc: improve coding style

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Drop tabs from variable initialization. Arrange variables in reverse christmas-tree order. Add a newline before a return.

---
 arch/arm/mach-davinci/cp_intc.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
arch/arm/mach-davinci/cp_intc.c +7 -6
index 2ce0b7653c88..4cd515b507f4 100644
@@ -76,12 +76,12 @@ static void cp_intc_unmask_irq(struct irq_data *d)
 static int davinci_cp_intc_set_irq_type(struct irq_data *d,
 					unsigned int flow_type)
 {
-	unsigned reg		= BIT_WORD(d->hwirq);
-	unsigned mask		= BIT_MASK(d->hwirq);
-	unsigned polarity	= davinci_cp_intc_read(
-					DAVINCI_CP_INTC_SYS_POLARITY(reg));
-	unsigned type		= davinci_cp_intc_read(
-					DAVINCI_CP_INTC_SYS_TYPE(reg));
+	unsigned int reg, mask, polarity, type;
+
+	reg = BIT_WORD(d->hwirq);
+	mask = BIT_MASK(d->hwirq);
+	polarity = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_POLARITY(reg));
+	type = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_TYPE(reg));
 
 	switch (flow_type) {
 	case IRQ_TYPE_EDGE_RISING:
@@ -137,6 +137,7 @@ static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq,
 	irq_set_chip(virq, &davinci_cp_intc_irq_chip);
 	irq_set_probe(virq);
 	irq_set_handler(virq, handle_edge_irq);
+
 	return 0;
 }
 
Signature · 1 line
2.20.1
#70 lore raw

Re: [PATCH 26/35] ARM: davinci: cp-intc: improve coding style

Quoted 4 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Drop tabs from variable initialization. Arrange variables in reverse christmas-tree order.

I'm not sure this description is correct.

Quoted 39 lines

Add a newline before a return.

---
  arch/arm/mach-davinci/cp_intc.c | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)
arch/arm/mach-davinci/cp_intc.c +7 -6
index 2ce0b7653c88..4cd515b507f4 100644
@@ -76,12 +76,12 @@ static void cp_intc_unmask_irq(struct irq_data *d)
  static int davinci_cp_intc_set_irq_type(struct irq_data *d,
  					unsigned int flow_type)
  {
-	unsigned reg		= BIT_WORD(d->hwirq);
-	unsigned mask		= BIT_MASK(d->hwirq);
-	unsigned polarity	= davinci_cp_intc_read(
-					DAVINCI_CP_INTC_SYS_POLARITY(reg));
-	unsigned type		= davinci_cp_intc_read(
-					DAVINCI_CP_INTC_SYS_TYPE(reg));
+	unsigned int reg, mask, polarity, type;
+
+	reg = BIT_WORD(d->hwirq);
+	mask = BIT_MASK(d->hwirq);
+	polarity = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_POLARITY(reg));
+	type = davinci_cp_intc_read(DAVINCI_CP_INTC_SYS_TYPE(reg));
 
  	switch (flow_type) {
  	case IRQ_TYPE_EDGE_RISING:
@@ -137,6 +137,7 @@ static int davinci_cp_intc_host_map(struct irq_domain *h, unsigned int virq,
  	irq_set_chip(virq, &davinci_cp_intc_irq_chip);
  	irq_set_probe(virq);
  	irq_set_handler(virq, handle_edge_irq);
+
  	return 0;
  }
 
#71 lore raw

PATCH 27/35 ARM: davinci: cp-intc: unify error handling

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Use WARN_ON() on eny error in cp-intc initialization and drop all custom error messages.

---
 arch/arm/mach-davinci/cp_intc.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
arch/arm/mach-davinci/cp_intc.c +3 -7
index 4cd515b507f4..8d751318682d 100644
@@ -187,20 +187,16 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 			DAVINCI_CP_INTC_CHAN_MAP(offset));
 
 	irq_base = irq_alloc_descs(-1, 0, config->num_irqs, 0);
-	if (irq_base < 0) {
-		pr_warn("Couldn't allocate IRQ numbers\n");
-		irq_base = 0;
-	}
+	if (WARN_ON(irq_base < 0))
+		return irq_base;
 
 	/* create a legacy host */
 	davinci_cp_intc_irq_domain = irq_domain_add_legacy(
 					node, config->num_irqs, irq_base, 0,
 					&davinci_cp_intc_irq_domain_ops, NULL);
 
-	if (!davinci_cp_intc_irq_domain) {
-		pr_err("cp_intc: failed to allocate irq host!\n");
+	if (WARN_ON(!davinci_cp_intc_irq_domain))
 		return -EINVAL;
-	}
 
 	set_handle_irq(davinci_cp_intc_handle_irq);
 
Signature · 1 line
2.20.1
#73 lore raw

PATCH 28/35 ARM: davinci: cp-intc: remove unneeded include

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This header is no longer needed. Remove it.

---
 arch/arm/mach-davinci/cp_intc.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-davinci/cp_intc.c +0 -1
index 8d751318682d..812e49fcaa8b 100644
@@ -21,7 +21,6 @@
 #include <linux/of_irq.h>
 
 #include <asm/exception.h>
-#include <mach/common.h>
 
 #define DAVINCI_CP_INTC_CTRL			0x04
 #define DAVINCI_CP_INTC_HOST_CTRL		0x0c
Signature · 1 line
2.20.1
#74 lore raw

Re: [PATCH 28/35] ARM: davinci: cp-intc: remove unneeded include

Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This header is no longer needed. Remove it.

Is there another patch in this series that causes it to no longer be needed? If so, this patch could be squashed into that patch.

Quoted 19 lines
---
  arch/arm/mach-davinci/cp_intc.c | 1 -
  1 file changed, 1 deletion(-)
arch/arm/mach-davinci/cp_intc.c +0 -1
index 8d751318682d..812e49fcaa8b 100644
@@ -21,7 +21,6 @@
  #include <linux/of_irq.h>
 
  #include <asm/exception.h>
-#include <mach/common.h>
 
  #define DAVINCI_CP_INTC_CTRL			0x04
  #define DAVINCI_CP_INTC_HOST_CTRL		0x0c
#75 lore raw

PATCH 29/35 ARM: davinci: cp-intc: drop GPL license boilerplate

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Replace the GPLv2 license boilerplate with an SPDX identifier.

---
 arch/arm/mach-davinci/cp_intc.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)
arch/arm/mach-davinci/cp_intc.c +8 -10
index 812e49fcaa8b..780b3f57aa59 100644
@@ -1,13 +1,11 @@
-/*
- * TI Common Platform Interrupt Controller (cp_intc) driver
- *
- * Author: Steve Chen <[email protected]>
- * Copyright (C) 2008-2009, MontaVista Software, Inc. <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- */
+// SPDX-License-Identifier: GPL-2.0
+//
+// Author: Steve Chen <[email protected]>
+// Copyright (C) 2008-2009, MontaVista Software, Inc. <[email protected]>
+// Author: Bartosz Golaszewski <[email protected]>
+// Copyright (C) 2019, Texas Instruments
+//
+// TI Common Platform Interrupt Controller (cp_intc) driver
 
 #include <linux/export.h>
 #include <linux/init.h>
Signature · 1 line
2.20.1
#76 lore raw

Re: [PATCH 29/35] ARM: davinci: cp-intc: drop GPL license boilerplate

Quoted 3 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Replace the GPLv2 license boilerplate with an SPDX identifier.

Should also mention that you are adding an author and copyright.

Quoted 12 lines
---
  arch/arm/mach-davinci/cp_intc.c | 18 ++++++++----------
  1 file changed, 8 insertions(+), 10 deletions(-)
arch/arm/mach-davinci/cp_intc.c +0 -1
index 812e49fcaa8b..780b3f57aa59 100644
@@ -1,13 +1,11 @@
-/*

arch/arm/mach-davinci/cp_intc.c line 1

Quoted 10 lines
arch/arm/mach-davinci/cp_intc.c +1 -9
- * TI Common Platform Interrupt Controller (cp_intc) driver
- *
- * Author: Steve Chen <[email protected]>
- * Copyright (C) 2008-2009, MontaVista Software, Inc. <[email protected]>
- *
- * This file is licensed under the terms of the GNU General Public License
- * version 2. This program is licensed "as is" without any warranty of any
- * kind, whether express or implied.
- */
+// SPDX-License-Identifier: GPL-2.0

GPL-2.0-only ?

Quoted 11 lines
arch/arm/mach-davinci/cp_intc.c +7 -0
+//
+// Author: Steve Chen <[email protected]>
+// Copyright (C) 2008-2009, MontaVista Software, Inc. <[email protected]>
+// Author: Bartosz Golaszewski <[email protected]>
+// Copyright (C) 2019, Texas Instruments
+//
+// TI Common Platform Interrupt Controller (cp_intc) driver
 
  #include <linux/export.h>
  #include <linux/init.h>
#77 lore raw

PATCH 30/35 ARM: davinci: cp-intc: remove redundant comments

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We don't need comments explaining what functions with obvious names do.

---
 arch/arm/mach-davinci/cp_intc.c | 3 ---
 1 file changed, 3 deletions(-)
arch/arm/mach-davinci/cp_intc.c +0 -3
index 780b3f57aa59..b5ace86c419f 100644
@@ -55,7 +55,6 @@ static void davinci_cp_intc_ack_irq(struct irq_data *d)
 	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_STAT_IDX_CLR);
 }
 
-/* Disable interrupt */
 static void davinci_cp_intc_mask_irq(struct irq_data *d)
 {
 	/* XXX don't know why we need to disable nIRQ here... */
@@ -64,7 +63,6 @@ static void davinci_cp_intc_mask_irq(struct irq_data *d)
 	davinci_cp_intc_write(1, DAVINCI_CP_INTC_HOST_ENABLE_IDX_SET);
 }
 
-/* Enable interrupt */
 static void cp_intc_unmask_irq(struct irq_data *d)
 {
 	davinci_cp_intc_write(d->hwirq, DAVINCI_CP_INTC_SYS_ENABLE_IDX_SET);
@@ -187,7 +185,6 @@ davinci_cp_intc_do_init(const struct davinci_cp_intc_config *config,
 	if (WARN_ON(irq_base < 0))
 		return irq_base;
 
-	/* create a legacy host */
 	davinci_cp_intc_irq_domain = irq_domain_add_legacy(
 					node, config->num_irqs, irq_base, 0,
 					&davinci_cp_intc_irq_domain_ops, NULL);
Signature · 1 line
2.20.1
#79 lore raw

PATCH 31/35 irqchip: davinci-cp-intc: move the driver to drivers/irqchip

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The cp-intc driver has now been cleaned up. Move it to drivers/irqchip where it belongs.

---
 arch/arm/mach-davinci/Kconfig                             | 8 ++------
 arch/arm/mach-davinci/Makefile                            | 2 --
 drivers/irqchip/Kconfig                                   | 5 +++++
 drivers/irqchip/Makefile                                  | 1 +
 .../cp_intc.c => drivers/irqchip/irq-davinci-cp-intc.c    | 0
 5 files changed, 8 insertions(+), 8 deletions(-)
 rename arch/arm/mach-davinci/cp_intc.c => drivers/irqchip/irq-davinci-cp-intc.c (100%)
arch/arm/mach-davinci/Kconfig +2 -6
index 71a4d875dd39..5a59cebc7d0a 100644
@@ -1,10 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 if ARCH_DAVINCI
 
-config CP_INTC
-	bool
-	select IRQ_DOMAIN
-
 config ARCH_DAVINCI_DMx
 	bool
 
@@ -33,13 +29,13 @@ config ARCH_DAVINCI_DA830
 	select ARCH_DAVINCI_DA8XX
 	# needed on silicon revs 1.0, 1.1:
 	select CPU_DCACHE_WRITETHROUGH if !CPU_DCACHE_DISABLE
-	select CP_INTC
+	select DAVINCI_CP_INTC
 
 config ARCH_DAVINCI_DA850
 	bool "DA850/OMAP-L138/AM18x based system"
 	depends on !ARCH_DAVINCI_DMx || (AUTO_ZRELADDR && ARM_PATCH_PHYS_VIRT)
 	select ARCH_DAVINCI_DA8XX
-	select CP_INTC
+	select DAVINCI_CP_INTC
 
 config ARCH_DAVINCI_DA8XX
 	bool
arch/arm/mach-davinci/Makefile +0 -2
index 983865a99616..f76a8482784f 100644
@@ -18,8 +18,6 @@ obj-$(CONFIG_ARCH_DAVINCI_DM365)	+= dm365.o devices.o
 obj-$(CONFIG_ARCH_DAVINCI_DA830)	+= da830.o devices-da8xx.o usb-da8xx.o
 obj-$(CONFIG_ARCH_DAVINCI_DA850)	+= da850.o devices-da8xx.o usb-da8xx.o
 
-obj-$(CONFIG_CP_INTC)			+= cp_intc.o
-
 # Board specific
 obj-$(CONFIG_MACH_DA8XX_DT)		+= da8xx-dt.o pdata-quirks.o
 obj-$(CONFIG_MACH_DAVINCI_EVM)  	+= board-dm644x-evm.o
drivers/irqchip/Kconfig +5 -0
index ea0eb82bf1d2..48fc5024c073 100644
@@ -134,6 +134,11 @@ config DAVINCI_AINTC
 	select GENERIC_IRQ_CHIP
 	select IRQ_DOMAIN
 
+config DAVINCI_CP_INTC
+	bool
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN
+
 config DW_APB_ICTL
 	bool
 	select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
index 623e0ec5f9d0..e6cd0c98eff2 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_ATH79)			+= irq-ath79-misc.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2835.o
 obj-$(CONFIG_ARCH_BCM2835)		+= irq-bcm2836.o
 obj-$(CONFIG_DAVINCI_AINTC)		+= irq-davinci-aintc.o
+obj-$(CONFIG_DAVINCI_CP_INTC)		+= irq-davinci-cp-intc.o
 obj-$(CONFIG_ARCH_EXYNOS)		+= exynos-combiner.o
 obj-$(CONFIG_FARADAY_FTINTC010)		+= irq-ftintc010.o
 obj-$(CONFIG_ARCH_HIP04)		+= irq-hip04.o
drivers/irqchip/irq-davinci-cp-intc.c renamed from arch/arm/mach-davinci/cp_intc.c +0 -0
similarity index 100%
rename from arch/arm/mach-davinci/cp_intc.c
rename to drivers/irqchip/irq-davinci-cp-intc.c
Signature · 1 line
2.20.1
Reviewed-by on v1 31/35
#80 lore raw

Re: [PATCH 31/35] irqchip: davinci-cp-intc: move the driver to drivers/irqchip

Quoted 7 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

The cp-intc driver has now been cleaned up. Move it to drivers/irqchip where it belongs.

---

drivers/irqchip/Kconfig config DAVINCI_AINTC · line 140

Quoted 10 lines
drivers/irqchip/Kconfig +4 -0
@@ -134,6 +134,11 @@ config DAVINCI_AINTC
  	select GENERIC_IRQ_CHIP
  	select IRQ_DOMAIN
 
+config DAVINCI_CP_INTC
+	bool
+	select GENERIC_IRQ_CHIP
+	select IRQ_DOMAIN

A little help section would be nice.

Quoted 4 lines
drivers/irqchip/Kconfig +1 -0
+
  config DW_APB_ICTL
  	bool
  	select GENERIC_IRQ_CHIP
#81 lore raw

PATCH 32/35 ARM: davinci: remove intc related fields from davinci_soc_info

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

These are no longer used. Remove them.

---
 arch/arm/mach-davinci/da830.c               | 19 -------------------
 arch/arm/mach-davinci/da850.c               | 20 --------------------
 arch/arm/mach-davinci/dm355.c               |  3 ---
 arch/arm/mach-davinci/dm365.c               |  3 ---
 arch/arm/mach-davinci/dm644x.c              |  3 ---
 arch/arm/mach-davinci/dm646x.c              |  3 ---
 arch/arm/mach-davinci/include/mach/common.h |  3 ---
 7 files changed, 54 deletions(-)
arch/arm/mach-davinci/da830.c +0 -19
index bdbd66ffd2ea..9cf9b090efeb 100644
@@ -624,22 +624,6 @@ const short da830_eqep1_pins[] __initconst = {
 	-1
 };
 
-/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
-static u8 da830_cp_intc_prios[] = {
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-};
-
 static struct map_desc da830_io_desc[] = {
 	{
 		.virtual	= IO_VIRT,
@@ -728,9 +712,6 @@ static const struct davinci_soc_info davinci_soc_info_da830 = {
 	.pinmux_base		= DA8XX_SYSCFG0_BASE + 0x120,
 	.pinmux_pins		= da830_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(da830_pins),
-	.intc_base		= DA8XX_CP_INTC_BASE,
-	.intc_irq_prios		= da830_cp_intc_prios,
-	.intc_irq_num		= DA830_N_CP_INTC_IRQ,
 	.timer_info		= &da830_timer_info,
 	.emac_pdata		= &da8xx_emac_pdata,
 };
arch/arm/mach-davinci/da850.c +0 -20
index fe370e85aeb1..b9ebdcde68eb 100644
@@ -299,23 +299,6 @@ const short da850_vpif_display_pins[] __initconst = {
 	-1
 };
 
-/* FIQ are pri 0-1; otherwise 2-7, with 7 lowest priority */
-static u8 da850_cp_intc_prios[] = {
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7, 7, 7, 7, 7,
-	7, 7, 7, 7,
-};
-
 static struct map_desc da850_io_desc[] = {
 	{
 		.virtual	= IO_VIRT,
@@ -651,9 +634,6 @@ static const struct davinci_soc_info davinci_soc_info_da850 = {
 	.pinmux_base		= DA8XX_SYSCFG0_BASE + 0x120,
 	.pinmux_pins		= da850_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(da850_pins),
-	.intc_base		= DA8XX_CP_INTC_BASE,
-	.intc_irq_prios		= da850_cp_intc_prios,
-	.intc_irq_num		= DA850_N_CP_INTC_IRQ,
 	.timer_info		= &da850_timer_info,
 	.emac_pdata		= &da8xx_emac_pdata,
 	.sram_dma		= DA8XX_SHARED_RAM_BASE,
arch/arm/mach-davinci/dm355.c +0 -3
index a0bfb3602136..5573f53b47f9 100644
@@ -651,9 +651,6 @@ static const struct davinci_soc_info davinci_soc_info_dm355 = {
 	.pinmux_base		= DAVINCI_SYSTEM_MODULE_BASE,
 	.pinmux_pins		= dm355_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm355_pins),
-	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_irq_prios		= dm355_aintc_prios,
-	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm355_timer_info,
 	.sram_dma		= 0x00010000,
 	.sram_len		= SZ_32K,
arch/arm/mach-davinci/dm365.c +0 -3
index eab575873255..6d9bf292f4c6 100644
@@ -666,9 +666,6 @@ static const struct davinci_soc_info davinci_soc_info_dm365 = {
 	.pinmux_base		= DAVINCI_SYSTEM_MODULE_BASE,
 	.pinmux_pins		= dm365_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm365_pins),
-	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_irq_prios		= dm365_aintc_prios,
-	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm365_timer_info,
 	.emac_pdata		= &dm365_emac_pdata,
 	.sram_dma		= 0x00010000,
arch/arm/mach-davinci/dm644x.c +0 -3
index beb97101c881..2f181b4149c1 100644
@@ -591,9 +591,6 @@ static const struct davinci_soc_info davinci_soc_info_dm644x = {
 	.pinmux_base		= DAVINCI_SYSTEM_MODULE_BASE,
 	.pinmux_pins		= dm644x_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm644x_pins),
-	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_irq_prios		= dm644x_aintc_prios,
-	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm644x_timer_info,
 	.emac_pdata		= &dm644x_emac_pdata,
 	.sram_dma		= 0x00008000,
arch/arm/mach-davinci/dm646x.c +0 -3
index 70505c92d5fb..4ce2c8c6b945 100644
@@ -531,9 +531,6 @@ static const struct davinci_soc_info davinci_soc_info_dm646x = {
 	.pinmux_base		= DAVINCI_SYSTEM_MODULE_BASE,
 	.pinmux_pins		= dm646x_pins,
 	.pinmux_pins_num	= ARRAY_SIZE(dm646x_pins),
-	.intc_base		= DAVINCI_ARM_INTC_BASE,
-	.intc_irq_prios		= dm646x_aintc_prios,
-	.intc_irq_num		= DAVINCI_N_AINTC_IRQ,
 	.timer_info		= &dm646x_timer_info,
 	.emac_pdata		= &dm646x_emac_pdata,
 	.sram_dma		= 0x10010000,
arch/arm/mach-davinci/include/mach/common.h +0 -3
index 9e06974c85bb..2b986d32049f 100644
@@ -53,9 +53,6 @@ struct davinci_soc_info {
 	u32				pinmux_base;
 	const struct mux_config		*pinmux_pins;
 	unsigned long			pinmux_pins_num;
-	u32				intc_base;
-	u8				*intc_irq_prios;
-	unsigned long			intc_irq_num;
 	struct davinci_timer_info	*timer_info;
 	int				gpio_type;
 	u32				gpio_base;
Signature · 1 line
2.20.1
#84 lore raw

Re: [PATCH 32/35] ARM: davinci: remove intc related fields from davinci_soc_info

czw., 7 lut 2019 o 15:04 Sekhar Nori <[email protected]> napisał(a):

Quoted 6 lines · Bartosz Golaszewski
Quoted 4 lines

From: Bartosz Golaszewski <[email protected]>

These are no longer used. Remove them.

Quoted 7 lines
Quoted 1 line

I assume you are going to drop this patch and keep the priority setting code around?

Thanks,
Sekhar

I'm still going to drop it from da8xx as it's no needed AFAICT. Both SoCs use 7 as the priority for all interrupts. I'm just going to keep the defines for offsets.

Bart

#85 lore raw

PATCH 33/35 ARM: davinci: prepare to remove mach/irqs.h

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Since we now select SPARSE_IRQ in davinci, the mach/irqs.h header is no longer included from asm/irq.h. All interrupt numbers for devices should be defined as platform device resources. Let's prepare for the removal of mach/irqs.h by moving all defines that we want to keep to relevant headers (davinci.h, common.h) and replacing others with simple literals.

---
 arch/arm/mach-davinci/board-da830-evm.c     |  2 +-
 arch/arm/mach-davinci/board-da850-evm.c     |  4 ++--
 arch/arm/mach-davinci/board-dm644x-evm.c    |  2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c    |  2 +-
 arch/arm/mach-davinci/da830.c               |  2 +-
 arch/arm/mach-davinci/da850.c               |  2 +-
 arch/arm/mach-davinci/davinci.h             |  2 ++
 arch/arm/mach-davinci/include/mach/common.h |  5 +++++
 arch/arm/mach-davinci/include/mach/irqs.h   | 18 ------------------
 9 files changed, 14 insertions(+), 25 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +1 -1
index b3a0148f7f1a..950e98e4eda5 100644
@@ -488,7 +488,7 @@ static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
 }
 
 static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
-	.gpio_base	= DAVINCI_N_GPIO,
+	.gpio_base	= 144,
 	.setup		= da830_evm_ui_expander_setup,
 	.teardown	= da830_evm_ui_expander_teardown,
 };
arch/arm/mach-davinci/board-da850-evm.c +2 -2
index efc9a33da6e1..27acba6fe5f8 100644
@@ -562,7 +562,7 @@ static int da850_evm_ui_expander_teardown(struct i2c_client *client,
 
 /* assign the baseboard expander's GPIOs after the UI board's */
 #define DA850_UI_EXPANDER_N_GPIOS ARRAY_SIZE(da850_evm_ui_exp)
-#define DA850_BB_EXPANDER_GPIO_BASE (DAVINCI_N_GPIO + DA850_UI_EXPANDER_N_GPIOS)
+#define DA850_BB_EXPANDER_GPIO_BASE (144 + DA850_UI_EXPANDER_N_GPIOS)
 
 enum da850_evm_bb_exp_pins {
 	DA850_EVM_BB_EXP_DEEP_SLEEP_EN = 0,
@@ -735,7 +735,7 @@ static int da850_evm_bb_expander_teardown(struct i2c_client *client,
 }
 
 static struct pca953x_platform_data da850_evm_ui_expander_info = {
-	.gpio_base	= DAVINCI_N_GPIO,
+	.gpio_base	= 144,
 	.setup		= da850_evm_ui_expander_setup,
 	.teardown	= da850_evm_ui_expander_teardown,
 	.names		= da850_evm_ui_exp,
arch/arm/mach-davinci/board-dm644x-evm.c +1 -1
index f23a29e5116f..d04ce0c206b6 100644
@@ -310,7 +310,7 @@ static struct platform_device rtc_dev = {
  * I2C GPIO expanders
  */
 
-#define PCF_Uxx_BASE(x)	(DAVINCI_N_GPIO + ((x) * 8))
+#define PCF_Uxx_BASE(x)	(144 + ((x) * 8))
 
 
 /* U2 -- LEDs */
arch/arm/mach-davinci/board-dm646x-evm.c +1 -1
index ebf07d92224e..2ddc03a95acd 100644
@@ -333,7 +333,7 @@ static int evm_pcf_teardown(struct i2c_client *client, int gpio,
 }
 
 static struct pcf857x_platform_data pcf_data = {
-	.gpio_base	= DAVINCI_N_GPIO+1,
+	.gpio_base	= 145,
 	.setup		= evm_pcf_setup,
 	.teardown	= evm_pcf_teardown,
 };
arch/arm/mach-davinci/da830.c +1 -1
index 9cf9b090efeb..74cbab153e59 100644
@@ -730,7 +730,7 @@ static const struct davinci_cp_intc_config da830_cp_intc_config = {
 		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
 		.flags		= IORESOURCE_MEM,
 	},
-	.num_irqs		= DA830_N_CP_INTC_IRQ,
+	.num_irqs		= 96,
 };
 
 void __init da830_init_irqs(void)
arch/arm/mach-davinci/da850.c +1 -1
index b9ebdcde68eb..644f4eec8d5c 100644
@@ -658,7 +658,7 @@ static const struct davinci_cp_intc_config da850_cp_intc_config = {
 		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
 		.flags		= IORESOURCE_MEM,
 	},
-	.num_irqs		= DA850_N_CP_INTC_IRQ,
+	.num_irqs		= 101,
 };
 
 void __init da850_init_irqs(void)
arch/arm/mach-davinci/davinci.h +2 -0
index 49958cc161d7..d5bffd3751f9 100644
@@ -39,6 +39,8 @@
 #define DAVINCI_PLL2_BASE		0x01c40c00
 #define DAVINCI_PWR_SLEEP_CNTRL_BASE	0x01c41000
 
+#define DAVINCI_ARM_INTC_BASE		0x01c48000
+
 #define DAVINCI_SYSTEM_MODULE_BASE	0x01c40000
 #define SYSMOD_VDAC_CONFIG		0x2c
 #define SYSMOD_VIDCLKCTL		0x38
arch/arm/mach-davinci/include/mach/common.h +5 -0
index 2b986d32049f..9526e5da0d33 100644
@@ -17,6 +17,11 @@
 #include <linux/types.h>
 #include <linux/reboot.h>
 
+#include <asm/irq.h>
+
+#define DAVINCI_INTC_START		NR_IRQS
+#define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
+
 void davinci_timer_init(struct clk *clk);
 
 struct davinci_timer_instance {
arch/arm/mach-davinci/include/mach/irqs.h +0 -18
index 317cbc42e5cd..27c9f89f2a7f 100644
@@ -29,12 +29,6 @@
 
 #include <asm/irq.h>
 
-/* Base address */
-#define DAVINCI_ARM_INTC_BASE 0x01C48000
-
-#define DAVINCI_INTC_START		NR_IRQS
-#define DAVINCI_INTC_IRQ(_irqnum)	(DAVINCI_INTC_START + (_irqnum))
-
 /* Interrupt lines */
 #define IRQ_VDINT0       DAVINCI_INTC_IRQ(0)
 #define IRQ_VDINT1       DAVINCI_INTC_IRQ(1)
@@ -100,10 +94,6 @@
 #define IRQ_COMMRX       DAVINCI_INTC_IRQ(62)
 #define IRQ_EMUINT       DAVINCI_INTC_IRQ(63)
 
-#define DAVINCI_N_AINTC_IRQ	64
-
-#define ARCH_TIMER_IRQ IRQ_TINT1_TINT34
-
 /* DaVinci DM6467-specific Interrupts */
 #define IRQ_DM646X_VP_VERTINT0  DAVINCI_INTC_IRQ(0)
 #define IRQ_DM646X_VP_VERTINT1  DAVINCI_INTC_IRQ(1)
@@ -344,8 +334,6 @@
 #define IRQ_DA830_T12CMPINT6_1		DAVINCI_INTC_IRQ(88)
 #define IRQ_DA830_T12CMPINT7_1		DAVINCI_INTC_IRQ(89)
 
-#define DA830_N_CP_INTC_IRQ		96
-
 /* DA850 speicific interrupts */
 #define IRQ_DA850_MPUADDRERR0		DAVINCI_INTC_IRQ(27)
 #define IRQ_DA850_MPUPROTERR0		DAVINCI_INTC_IRQ(27)
@@ -401,10 +389,4 @@
 #define IRQ_DA850_MCBSP1RINT		DAVINCI_INTC_IRQ(99)
 #define IRQ_DA850_MCBSP1XINT		DAVINCI_INTC_IRQ(100)
 
-#define DA850_N_CP_INTC_IRQ		101
-
-/* da850 currently has the most gpio pins (144) */
-#define DAVINCI_N_GPIO			144
-/* da850 currently has the most irqs so use DA850_N_CP_INTC_IRQ */
-
 #endif /* __ASM_ARCH_IRQS_H */
Signature · 1 line
2.20.1
#86 lore raw

Re: [PATCH 33/35] ARM: davinci: prepare to remove mach/irqs.h

Quoted 27 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Since we now select SPARSE_IRQ in davinci, the mach/irqs.h header is no longer included from asm/irq.h. All interrupt numbers for devices should be defined as platform device resources. Let's prepare for the removal of mach/irqs.h by moving all defines that we want to keep to relevant headers (davinci.h, common.h) and replacing others with simple literals.

---
  arch/arm/mach-davinci/board-da830-evm.c     |  2 +-
  arch/arm/mach-davinci/board-da850-evm.c     |  4 ++--
  arch/arm/mach-davinci/board-dm644x-evm.c    |  2 +-
  arch/arm/mach-davinci/board-dm646x-evm.c    |  2 +-
  arch/arm/mach-davinci/da830.c               |  2 +-
  arch/arm/mach-davinci/da850.c               |  2 +-
  arch/arm/mach-davinci/davinci.h             |  2 ++
  arch/arm/mach-davinci/include/mach/common.h |  5 +++++
  arch/arm/mach-davinci/include/mach/irqs.h   | 18 ------------------
  9 files changed, 14 insertions(+), 25 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +0 -0
index b3a0148f7f1a..950e98e4eda5 100644

arch/arm/mach-davinci/board-da830-evm.c static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio, · line 491

Quoted 5 lines
arch/arm/mach-davinci/board-da830-evm.c +1 -1
@@ -488,7 +488,7 @@ static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
  }
 
  static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
-	.gpio_base	= DAVINCI_N_GPIO,
+	.gpio_base	= 144,

I think it would be better to keep the *_N_GPIO macros.

Quoted 3 lines
arch/arm/mach-davinci/board-da830-evm.c +0 -0
  	.setup		= da830_evm_ui_expander_setup,
  	.teardown	= da830_evm_ui_expander_teardown,
  };

...

arch/arm/mach-davinci/da830.c static const struct davinci_cp_intc_config da830_cp_intc_config = { · line 733

Quoted 10 lines
arch/arm/mach-davinci/da830.c +1 -1
index 9cf9b090efeb..74cbab153e59 100644
@@ -730,7 +730,7 @@ static const struct davinci_cp_intc_config da830_cp_intc_config = {
  		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
  		.flags		= IORESOURCE_MEM,
  	},
-	.num_irqs		= DA830_N_CP_INTC_IRQ,
+	.num_irqs		= 96,

This change could be avoided by using 96 in the first place in "ARM: davinci: cp-intc: add the new config structures for da8xx SoCs"

arch/arm/mach-davinci/da850.c static const struct davinci_cp_intc_config da850_cp_intc_config = { · line 661

Quoted 13 lines
arch/arm/mach-davinci/da830.c +0 -0
  };
 
  void __init da830_init_irqs(void)
arch/arm/mach-davinci/da850.c +1 -1
index b9ebdcde68eb..644f4eec8d5c 100644
@@ -658,7 +658,7 @@ static const struct davinci_cp_intc_config da850_cp_intc_config = {
  		.end		= DA8XX_CP_INTC_BASE + SZ_8K,
  		.flags		= IORESOURCE_MEM,
  	},
-	.num_irqs		= DA850_N_CP_INTC_IRQ,
+	.num_irqs		= 101,

same here

arch/arm/mach-davinci/da850.c static const struct davinci_cp_intc_config da850_cp_intc_config = { · line 664

Quoted 3 lines
arch/arm/mach-davinci/da850.c +0 -0
  };
 
  void __init da850_init_irqs(void)

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#87 lore raw

Re: [PATCH 33/35] ARM: davinci: prepare to remove mach/irqs.h

In reply to Bartosz Golaszewski
Quoted 27 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Since we now select SPARSE_IRQ in davinci, the mach/irqs.h header is no longer included from asm/irq.h. All interrupt numbers for devices should be defined as platform device resources. Let's prepare for the removal of mach/irqs.h by moving all defines that we want to keep to relevant headers (davinci.h, common.h) and replacing others with simple literals.

---
 arch/arm/mach-davinci/board-da830-evm.c     |  2 +-
 arch/arm/mach-davinci/board-da850-evm.c     |  4 ++--
 arch/arm/mach-davinci/board-dm644x-evm.c    |  2 +-
 arch/arm/mach-davinci/board-dm646x-evm.c    |  2 +-
 arch/arm/mach-davinci/da830.c               |  2 +-
 arch/arm/mach-davinci/da850.c               |  2 +-
 arch/arm/mach-davinci/davinci.h             |  2 ++
 arch/arm/mach-davinci/include/mach/common.h |  5 +++++
 arch/arm/mach-davinci/include/mach/irqs.h   | 18 ------------------
 9 files changed, 14 insertions(+), 25 deletions(-)
arch/arm/mach-davinci/board-da830-evm.c +0 -0
index b3a0148f7f1a..950e98e4eda5 100644

arch/arm/mach-davinci/board-da830-evm.c static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio, · line 491

Quoted 5 lines
arch/arm/mach-davinci/board-da830-evm.c +1 -1
@@ -488,7 +488,7 @@ static int da830_evm_ui_expander_teardown(struct i2c_client *client, int gpio,
 }
 
 static struct pcf857x_platform_data __initdata da830_evm_ui_expander_info = {
-	.gpio_base	= DAVINCI_N_GPIO,
+	.gpio_base	= 144,

Why drop DAVINCI_N_GPIO instead of just moving it to a local header file?

Thanks,
Sekhar

#88 lore raw

PATCH 34/35 ARM: davinci: stop using defines from mach/irqs.h

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

As the second step in preparation for mach/irqs.h removal - replace all constants defined there with the DAVINCI_INTC_IRQ() macro which takes the NR_IRQS offset into account.

---
 arch/arm/mach-davinci/asp.h           |   8 +-
 arch/arm/mach-davinci/da830.c         |  12 +--
 arch/arm/mach-davinci/da850.c         |  28 ++---
 arch/arm/mach-davinci/devices-da8xx.c | 146 +++++++++++++-------------
 arch/arm/mach-davinci/devices.c       |  30 +++---
 arch/arm/mach-davinci/dm355.c         |  56 +++++-----
 arch/arm/mach-davinci/dm365.c         |  80 +++++++-------
 arch/arm/mach-davinci/dm644x.c        |  48 ++++-----
 arch/arm/mach-davinci/dm646x.c        |  62 +++++------
 arch/arm/mach-davinci/usb-da8xx.c     |   6 +-
 arch/arm/mach-davinci/usb.c           |   6 +-
 11 files changed, 241 insertions(+), 241 deletions(-)
arch/arm/mach-davinci/asp.h +4 -4
index 495aa6907cbc..17013e27152e 100644
@@ -49,9 +49,9 @@
 #define DAVINCI_DA830_DMA_MCASP2_AXEVT	5
 
 /* Interrupts */
-#define DAVINCI_ASP0_RX_INT	IRQ_MBRINT
-#define DAVINCI_ASP0_TX_INT	IRQ_MBXINT
-#define DAVINCI_ASP1_RX_INT	IRQ_MBRINT
-#define DAVINCI_ASP1_TX_INT	IRQ_MBXINT
+#define DAVINCI_ASP0_RX_INT	DAVINCI_INTC_IRQ(25)
+#define DAVINCI_ASP0_TX_INT	DAVINCI_INTC_IRQ(24)
+#define DAVINCI_ASP1_RX_INT	DAVINCI_INTC_IRQ(25)
+#define DAVINCI_ASP1_TX_INT	DAVINCI_INTC_IRQ(24)
 
 #endif /* __ASM_ARCH_DAVINCI_ASP_H */
arch/arm/mach-davinci/da830.c +6 -6
index 74cbab153e59..a8407c1d1a68 100644
@@ -678,17 +678,17 @@ int __init da830_register_gpio(void)
 static struct davinci_timer_instance da830_timer_instance[2] = {
 	{
 		.base		= DA8XX_TIMER64P0_BASE,
-		.bottom_irq	= IRQ_DA8XX_TINT12_0,
-		.top_irq	= IRQ_DA8XX_TINT34_0,
+		.bottom_irq	= DAVINCI_INTC_IRQ(21),
+		.top_irq	= DAVINCI_INTC_IRQ(22),
 		.cmp_off	= DA830_CMP12_0,
-		.cmp_irq	= IRQ_DA830_T12CMPINT0_0,
+		.cmp_irq	= DAVINCI_INTC_IRQ(74),
 	},
 	{
 		.base		= DA8XX_TIMER64P1_BASE,
-		.bottom_irq	= IRQ_DA8XX_TINT12_1,
-		.top_irq	= IRQ_DA8XX_TINT34_1,
+		.bottom_irq	= DAVINCI_INTC_IRQ(23),
+		.top_irq	= DAVINCI_INTC_IRQ(24),
 		.cmp_off	= DA830_CMP12_0,
-		.cmp_irq	= IRQ_DA830_T12CMPINT0_1,
+		.cmp_irq	= DAVINCI_INTC_IRQ(82),
 	},
 };
 
arch/arm/mach-davinci/da850.c +14 -14
index 644f4eec8d5c..84b30c70ddf1 100644
@@ -335,23 +335,23 @@ static struct davinci_id da850_ids[] = {
 static struct davinci_timer_instance da850_timer_instance[4] = {
 	{
 		.base		= DA8XX_TIMER64P0_BASE,
-		.bottom_irq	= IRQ_DA8XX_TINT12_0,
-		.top_irq	= IRQ_DA8XX_TINT34_0,
+		.bottom_irq	= DAVINCI_INTC_IRQ(21),
+		.top_irq	= DAVINCI_INTC_IRQ(22),
 	},
 	{
 		.base		= DA8XX_TIMER64P1_BASE,
-		.bottom_irq	= IRQ_DA8XX_TINT12_1,
-		.top_irq	= IRQ_DA8XX_TINT34_1,
+		.bottom_irq	= DAVINCI_INTC_IRQ(23),
+		.top_irq	= DAVINCI_INTC_IRQ(24),
 	},
 	{
 		.base		= DA850_TIMER64P2_BASE,
-		.bottom_irq	= IRQ_DA850_TINT12_2,
-		.top_irq	= IRQ_DA850_TINT34_2,
+		.bottom_irq	= DAVINCI_INTC_IRQ(68),
+		.top_irq	= DAVINCI_INTC_IRQ(68),
 	},
 	{
 		.base		= DA850_TIMER64P3_BASE,
-		.bottom_irq	= IRQ_DA850_TINT12_3,
-		.top_irq	= IRQ_DA850_TINT34_3,
+		.bottom_irq	= DAVINCI_INTC_IRQ(96),
+		.top_irq	= DAVINCI_INTC_IRQ(96),
 	},
 };
 
@@ -554,8 +554,8 @@ static struct platform_device da850_vpif_dev = {
 
 static struct resource da850_vpif_display_resource[] = {
 	{
-		.start = IRQ_DA850_VPIFINT,
-		.end   = IRQ_DA850_VPIFINT,
+		.start = DAVINCI_INTC_IRQ(92),
+		.end   = DAVINCI_INTC_IRQ(92),
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -573,13 +573,13 @@ static struct platform_device da850_vpif_display_dev = {
 
 static struct resource da850_vpif_capture_resource[] = {
 	{
-		.start = IRQ_DA850_VPIFINT,
-		.end   = IRQ_DA850_VPIFINT,
+		.start = DAVINCI_INTC_IRQ(92),
+		.end   = DAVINCI_INTC_IRQ(92),
 		.flags = IORESOURCE_IRQ,
 	},
 	{
-		.start = IRQ_DA850_VPIFINT,
-		.end   = IRQ_DA850_VPIFINT,
+		.start = DAVINCI_INTC_IRQ(92),
+		.end   = DAVINCI_INTC_IRQ(92),
 		.flags = IORESOURCE_IRQ,
 	},
 };
arch/arm/mach-davinci/devices-da8xx.c +73 -73

337 lines not on this page · raw message

arch/arm/mach-davinci/devices.c +15 -15
index e8dbbb7479ab..b8e5c5998872 100644
@@ -56,7 +56,7 @@ static struct resource i2c_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	{
-		.start		= IRQ_I2C,
+		.start		= DAVINCI_INTC_IRQ(39),
 		.flags		= IORESOURCE_IRQ,
 	},
 };
@@ -84,8 +84,8 @@ static struct resource ide_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	{
-		.start		= IRQ_IDE,
-		.end		= IRQ_IDE,
+		.start		= DAVINCI_INTC_IRQ(22),
+		.end		= DAVINCI_INTC_IRQ(22),
 		.flags		= IORESOURCE_IRQ,
 	},
 };
@@ -110,7 +110,7 @@ void __init davinci_init_ide(void)
 		davinci_cfg_reg(DM644X_ATAEN);
 		davinci_cfg_reg(DM644X_HDIREN);
 	} else if (cpu_is_davinci_dm646x()) {
-		/* IRQ_DM646X_IDE is the same as IRQ_IDE */
+		/* DAVINCI_INTC_IRQ(22) is the same as DAVINCI_INTC_IRQ(22) */
 		davinci_cfg_reg(DM646X_ATAEN);
 	} else {
 		WARN_ON(1);
@@ -133,11 +133,11 @@ static struct resource mmcsd0_resources[] = {
 	},
 	/* IRQs:  MMC/SD, then SDIO */
 	{
-		.start = IRQ_MMCINT,
+		.start = DAVINCI_INTC_IRQ(26),
 		.flags = IORESOURCE_IRQ,
 	}, {
 		/* different on dm355 */
-		.start = IRQ_SDIOINT,
+		.start = DAVINCI_INTC_IRQ(27),
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -163,10 +163,10 @@ static struct resource mmcsd1_resources[] = {
 	},
 	/* IRQs:  MMC/SD, then SDIO */
 	{
-		.start = IRQ_DM355_MMCINT1,
+		.start = DAVINCI_INTC_IRQ(27),
 		.flags = IORESOURCE_IRQ,
 	}, {
-		.start = IRQ_DM355_SDIOINT1,
+		.start = DAVINCI_INTC_IRQ(31),
 		.flags = IORESOURCE_IRQ,
 	},
 };
@@ -219,7 +219,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
 			mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
 			mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
 							SZ_4K - 1;
-			mmcsd1_resources[2].start = IRQ_DM365_SDIOINT1;
+			mmcsd1_resources[2].start = DAVINCI_INTC_IRQ(31);
 			davinci_mmcsd1_device.name = "da830-mmc";
 		} else
 			break;
@@ -230,7 +230,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
 		if (cpu_is_davinci_dm355()) {
 			mmcsd0_resources[0].start = DM355_MMCSD0_BASE;
 			mmcsd0_resources[0].end = DM355_MMCSD0_BASE + SZ_4K - 1;
-			mmcsd0_resources[2].start = IRQ_DM355_SDIOINT0;
+			mmcsd0_resources[2].start = DAVINCI_INTC_IRQ(23);
 
 			/* expose all 6 MMC0 signals:  CLK, CMD, DATA[0..3] */
 			davinci_cfg_reg(DM355_MMCSD0);
@@ -241,7 +241,7 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
 			mmcsd0_resources[0].start = DM365_MMCSD0_BASE;
 			mmcsd0_resources[0].end = DM365_MMCSD0_BASE +
 							SZ_4K - 1;
-			mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
+			mmcsd0_resources[2].start = DAVINCI_INTC_IRQ(23);
 			davinci_mmcsd0_device.name = "da830-mmc";
 		} else if (cpu_is_davinci_dm644x()) {
 			/* REVISIT: should this be in board-init code? */
@@ -313,13 +313,13 @@ int davinci_gpio_register(struct resource *res, int size, void *pdata)
 struct davinci_timer_instance davinci_timer_instance[2] = {
 	{
 		.base		= DAVINCI_TIMER0_BASE,
-		.bottom_irq	= IRQ_TINT0_TINT12,
-		.top_irq	= IRQ_TINT0_TINT34,
+		.bottom_irq	= DAVINCI_INTC_IRQ(32),
+		.top_irq	= DAVINCI_INTC_IRQ(33),
 	},
 	{
 		.base		= DAVINCI_TIMER1_BASE,
-		.bottom_irq	= IRQ_TINT1_TINT12,
-		.top_irq	= IRQ_TINT1_TINT34,
+		.bottom_irq	= DAVINCI_INTC_IRQ(34),
+		.top_irq	= DAVINCI_INTC_IRQ(35),
 	},
 };
 
arch/arm/mach-davinci/dm355.c +28 -28

135 lines not on this page · raw message

arch/arm/mach-davinci/dm365.c +40 -40

183 lines not on this page · raw message

arch/arm/mach-davinci/dm644x.c +24 -24

121 lines not on this page · raw message

arch/arm/mach-davinci/dm646x.c +31 -31

157 lines not on this page · raw message

arch/arm/mach-davinci/usb-da8xx.c +3 -3
index c17ce66a3d95..fdfe03669d9f 100644
@@ -70,7 +70,7 @@ static struct resource da8xx_usb20_resources[] = {
 		.flags		= IORESOURCE_MEM,
 	},
 	{
-		.start		= IRQ_DA8XX_USB_INT,
+		.start		= DAVINCI_INTC_IRQ(58),
 		.flags		= IORESOURCE_IRQ,
 		.name		= "mc",
 	},
@@ -105,8 +105,8 @@ static struct resource da8xx_usb11_resources[] = {
 		.flags	= IORESOURCE_MEM,
 	},
 	[1] = {
-		.start	= IRQ_DA8XX_IRQN,
-		.end	= IRQ_DA8XX_IRQN,
+		.start	= DAVINCI_INTC_IRQ(59),
+		.end	= DAVINCI_INTC_IRQ(59),
 		.flags	= IORESOURCE_IRQ,
 	},
 };
arch/arm/mach-davinci/usb.c +3 -3
index 31ed7aa47227..feb300670f43 100644
@@ -38,7 +38,7 @@ static struct resource usb_resources[] = {
 		.flags          = IORESOURCE_MEM,
 	},
 	{
-		.start          = IRQ_USBINT,
+		.start          = DAVINCI_INTC_IRQ(12),
 		.flags          = IORESOURCE_IRQ,
 		.name		= "mc"
 	},
@@ -70,8 +70,8 @@ void __init davinci_setup_usb(unsigned mA, unsigned potpgt_ms)
 
 	if (cpu_is_davinci_dm646x()) {
 		/* Override the defaults as DM6467 uses different IRQs. */
-		usb_dev.resource[1].start = IRQ_DM646X_USBINT;
-		usb_dev.resource[2].start = IRQ_DM646X_USBDMAINT;
+		usb_dev.resource[1].start = DAVINCI_INTC_IRQ(13);
+		usb_dev.resource[2].start = DAVINCI_INTC_IRQ(14);
 	} else	/* other devices don't have dedicated CPPI IRQ */
 		usb_dev.num_resources = 2;
 
Signature · 1 line
2.20.1
Reviewed-by on v1 34/35
#89 lore raw

Re: [PATCH 34/35] ARM: davinci: stop using defines from mach/irqs.h

Quoted 8 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

As the second step in preparation for mach/irqs.h removal - replace all constants defined there with the DAVINCI_INTC_IRQ() macro which takes the NR_IRQS offset into account.

---

Quoted 4 lines
arch/arm/mach-davinci/devices.c +0 -0
index e8dbbb7479ab..b8e5c5998872 100644

...

arch/arm/mach-davinci/devices.c void __init davinci_init_ide(void) · line 113

Quoted 6 lines
arch/arm/mach-davinci/devices.c +1 -1
@@ -110,7 +110,7 @@ void __init davinci_init_ide(void)
  		davinci_cfg_reg(DM644X_ATAEN);
  		davinci_cfg_reg(DM644X_HDIREN);
  	} else if (cpu_is_davinci_dm646x()) {
-		/* IRQ_DM646X_IDE is the same as IRQ_IDE */
+		/* DAVINCI_INTC_IRQ(22) is the same as DAVINCI_INTC_IRQ(22) */

This comment can be dropped.

arch/arm/mach-davinci/devices.c void __init davinci_init_ide(void) · line 116

Quoted 3 lines
arch/arm/mach-davinci/devices.c +0 -0
  		davinci_cfg_reg(DM646X_ATAEN);
  	} else {
  		WARN_ON(1);

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#90 lore raw

PATCH 35/35 ARM: davinci: remove mach/irqs.h

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

We can now remove mach/irqs.h as there are no more users.

---
 arch/arm/mach-davinci/board-da830-evm.c   |   1 -
 arch/arm/mach-davinci/board-da850-evm.c   |   1 -
 arch/arm/mach-davinci/board-dm644x-evm.c  |   1 -
 arch/arm/mach-davinci/board-dm646x-evm.c  |   1 -
 arch/arm/mach-davinci/da830.c             |   1 -
 arch/arm/mach-davinci/da850.c             |   1 -
 arch/arm/mach-davinci/devices-da8xx.c     |   1 -
 arch/arm/mach-davinci/devices.c           |   1 -
 arch/arm/mach-davinci/dm355.c             |   1 -
 arch/arm/mach-davinci/dm365.c             |   1 -
 arch/arm/mach-davinci/dm644x.c            |   1 -
 arch/arm/mach-davinci/dm646x.c            |   1 -
 arch/arm/mach-davinci/include/mach/irqs.h | 392 ----------------------
 arch/arm/mach-davinci/usb-da8xx.c         |   1 -
 arch/arm/mach-davinci/usb.c               |   1 -
 15 files changed, 406 deletions(-)
 delete mode 100644 arch/arm/mach-davinci/include/mach/irqs.h
arch/arm/mach-davinci/board-da830-evm.c +0 -1
index 950e98e4eda5..123b424058e2 100644
@@ -36,7 +36,6 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
-#include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/da8xx.h>
 
arch/arm/mach-davinci/board-da850-evm.c +0 -1
index 27acba6fe5f8..1da3d79f2757 100644
@@ -45,7 +45,6 @@
 #include <mach/common.h>
 #include <mach/da8xx.h>
 #include <mach/mux.h>
-#include <mach/irqs.h>
 #include "sram.h"
 
 #include <asm/mach-types.h>
arch/arm/mach-davinci/board-dm644x-evm.c +0 -1
index d04ce0c206b6..dac5ad9ff91c 100644
@@ -36,7 +36,6 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
-#include <mach/irqs.h>
 #include <linux/platform_data/i2c-davinci.h>
 #include <mach/serial.h>
 #include <mach/mux.h>
arch/arm/mach-davinci/board-dm646x-evm.c +0 -1
index 2ddc03a95acd..b8c7c50212bc 100644
@@ -44,7 +44,6 @@
 #include <asm/mach/arch.h>
 
 #include <mach/common.h>
-#include <mach/irqs.h>
 #include <mach/serial.h>
 
 #include "davinci.h"
arch/arm/mach-davinci/da830.c +0 -1
index a8407c1d1a68..e4d781a36aa1 100644
@@ -20,7 +20,6 @@
 #include <mach/common.h>
 #include <mach/cputype.h>
 #include <mach/da8xx.h>
-#include <mach/irqs.h>
 #include <mach/time.h>
 
 #include "mux.h"
arch/arm/mach-davinci/da850.c +0 -1
index 84b30c70ddf1..3872eedb0b23 100644
@@ -33,7 +33,6 @@
 #include <mach/cpufreq.h>
 #include <mach/cputype.h>
 #include <mach/da8xx.h>
-#include <mach/irqs.h>
 #include <mach/pm.h>
 #include <mach/time.h>
 
arch/arm/mach-davinci/devices-da8xx.c +0 -1
index fda6d35c415c..262dcd0a3528 100644
@@ -25,7 +25,6 @@
 #include <mach/cputype.h>
 #include <mach/da8xx.h>
 #include <mach/time.h>
-#include <mach/irqs.h>
 
 #include "asp.h"
 #include "cpuidle.h"
arch/arm/mach-davinci/devices.c +0 -1
index b8e5c5998872..1337630868f0 100644
@@ -17,7 +17,6 @@
 
 #include <mach/hardware.h>
 #include <linux/platform_data/i2c-davinci.h>
-#include <mach/irqs.h>
 #include <mach/cputype.h>
 #include <mach/mux.h>
 #include <linux/platform_data/mmc-davinci.h>
arch/arm/mach-davinci/dm355.c +0 -1
index 8d53d0c0a4a2..a653defd6418 100644
@@ -27,7 +27,6 @@
 
 #include <mach/common.h>
 #include <mach/cputype.h>
-#include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/serial.h>
 #include <mach/time.h>
arch/arm/mach-davinci/dm365.c +0 -1
index 00d90cf81e7f..35e547a145a9 100644
@@ -32,7 +32,6 @@
 
 #include <mach/common.h>
 #include <mach/cputype.h>
-#include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/serial.h>
 #include <mach/time.h>
arch/arm/mach-davinci/dm644x.c +0 -1
index a17ae9d66c53..a86b20ff2966 100644
@@ -25,7 +25,6 @@
 
 #include <mach/common.h>
 #include <mach/cputype.h>
-#include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/serial.h>
 #include <mach/time.h>
arch/arm/mach-davinci/dm646x.c +0 -1
index f5506216321e..80193b8bd92a 100644
@@ -26,7 +26,6 @@
 
 #include <mach/common.h>
 #include <mach/cputype.h>
-#include <mach/irqs.h>
 #include <mach/mux.h>
 #include <mach/serial.h>
 #include <mach/time.h>
arch/arm/mach-davinci/include/mach/irqs.h deleted +0 -392

392 lines not on this page · raw message

arch/arm/mach-davinci/usb-da8xx.c +0 -1
index fdfe03669d9f..eec6a14d034a 100644
@@ -18,7 +18,6 @@
 #include <mach/common.h>
 #include <mach/cputype.h>
 #include <mach/da8xx.h>
-#include <mach/irqs.h>
 
 #define DA8XX_USB0_BASE		0x01e00000
 #define DA8XX_USB1_BASE		0x01e25000
arch/arm/mach-davinci/usb.c +0 -1
index feb300670f43..42ffc6c7e5d8 100644
@@ -9,7 +9,6 @@
 #include <linux/usb/musb.h>
 
 #include <mach/common.h>
-#include <mach/irqs.h>
 #include <mach/cputype.h>
 #include <linux/platform_data/usb-davinci.h>
 
Signature · 1 line
2.20.1
Tested-by on the v1 series
#92 lore raw
In reply to Bartosz Golaszewski
Quoted 5 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

This has been on my todo list for years, but I've never had enough time to figure it out. Nice to see it finally getting done!

Series tested on LEGO MINDSTORMS EV3 (da850-like). I can now use IIO triggers without having to patch the kernel to add extra interrupts.

#93 lore raw

pon., 4 lut 2019 o 22:49 David Lechner <[email protected]> napisał(a):

Quoted 8 lines · Bartosz Golaszewski
Quoted 5 lines

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

Quoted 10 lines

This has been on my todo list for years, but I've never had enough time to figure it out. Nice to see it finally getting done!

Series tested on LEGO MINDSTORMS EV3 (da850-like). I can now use IIO triggers without having to patch the kernel to add extra interrupts.

Wow thanks for taking the time to review it!

I'll address certain remarks - for those unaddressed - I'll fix them in v2.

Sekhar: are you fine with sending both the clocksource and interrupt series together next time with additional patches on top making davinci part of multi_v5_defconfig?

Best regards,
Bartosz Golaszewski

#94 lore raw
Quoted 20 lines · Bartosz Golaszewski

pon., 4 lut 2019 o 22:49 David Lechner <[email protected]> napisał(a):

Quoted 8 lines · Bartosz Golaszewski
Quoted 5 lines

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

Quoted 10 lines

This has been on my todo list for years, but I've never had enough time to figure it out. Nice to see it finally getting done!

Series tested on LEGO MINDSTORMS EV3 (da850-like). I can now use IIO triggers without having to patch the kernel to add extra interrupts.

Quoted 7 lines

Wow thanks for taking the time to review it!

I'll address certain remarks - for those unaddressed - I'll fix them in v2.

Sekhar: are you fine with sending both the clocksource and interrupt series together next time with additional patches on top making davinci part of multi_v5_defconfig?

I think its better to keep them separate. You can base both on latest mainline.

Thanks,
Sekhar

#95 lore raw

pt., 8 lut 2019 o 12:43 Sekhar Nori <[email protected]> napisał(a):

Quoted 30 lines · Bartosz Golaszewski
Quoted 20 lines

pon., 4 lut 2019 o 22:49 David Lechner <[email protected]> napisał(a):

Quoted 8 lines · Bartosz Golaszewski
Quoted 5 lines

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

Quoted 10 lines

This has been on my todo list for years, but I've never had enough time to figure it out. Nice to see it finally getting done!

Series tested on LEGO MINDSTORMS EV3 (da850-like). I can now use IIO triggers without having to patch the kernel to add extra interrupts.

Quoted 7 lines

Wow thanks for taking the time to review it!

I'll address certain remarks - for those unaddressed - I'll fix them in v2.

Sekhar: are you fine with sending both the clocksource and interrupt series together next time with additional patches on top making davinci part of multi_v5_defconfig?

Quoted 5 lines

I think its better to keep them separate. You can base both on latest mainline.

Thanks,
Sekhar

If you prefer I can keep them separate, although there were a couple conflicts when I merged them in my tree, which are now resolved.

Let's maybe start with the interrupts (I'll send a v2 tonight if you don't have any more comments), and once you have that in your tree, I will rebase the timer code and then the multi_v5 series.

Bart

#96 lore raw
Quoted 37 lines · Bartosz Golaszewski

pt., 8 lut 2019 o 12:43 Sekhar Nori <[email protected]> napisał(a):

Quoted 30 lines · Bartosz Golaszewski
Quoted 20 lines

pon., 4 lut 2019 o 22:49 David Lechner <[email protected]> napisał(a):

Quoted 8 lines · Bartosz Golaszewski
Quoted 5 lines

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

Quoted 10 lines

This has been on my todo list for years, but I've never had enough time to figure it out. Nice to see it finally getting done!

Series tested on LEGO MINDSTORMS EV3 (da850-like). I can now use IIO triggers without having to patch the kernel to add extra interrupts.

Quoted 7 lines

Wow thanks for taking the time to review it!

I'll address certain remarks - for those unaddressed - I'll fix them in v2.

Sekhar: are you fine with sending both the clocksource and interrupt series together next time with additional patches on top making davinci part of multi_v5_defconfig?

Quoted 5 lines

I think its better to keep them separate. You can base both on latest mainline.

Thanks,
Sekhar

Quoted 6 lines

If you prefer I can keep them separate, although there were a couple conflicts when I merged them in my tree, which are now resolved.

Let's maybe start with the interrupts (I'll send a v2 tonight if you don't have any more comments), and once you have that in your tree, I will rebase the timer code and then the multi_v5 series.

Sounds good. I have no more comments on the interrupt series. We will need acks from irqchip maintainers before merging though.

Thanks,
Sekhar

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#97 lore raw
In reply to Bartosz Golaszewski

Hi Bartosz,

Quoted 13 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

This series ports the davinci platform to using SPARSE_IRQ, cleans up the irqchip drivers and moves them over to drivers/irqchip.

The series can be logically split into four parts. The first (1-8) aims at introducing support for SPARSE_IRQ. It contains a couple changes required for that functionality and the final patch actually selecting it.

Second part (9-18) makes the aintc driver suitable for drivers/irqchip and eventually moves it over there.

Quoted 7 lines

Part 3 (19-31) does the same for the cp-intc driver.

Last part (32-35) aims at removing mach/irqs.h as it's no longer needed with SPARSE_IRQ selected.

The series has been tested on da850-lcdk (for cp-intc) and dm365-evm (for aintc).

Looks good to me overall, apart from some comments on individual patches. I boot tested on all 6 DaVinci SoCs. Also did a basic iperf test on DA850 to check that performance remains same as before.

Nice work!

Thanks,
Sekhar