Skip to content

Commit

Permalink
Merge tag 'metag-for-v3.12' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/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
  • Loading branch information
Linus Torvalds committed Sep 9, 2013
2 parents 89c5a94 + b6ef916 commit 255ae3f
Show file tree
Hide file tree
Showing 7 changed files with 680 additions and 0 deletions.
105 changes: 105 additions & 0 deletions Documentation/devicetree/bindings/metag/pdc-intc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
* ImgTec Powerdown Controller (PDC) Interrupt Controller Binding

This binding specifies what properties must be available in the device tree
representation of a PDC IRQ controller. This has a number of input interrupt
lines which can wake the system, and are passed on through output interrupt
lines.

Required properties:

- compatible: Specifies the compatibility list for the interrupt controller.
The type shall be <string> and the value shall include "img,pdc-intc".

- reg: Specifies the base PDC physical address(s) and size(s) of the
addressable register space. The type shall be <prop-encoded-array>.

- interrupt-controller: The presence of this property identifies the node
as an interrupt controller. No property value shall be defined.

- #interrupt-cells: Specifies the number of cells needed to encode an
interrupt source. The type shall be a <u32> and the value shall be 2.

- num-perips: Number of waking peripherals.

- num-syswakes: Number of SysWake inputs.

- interrupts: List of interrupt specifiers. The first specifier shall be the
shared SysWake interrupt, and remaining specifies shall be PDC peripheral
interrupts in order.

* Interrupt Specifier Definition

Interrupt specifiers consists of 2 cells encoded as follows:

- <1st-cell>: The interrupt-number that identifies the interrupt source.
0-7: Peripheral interrupts
8-15: SysWake interrupts

- <2nd-cell>: The level-sense information, encoded using the Linux interrupt
flags as follows (only 4 valid for peripheral interrupts):
0 = none (decided by software)
1 = low-to-high edge triggered
2 = high-to-low edge triggered
3 = both edge triggered
4 = active-high level-sensitive (required for perip irqs)
8 = active-low level-sensitive

* Examples

Example 1:

/*
* TZ1090 PDC block
*/
pdc: pdc@0x02006000 {
// This is an interrupt controller node.
interrupt-controller;

// Three cells to encode interrupt sources.
#interrupt-cells = <2>;

// Offset address of 0x02006000 and size of 0x1000.
reg = <0x02006000 0x1000>;

// Compatible with Meta hardware trigger block.
compatible = "img,pdc-intc";

// Three peripherals are connected.
num-perips = <3>;

// Four SysWakes are connected.
num-syswakes = <4>;

interrupts = <18 4 /* level */>, /* Syswakes */
<30 4 /* level */>, /* Peripheral 0 (RTC) */
<29 4 /* level */>, /* Peripheral 1 (IR) */
<31 4 /* level */>; /* Peripheral 2 (WDT) */
};

Example 2:

/*
* An SoC peripheral that is wired through the PDC.
*/
rtc0 {
// The interrupt controller that this device is wired to.
interrupt-parent = <&pdc>;

// Interrupt source Peripheral 0
interrupts = <0 /* Peripheral 0 (RTC) */
4> /* IRQ_TYPE_LEVEL_HIGH */
};

Example 3:

/*
* An interrupt generating device that is wired to a SysWake pin.
*/
touchscreen0 {
// The interrupt controller that this device is wired to.
interrupt-parent = <&pdc>;

// Interrupt source SysWake 0 that is active-low level-sensitive
interrupts = <8 /* SysWake0 */
8 /* IRQ_TYPE_LEVEL_LOW */>;
};
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5442,6 +5442,7 @@ F: drivers/watchdog/mena21_wdt.c

METAG ARCHITECTURE
M: James Hogan <james.hogan@imgtec.com>
L: linux-metag@vger.kernel.org
S: Supported
F: arch/metag/
F: Documentation/metag/
Expand Down
2 changes: 2 additions & 0 deletions arch/metag/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ config META21_FPGA

