Skip to contentSkip to conversation

irqchip: mmp: avoid use head file in a specific arch

PATCH Superseded Neil Zhang 1 participant 2 messages Oct 10, 2013

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Neil Zhang

author
#0 lore raw

PATCH 1/2 irqchip: mmp: avoid use head file in a specific arch

For example, arm64 doesn't have mach/irq.h.

---
 drivers/irqchip/irq-mmp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +1 -1
index 2cb7cd0..470c5de 100644
@@ -22,7 +22,7 @@
 #include <linux/of_irq.h>
 
 #include <asm/exception.h>
-#include <asm/mach/irq.h>
+#include <asm/hardirq.h>
 
 #include "irqchip.h"
 
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH 2/2 irqchip: mmp: add dt support for wakeup

Some of the Marvell SoCs use GIC as its interrupt controller, and ICU only used as wakeup logic. When AP subsystem is powered off, GIC will lose its context, the PMU will need ICU to wakeup the AP subsystem. So add wakeup entry for such kind of usage.

---
 .../devicetree/bindings/arm/mrvl/intc.txt          |   14 ++-
 drivers/irqchip/irq-mmp.c                          |  124 ++++++++++++++++++++
 include/linux/irqchip/mmp.h                        |   14 +++
 3 files changed, 151 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/arm/mrvl/intc.txt +13 -1
index 8b53273..6fa01b4 100644
@@ -2,7 +2,7 @@
 
 Required properties:
 - compatible : Should be "mrvl,mmp-intc", "mrvl,mmp2-intc" or
-  "mrvl,mmp2-mux-intc"
+  "mrvl,mmp2-mux-intc", "mrvl,mmp-intc-wakeupgen"
 - reg : Address and length of the register set of the interrupt controller.
   If the interrupt controller is intc, address and length means the range
   of the whold interrupt controller. If the interrupt controller is mux-intc,
@@ -15,6 +15,9 @@ Required properties:
 - interrupt-controller : Identifies the node as an interrupt controller.
 - #interrupt-cells : Specifies the number of cells needed to encode an
   interrupt source.
+- mrvl,intc-gbl-mask : Specifies the address and value for global mask in the
+  interrupt controller.
+- mrvl,intc-for-cp : Specifies the irqs that will be routed to cp
 - mrvl,intc-nr-irqs : Specifies the number of interrupts in the interrupt
   controller.
 - mrvl,clr-mfp-irq : Specifies the interrupt that needs to clear MFP edge
@@ -39,6 +42,15 @@ Example:
 		mrvl,intc-nr-irqs = <2>;
 	};
 
+    intc: wakeupgen@d4282000 {
+		compatible = "mrvl,mmp-intc-wakeupgen";
+		reg = <0xd4282000 0x1000>;
+		mrvl,intc-nr-irqs = <64>;
+		mrvl,intc-gbl-mask = <0x114 0x3
+		                      0x144 0x3>;
+		mrvl,intc-for-cp = <0 31 32>;
+    };
+
 * Marvell Orion Interrupt controller
 
 Required properties
drivers/irqchip/irq-mmp.c +124 -0

147 lines not on this page · raw message

include/linux/irqchip/mmp.h +14 -0
index c78a892..0f22f57 100644
@@ -1,6 +1,20 @@
 #ifndef	__IRQCHIP_MMP_H
 #define	__IRQCHIP_MMP_H
 
+#define ICU_CONF_CPU3      (1 << 9)
+#define ICU_CONF_CPU2      (1 << 8)
+#define ICU_CONF_CPU1      (1 << 7)
+#define ICU_CONF_CPU0      (1 << 6)
+#define ICU_CONF_AP(n)     (1 << (6 + (n & 0x3)))
+#define ICU_CONF_AP_MASK   (0xF << 6)
+#define ICU_CONF_SEAGULL   (1 << 5)
+#define ICU_CONF_IRQ_FIQ   (1 << 4)
+#define ICU_CONF_PRIO(n)   (n & 0xF)
+
+#define ICU_IRQ_CPU0_MASKED    (ICU_CONF_IRQ_FIQ | ICU_CONF_CPU0)
+
 extern struct irq_chip icu_irq_chip;
 
+extern void __init mmp_of_wakeup_init(void);
+
 #endif	/* __IRQCHIP_MMP_H */
Signature · 1 line
1.7.9.5