Skip to content

Commit 255ae3f

Browse files
committed
Merge tag 'metag-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag
Pull metag architecture changes from James Hogan: - Device tree updates for TZ1090 GPIO drivers merged via GPIO tree. - Add driver for ImgTec PDC irqchip as found in TZ1090 SoC. - Add linux-metag mailing list to MAINTAINERS file. * tag 'metag-for-v3.12' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/metag: irq-imgpdc: add ImgTec PDC irqchip driver MAINTAINERS: add linux-metag mailing list metag: tz1090: instantiate gpio-tz1090-pdc metag: tz1090: select and instantiate gpio-tz1090 metag: tz1090: select and instantiate irq-imgpdc
2 parents 89c5a94 + b6ef916 commit 255ae3f

File tree

7 files changed

+680
-0
lines changed

7 files changed

+680
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
* ImgTec Powerdown Controller (PDC) Interrupt Controller Binding
2+
3+
This binding specifies what properties must be available in the device tree
4+
representation of a PDC IRQ controller. This has a number of input interrupt
5+
lines which can wake the system, and are passed on through output interrupt
6+
lines.
7+
8+
Required properties:
9+
10+
- compatible: Specifies the compatibility list for the interrupt controller.
11+
The type shall be <string> and the value shall include "img,pdc-intc".
12+
13+
- reg: Specifies the base PDC physical address(s) and size(s) of the
14+
addressable register space. The type shall be <prop-encoded-array>.
15+
16+
- interrupt-controller: The presence of this property identifies the node
17+
as an interrupt controller. No property value shall be defined.
18+
19+
- #interrupt-cells: Specifies the number of cells needed to encode an
20+
interrupt source. The type shall be a <u32> and the value shall be 2.
21+
22+
- num-perips: Number of waking peripherals.
23+
24+
- num-syswakes: Number of SysWake inputs.
25+
26+
- interrupts: List of interrupt specifiers. The first specifier shall be the
27+
shared SysWake interrupt, and remaining specifies shall be PDC peripheral
28+
interrupts in order.
29+
30+
* Interrupt Specifier Definition
31+
32+
Interrupt specifiers consists of 2 cells encoded as follows:
33+
34+
- <1st-cell>: The interrupt-number that identifies the interrupt source.
35+
0-7: Peripheral interrupts
36+
8-15: SysWake interrupts
37+
38+
- <2nd-cell>: The level-sense information, encoded using the Linux interrupt
39+
flags as follows (only 4 valid for peripheral interrupts):
40+
0 = none (decided by software)
41+
1 = low-to-high edge triggered
42+
2 = high-to-low edge triggered
43+
3 = both edge triggered
44+
4 = active-high level-sensitive (required for perip irqs)
45+
8 = active-low level-sensitive
46+
47+
* Examples
48+
49+
Example 1:
50+
51+
/*
52+
* TZ1090 PDC block
53+
*/
54+
pdc: pdc@0x02006000 {
55+
// This is an interrupt controller node.
56+
interrupt-controller;
57+
58+
// Three cells to encode interrupt sources.
59+
#interrupt-cells = <2>;
60+
61+
// Offset address of 0x02006000 and size of 0x1000.
62+
reg = <0x02006000 0x1000>;
63+
64+
// Compatible with Meta hardware trigger block.
65+
compatible = "img,pdc-intc";
66+
67+
// Three peripherals are connected.
68+
num-perips = <3>;
69+
70+
// Four SysWakes are connected.
71+
num-syswakes = <4>;
72+
73+
interrupts = <18 4 /* level */>, /* Syswakes */
74+
<30 4 /* level */>, /* Peripheral 0 (RTC) */
75+
<29 4 /* level */>, /* Peripheral 1 (IR) */
76+
<31 4 /* level */>; /* Peripheral 2 (WDT) */
77+
};
78+
79+
Example 2:
80+
81+
/*
82+
* An SoC peripheral that is wired through the PDC.
83+
*/
84+
rtc0 {
85+
// The interrupt controller that this device is wired to.
86+
interrupt-parent = <&pdc>;
87+
88+
// Interrupt source Peripheral 0
89+
interrupts = <0 /* Peripheral 0 (RTC) */
90+
4> /* IRQ_TYPE_LEVEL_HIGH */
91+
};
92+
93+
Example 3:
94+
95+
/*
96+
* An interrupt generating device that is wired to a SysWake pin.
97+
*/
98+
touchscreen0 {
99+
// The interrupt controller that this device is wired to.
100+
interrupt-parent = <&pdc>;
101+
102+
// Interrupt source SysWake 0 that is active-low level-sensitive
103+
interrupts = <8 /* SysWake0 */
104+
8 /* IRQ_TYPE_LEVEL_LOW */>;
105+
};

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5442,6 +5442,7 @@ F: drivers/watchdog/mena21_wdt.c
54425442