config SOC_TZ1090
bool "Toumaz Xenif TZ1090 SoC (Comet)"
select ARCH_WANT_OPTIONAL_GPIOLIB
select IMGPDC_IRQ
select METAG_LNKGET_AROUND_CACHE
select METAG_META21
select METAG_SMP_WRITE_REORDERING
Expand Down
67 changes: 67 additions & 0 deletions arch/metag/boot/dts/tz1090.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include "skeleton.dtsi"

#include <dt-bindings/interrupt-controller/irq.h>

/ {
compatible = "toumaz,tz1090", "img,meta";

Expand All @@ -26,6 +28,22 @@
#size-cells = <1>;
ranges;

pdc: pdc@0x02006000 {
interrupt-controller;
#interrupt-cells = <2>;

reg = <0x02006000 0x1000>;
compatible = "img,pdc-intc";

num-perips = <3>;
num-syswakes = <3>;

interrupts = <18 IRQ_TYPE_LEVEL_HIGH>, /* Syswakes */
<30 IRQ_TYPE_LEVEL_HIGH>, /* Perip 0 (RTC) */
<29 IRQ_TYPE_LEVEL_HIGH>, /* Perip 1 (IR) */
<31 IRQ_TYPE_LEVEL_HIGH>; /* Perip 2 (WDT) */
};

pinctrl: pinctrl@02005800 {
#gpio-range-cells = <3>;
compatible = "img,tz1090-pinctrl";
Expand All @@ -37,5 +55,54 @@
compatible = "img,tz1090-pdc-pinctrl";
reg = <0x02006500 0x100>;
};

gpios: gpios@02005800 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "img,tz1090-gpio";
reg = <0x02005800 0x90>;

gpios0: bank@0 {
gpio-controller;
interrupt-controller;
#gpio-cells = <2>;
#interrupt-cells = <2>;
reg = <0>;
interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
gpio-ranges = <&pinctrl 0 0 30>;
};
gpios1: bank@1 {
gpio-controller;
interrupt-controller;
#gpio-cells = <2>;
#interrupt-cells = <2>;
reg = <1>;
interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
gpio-ranges = <&pinctrl 0 30 30>;
};
gpios2: bank@2 {
gpio-controller;
interrupt-controller;
#gpio-cells = <2>;
#interrupt-cells = <2>;
reg = <2>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
gpio-ranges = <&pinctrl 0 60 30>;
};
};

pdc_gpios: gpios@02006500 {
gpio-controller;
#gpio-cells = <2>;

compatible = "img,tz1090-pdc-gpio";
reg = <0x02006500 0x100>;

interrupt-parent = <&pdc>;
interrupts = <8 IRQ_TYPE_NONE>,
<9 IRQ_TYPE_NONE>,
<10 IRQ_TYPE_NONE>;
gpio-ranges = <&pdc_pinctrl 0 0 7>;
};
};
};
5 changes: 5 additions & 0 deletions drivers/irqchip/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ config ARM_VIC_NR
The maximum number of VICs available in the system, for
power management.

config IMGPDC_IRQ
bool
select GENERIC_IRQ_CHIP
select IRQ_DOMAIN

config ORION_IRQCHIP
bool
select IRQ_DOMAIN
Expand Down
1 change: 1 addition & 0 deletions drivers/irqchip/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ obj-$(CONFIG_ARCH_SPEAR3XX) += spear-shirq.o
obj-$(CONFIG_ARM_GIC) += irq-gic.o
obj-$(CONFIG_ARM_NVIC) += irq-nvic.o
obj-$(CONFIG_ARM_VIC) += irq-vic.o
obj-$(CONFIG_IMGPDC_IRQ) += irq-imgpdc.o
obj-$(CONFIG_SIRF_IRQ) += irq-sirfsoc.o
obj-$(CONFIG_RENESAS_INTC_IRQPIN) += irq-renesas-intc-irqpin.o
obj-$(CONFIG_RENESAS_IRQC) += irq-renesas-irqc.o
Expand Down
Loading

0 comments on commit 255ae3f

Please sign in to comment.