xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/apple,pinctrl.yaml (revision fac71e4e09885bb2afa3d984a0c239a52e1a7418)
15956d97fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
25956d97fSEmmanuel Vadot%YAML 1.2
35956d97fSEmmanuel Vadot---
45956d97fSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/apple,pinctrl.yaml#
55956d97fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65956d97fSEmmanuel Vadot
75956d97fSEmmanuel Vadottitle: Apple GPIO controller
85956d97fSEmmanuel Vadot
95956d97fSEmmanuel Vadotmaintainers:
105956d97fSEmmanuel Vadot  - Mark Kettenis <kettenis@openbsd.org>
115956d97fSEmmanuel Vadot
125956d97fSEmmanuel Vadotdescription: |
135956d97fSEmmanuel Vadot  The Apple GPIO controller is a simple combined pin and GPIO
145956d97fSEmmanuel Vadot  controller present on Apple ARM SoC platforms, including various
155956d97fSEmmanuel Vadot  iPhone and iPad devices and the "Apple Silicon" Macs.
165956d97fSEmmanuel Vadot
175956d97fSEmmanuel Vadotproperties:
185956d97fSEmmanuel Vadot  compatible:
195956d97fSEmmanuel Vadot    items:
20e67e8565SEmmanuel Vadot      - enum:
21e67e8565SEmmanuel Vadot          - apple,t8103-pinctrl
22*fac71e4eSEmmanuel Vadot          - apple,t8112-pinctrl
23e67e8565SEmmanuel Vadot          - apple,t6000-pinctrl
245956d97fSEmmanuel Vadot      - const: apple,pinctrl
255956d97fSEmmanuel Vadot
265956d97fSEmmanuel Vadot  reg:
275956d97fSEmmanuel Vadot    maxItems: 1
285956d97fSEmmanuel Vadot
295956d97fSEmmanuel Vadot  clocks:
305956d97fSEmmanuel Vadot    maxItems: 1
315956d97fSEmmanuel Vadot
325956d97fSEmmanuel Vadot  gpio-controller: true
335956d97fSEmmanuel Vadot
345956d97fSEmmanuel Vadot  '#gpio-cells':
355956d97fSEmmanuel Vadot    const: 2
365956d97fSEmmanuel Vadot
375956d97fSEmmanuel Vadot  gpio-ranges:
385956d97fSEmmanuel Vadot    maxItems: 1
395956d97fSEmmanuel Vadot
408cc087a1SEmmanuel Vadot  apple,npins:
418cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
428cc087a1SEmmanuel Vadot    description: The number of pins in this GPIO controller.
438cc087a1SEmmanuel Vadot
445956d97fSEmmanuel Vadot  interrupts:
455956d97fSEmmanuel Vadot    description: One interrupt for each of the (up to 7) interrupt
465956d97fSEmmanuel Vadot      groups supported by the controller sorted by interrupt group
475956d97fSEmmanuel Vadot      number in ascending order.
485956d97fSEmmanuel Vadot    minItems: 1
495956d97fSEmmanuel Vadot    maxItems: 7
505956d97fSEmmanuel Vadot
515956d97fSEmmanuel Vadot  interrupt-controller: true
525956d97fSEmmanuel Vadot
538cc087a1SEmmanuel Vadot  '#interrupt-cells':
548cc087a1SEmmanuel Vadot    const: 2
558cc087a1SEmmanuel Vadot
56e67e8565SEmmanuel Vadot  power-domains:
57e67e8565SEmmanuel Vadot    maxItems: 1
58e67e8565SEmmanuel Vadot
595956d97fSEmmanuel VadotpatternProperties:
605956d97fSEmmanuel Vadot  '-pins$':
615956d97fSEmmanuel Vadot    type: object
625956d97fSEmmanuel Vadot    $ref: pinmux-node.yaml#
635956d97fSEmmanuel Vadot
645956d97fSEmmanuel Vadot    properties:
655956d97fSEmmanuel Vadot      pinmux:
665956d97fSEmmanuel Vadot        description:
675956d97fSEmmanuel Vadot          Values are constructed from pin number and alternate function
685956d97fSEmmanuel Vadot          configuration number using the APPLE_PINMUX() helper macro
695956d97fSEmmanuel Vadot          defined in include/dt-bindings/pinctrl/apple.h.
705956d97fSEmmanuel Vadot
715956d97fSEmmanuel Vadot    required:
725956d97fSEmmanuel Vadot      - pinmux
735956d97fSEmmanuel Vadot
745956d97fSEmmanuel Vadot    additionalProperties: false
755956d97fSEmmanuel Vadot
76e67e8565SEmmanuel VadotallOf:
77*fac71e4eSEmmanuel Vadot  - $ref: pinctrl.yaml#
78e67e8565SEmmanuel Vadot
795956d97fSEmmanuel Vadotrequired:
805956d97fSEmmanuel Vadot  - compatible
815956d97fSEmmanuel Vadot  - reg
825956d97fSEmmanuel Vadot  - gpio-controller
835956d97fSEmmanuel Vadot  - '#gpio-cells'
845956d97fSEmmanuel Vadot  - gpio-ranges
858cc087a1SEmmanuel Vadot  - apple,npins
865956d97fSEmmanuel Vadot
875956d97fSEmmanuel VadotadditionalProperties: false
885956d97fSEmmanuel Vadot
895956d97fSEmmanuel Vadotexamples:
905956d97fSEmmanuel Vadot  - |
915956d97fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/apple-aic.h>
925956d97fSEmmanuel Vadot    #include <dt-bindings/pinctrl/apple.h>
935956d97fSEmmanuel Vadot
945956d97fSEmmanuel Vadot    soc {
955956d97fSEmmanuel Vadot      #address-cells = <2>;
965956d97fSEmmanuel Vadot      #size-cells = <2>;
975956d97fSEmmanuel Vadot
985956d97fSEmmanuel Vadot      pinctrl: pinctrl@23c100000 {
995956d97fSEmmanuel Vadot        compatible = "apple,t8103-pinctrl", "apple,pinctrl";
1005956d97fSEmmanuel Vadot        reg = <0x2 0x3c100000 0x0 0x100000>;
1015956d97fSEmmanuel Vadot        clocks = <&gpio_clk>;
1025956d97fSEmmanuel Vadot
1035956d97fSEmmanuel Vadot        gpio-controller;
1045956d97fSEmmanuel Vadot        #gpio-cells = <2>;
1055956d97fSEmmanuel Vadot        gpio-ranges = <&pinctrl 0 0 212>;
1068cc087a1SEmmanuel Vadot        apple,npins = <212>;
1075956d97fSEmmanuel Vadot
1085956d97fSEmmanuel Vadot        interrupt-controller;
1098cc087a1SEmmanuel Vadot        #interrupt-cells = <2>;
1105956d97fSEmmanuel Vadot        interrupt-parent = <&aic>;
1115956d97fSEmmanuel Vadot        interrupts = <AIC_IRQ 16 IRQ_TYPE_LEVEL_HIGH>,
1125956d97fSEmmanuel Vadot                     <AIC_IRQ 17 IRQ_TYPE_LEVEL_HIGH>,
1135956d97fSEmmanuel Vadot                     <AIC_IRQ 18 IRQ_TYPE_LEVEL_HIGH>,
1145956d97fSEmmanuel Vadot                     <AIC_IRQ 19 IRQ_TYPE_LEVEL_HIGH>,
1155956d97fSEmmanuel Vadot                     <AIC_IRQ 20 IRQ_TYPE_LEVEL_HIGH>,
1165956d97fSEmmanuel Vadot                     <AIC_IRQ 21 IRQ_TYPE_LEVEL_HIGH>,
1175956d97fSEmmanuel Vadot                     <AIC_IRQ 22 IRQ_TYPE_LEVEL_HIGH>;
1185956d97fSEmmanuel Vadot
1195956d97fSEmmanuel Vadot        pcie_pins: pcie-pins {
1205956d97fSEmmanuel Vadot          pinmux = <APPLE_PINMUX(150, 1)>,
1215956d97fSEmmanuel Vadot                   <APPLE_PINMUX(151, 1)>,
1225956d97fSEmmanuel Vadot                   <APPLE_PINMUX(32, 1)>;
1235956d97fSEmmanuel Vadot        };
1245956d97fSEmmanuel Vadot      };
1255956d97fSEmmanuel Vadot    };
126