54435443
METAG ARCHITECTURE
54445444
M: James Hogan <james.hogan@imgtec.com>
5445+
L: linux-metag@vger.kernel.org
54455446
S: Supported
54465447
F: arch/metag/
54475448
F: Documentation/metag/

arch/metag/Kconfig.soc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ config META21_FPGA
1616

1717
config SOC_TZ1090
1818
bool "Toumaz Xenif TZ1090 SoC (Comet)"
19+
select ARCH_WANT_OPTIONAL_GPIOLIB
20+
select IMGPDC_IRQ
1921
select METAG_LNKGET_AROUND_CACHE
2022
select METAG_META21
2123
select METAG_SMP_WRITE_REORDERING

arch/metag/boot/dts/tz1090.dtsi

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include "skeleton.dtsi"
1010

11+
#include <dt-bindings/interrupt-controller/irq.h>
12+
1113
/ {
1214
compatible = "toumaz,tz1090", "img,meta";
1315

@@ -26,6 +28,22 @@
2628
#size-cells = <1>;
2729
ranges;
2830

31+
pdc: pdc@0x02006000 {
32+
interrupt-controller;
33+
#interrupt-cells = <2>;
34+
35+
reg = <0x02006000 0x1000>;
36+
compatible = "img,pdc-intc";
37+
38+
num-perips = <3>;
39+
num-syswakes = <3>;
40+
41+
interrupts = <18 IRQ_TYPE_LEVEL_HIGH>, /* Syswakes */
42+
<30 IRQ_TYPE_LEVEL_HIGH>, /* Perip 0 (RTC) */
43+
<29 IRQ_TYPE_LEVEL_HIGH>, /* Perip 1 (IR) */
44+
<31 IRQ_TYPE_LEVEL_HIGH>; /* Perip 2 (WDT) */
45+
};
46+
2947
pinctrl: pinctrl@02005800 {
3048
#gpio-range-cells = <3>;
3149
compatible = "img,tz1090-pinctrl";
@@ -37,5 +55,54 @@
3755
compatible = "img,tz1090-pdc-pinctrl";
3856
reg = <0x02006500 0x100>;
3957
};
58+
59+
gpios: gpios@02005800 {
60+
#address-cells = <1>;
61+
#size-cells = <0>;
62+
compatible = "img,tz1090-gpio";
63+
reg = <0x02005800 0x90>;
64+
65+
gpios0: bank@0 {
66+
gpio-controller;
67+
interrupt-controller;
68+
#gpio-cells = <2>;
69+
#interrupt-cells = <2>;
70+
reg = <0>;
71+
interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
72+
gpio-ranges = <&pinctrl 0 0 30>;
73+
};
74+
gpios1: bank@1 {
75+
gpio-controller;
76+
interrupt-controller;
77+
#gpio-cells = <2>;
78+
#interrupt-cells = <2>;
79+
reg = <1>;
80+
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
81+
gpio-ranges = <&pinctrl 0 30 30>;
82+
};
83+
gpios2: bank@2 {
84+
gpio-controller;
85+
interrupt-controller;
86+
#gpio-cells = <2>;
87+
#interrupt-cells = <2>;
88+
reg = <2>;
89+
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
90+
gpio-ranges = <&pinctrl 0 60 30>;
91+
};
92+
};
93+
94+
pdc_gpios: gpios@02006500 {
95+
gpio-controller;
96+
#gpio-cells = <2>;
97+
98+
compatible = "img,tz1090-pdc-gpio";
99+
reg = <0x02006500 0x100>;
100+
101+
interrupt-parent = <&pdc>;
102+
interrupts = <8 IRQ_TYPE_NONE>,
103+
<9 IRQ_TYPE_NONE>,
104+
<10 IRQ_TYPE_NONE>;
105+
gpio-ranges = <&pdc_pinctrl 0 0 7>;
106+
};
40107
};
41108
};

drivers/irqchip/Kconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ config ARM_VIC_NR
3030
The maximum number of VICs available in the system, for
3131
power management.
3232

33+
config IMGPDC_IRQ
34+
bool
35+
select GENERIC_IRQ_CHIP
36+
select IRQ_DOMAIN
37+
3338
config ORION_IRQCHIP
3439
bool
3540
select IRQ_DOMAIN

drivers/irqchip/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o
1414
obj-$(CONFIG_ARM_GIC) += irq-gic.o
1515
obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
1616
obj-$(CONFIG_ARM_VIC) += irq-vic.o
17+
obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o
1718
obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o
1819
obj-$(CONFIG_RENESAS_INTC_IRQPIN) += irq-renesas-intc-irqpin.o
1920
obj-$(CONFIG_RENESAS_IRQC) += irq-renesas-irqc.o

0 commit comments

Comments
 (0)