xref: /freebsd-src/sys/contrib/device-tree/Bindings/interrupt-controller/fsl,ls-extirq.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1d5b0e70fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2d5b0e70fSEmmanuel Vadot%YAML 1.2
3d5b0e70fSEmmanuel Vadot---
4d5b0e70fSEmmanuel Vadot$id: http://devicetree.org/schemas/interrupt-controller/fsl,ls-extirq.yaml#
5d5b0e70fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6d5b0e70fSEmmanuel Vadot
7d5b0e70fSEmmanuel Vadottitle: Freescale Layerscape External Interrupt Controller
8d5b0e70fSEmmanuel Vadot
9d5b0e70fSEmmanuel Vadotmaintainers:
10d5b0e70fSEmmanuel Vadot  - Shawn Guo <shawnguo@kernel.org>
11d5b0e70fSEmmanuel Vadot
12d5b0e70fSEmmanuel Vadotdescription: |
13d5b0e70fSEmmanuel Vadot  Some Layerscape SOCs (LS1021A, LS1043A, LS1046A LS1088A, LS208xA,
14d5b0e70fSEmmanuel Vadot  LX216xA) support inverting the polarity of certain external interrupt
15d5b0e70fSEmmanuel Vadot  lines.
16d5b0e70fSEmmanuel Vadot
17d5b0e70fSEmmanuel Vadotproperties:
18d5b0e70fSEmmanuel Vadot  compatible:
19d5b0e70fSEmmanuel Vadot    oneOf:
20d5b0e70fSEmmanuel Vadot      - enum:
21d5b0e70fSEmmanuel Vadot          - fsl,ls1021a-extirq
22d5b0e70fSEmmanuel Vadot          - fsl,ls1043a-extirq
23d5b0e70fSEmmanuel Vadot          - fsl,ls1088a-extirq
24d5b0e70fSEmmanuel Vadot      - items:
25d5b0e70fSEmmanuel Vadot          - enum:
26d5b0e70fSEmmanuel Vadot              - fsl,ls1046a-extirq
27d5b0e70fSEmmanuel Vadot          - const: fsl,ls1043a-extirq
28d5b0e70fSEmmanuel Vadot      - items:
29d5b0e70fSEmmanuel Vadot          - enum:
30d5b0e70fSEmmanuel Vadot              - fsl,ls2080a-extirq
31d5b0e70fSEmmanuel Vadot              - fsl,lx2160a-extirq
32d5b0e70fSEmmanuel Vadot          - const: fsl,ls1088a-extirq
33d5b0e70fSEmmanuel Vadot
34d5b0e70fSEmmanuel Vadot  '#interrupt-cells':
35d5b0e70fSEmmanuel Vadot    const: 2
36d5b0e70fSEmmanuel Vadot
37d5b0e70fSEmmanuel Vadot  '#address-cells':
38d5b0e70fSEmmanuel Vadot    const: 0
39d5b0e70fSEmmanuel Vadot
40d5b0e70fSEmmanuel Vadot  interrupt-controller: true
41d5b0e70fSEmmanuel Vadot
42d5b0e70fSEmmanuel Vadot  reg:
43d5b0e70fSEmmanuel Vadot    maxItems: 1
44d5b0e70fSEmmanuel Vadot    description:
45d5b0e70fSEmmanuel Vadot      Specifies the Interrupt Polarity Control Register (INTPCR) in the
46d5b0e70fSEmmanuel Vadot      SCFG or the External Interrupt Control Register (IRQCR) in the ISC.
47d5b0e70fSEmmanuel Vadot
48d5b0e70fSEmmanuel Vadot  interrupt-map:
49d5b0e70fSEmmanuel Vadot    description: Specifies the mapping from external interrupts to GIC interrupts.
50d5b0e70fSEmmanuel Vadot
51d5b0e70fSEmmanuel Vadot  interrupt-map-mask: true
52d5b0e70fSEmmanuel Vadot
53d5b0e70fSEmmanuel Vadotrequired:
54d5b0e70fSEmmanuel Vadot  - compatible
55d5b0e70fSEmmanuel Vadot  - '#interrupt-cells'
56d5b0e70fSEmmanuel Vadot  - '#address-cells'
57d5b0e70fSEmmanuel Vadot  - interrupt-controller
58d5b0e70fSEmmanuel Vadot  - reg
59d5b0e70fSEmmanuel Vadot  - interrupt-map
60d5b0e70fSEmmanuel Vadot  - interrupt-map-mask
61d5b0e70fSEmmanuel Vadot
62d5b0e70fSEmmanuel VadotallOf:
63d5b0e70fSEmmanuel Vadot  - if:
64d5b0e70fSEmmanuel Vadot      properties:
65d5b0e70fSEmmanuel Vadot        compatible:
66d5b0e70fSEmmanuel Vadot          contains:
67d5b0e70fSEmmanuel Vadot            enum:
68d5b0e70fSEmmanuel Vadot              - fsl,ls1021a-extirq
69d5b0e70fSEmmanuel Vadot    then:
70d5b0e70fSEmmanuel Vadot      properties:
71d5b0e70fSEmmanuel Vadot        interrupt-map:
72d5b0e70fSEmmanuel Vadot          minItems: 6
73d5b0e70fSEmmanuel Vadot          maxItems: 6
74d5b0e70fSEmmanuel Vadot        interrupt-map-mask:
75d5b0e70fSEmmanuel Vadot          items:
76d5b0e70fSEmmanuel Vadot            - const: 0x7
77d5b0e70fSEmmanuel Vadot            - const: 0
78d5b0e70fSEmmanuel Vadot  - if:
79d5b0e70fSEmmanuel Vadot      properties:
80d5b0e70fSEmmanuel Vadot        compatible:
81d5b0e70fSEmmanuel Vadot          contains:
82d5b0e70fSEmmanuel Vadot            enum:
83d5b0e70fSEmmanuel Vadot              - fsl,ls1043a-extirq
84d5b0e70fSEmmanuel Vadot              - fsl,ls1046a-extirq
85d5b0e70fSEmmanuel Vadot    then:
86d5b0e70fSEmmanuel Vadot      properties:
87d5b0e70fSEmmanuel Vadot        interrupt-map:
88d5b0e70fSEmmanuel Vadot          minItems: 12
89d5b0e70fSEmmanuel Vadot          maxItems: 12
90d5b0e70fSEmmanuel Vadot        interrupt-map-mask:
91d5b0e70fSEmmanuel Vadot          items:
92d5b0e70fSEmmanuel Vadot            - const: 0xf
93d5b0e70fSEmmanuel Vadot            - const: 0
94d5b0e70fSEmmanuel Vadot
95*b2d2a78aSEmmanuel Vadot  - if:
96*b2d2a78aSEmmanuel Vadot      properties:
97*b2d2a78aSEmmanuel Vadot        compatible:
98*b2d2a78aSEmmanuel Vadot          contains:
99*b2d2a78aSEmmanuel Vadot            enum:
100*b2d2a78aSEmmanuel Vadot              - fsl,ls1088a-extirq
101*b2d2a78aSEmmanuel Vadot              - fsl,ls2080a-extirq
102*b2d2a78aSEmmanuel Vadot              - fsl,lx2160a-extirq
103*b2d2a78aSEmmanuel Vadot# The driver(drivers/irqchip/irq-ls-extirq.c) have not use standard DT
104*b2d2a78aSEmmanuel Vadot# function to parser interrupt-map. So it doesn't consider '#address-size'
105*b2d2a78aSEmmanuel Vadot# in parent interrupt controller, such as GIC.
106*b2d2a78aSEmmanuel Vadot#
107*b2d2a78aSEmmanuel Vadot# When dt-binding verify interrupt-map, item data matrix is spitted at
108*b2d2a78aSEmmanuel Vadot# incorrect position. Remove interrupt-map restriction because it always
109*b2d2a78aSEmmanuel Vadot# wrong.
110*b2d2a78aSEmmanuel Vadot
111*b2d2a78aSEmmanuel Vadot    then:
112*b2d2a78aSEmmanuel Vadot      properties:
113*b2d2a78aSEmmanuel Vadot        interrupt-map-mask:
114*b2d2a78aSEmmanuel Vadot          items:
115*b2d2a78aSEmmanuel Vadot            - const: 0xf
116*b2d2a78aSEmmanuel Vadot            - const: 0
117*b2d2a78aSEmmanuel Vadot
118d5b0e70fSEmmanuel VadotadditionalProperties: false
119d5b0e70fSEmmanuel Vadot
120d5b0e70fSEmmanuel Vadotexamples:
121d5b0e70fSEmmanuel Vadot  - |
122d5b0e70fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/arm-gic.h>
123d5b0e70fSEmmanuel Vadot    interrupt-controller@1ac {
124d5b0e70fSEmmanuel Vadot            compatible = "fsl,ls1021a-extirq";
125d5b0e70fSEmmanuel Vadot            #interrupt-cells = <2>;
126d5b0e70fSEmmanuel Vadot            #address-cells = <0>;
127d5b0e70fSEmmanuel Vadot            interrupt-controller;
128d5b0e70fSEmmanuel Vadot            reg = <0x1ac 4>;
129d5b0e70fSEmmanuel Vadot            interrupt-map =
130d5b0e70fSEmmanuel Vadot                    <0 0 &gic GIC_SPI 163 IRQ_TYPE_LEVEL_HIGH>,
131d5b0e70fSEmmanuel Vadot                    <1 0 &gic GIC_SPI 164 IRQ_TYPE_LEVEL_HIGH>,
132d5b0e70fSEmmanuel Vadot                    <2 0 &gic GIC_SPI 165 IRQ_TYPE_LEVEL_HIGH>,
133d5b0e70fSEmmanuel Vadot                    <3 0 &gic GIC_SPI 167 IRQ_TYPE_LEVEL_HIGH>,
134d5b0e70fSEmmanuel Vadot                    <4 0 &gic GIC_SPI 168 IRQ_TYPE_LEVEL_HIGH>,
135d5b0e70fSEmmanuel Vadot                    <5 0 &gic GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH>;
136d5b0e70fSEmmanuel Vadot            interrupt-map-mask = <0x7 0x0>;
137d5b0e70fSEmmanuel Vadot    };
138