xref: /freebsd/sys/contrib/device-tree/Bindings/pinctrl/spacemit,k1-pinctrl.yaml (revision ae5de77ed78ae54d86cead5604869212e8008e6b)
15f62a964SEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
25f62a964SEmmanuel Vadot%YAML 1.2
35f62a964SEmmanuel Vadot---
45f62a964SEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/spacemit,k1-pinctrl.yaml#
55f62a964SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
65f62a964SEmmanuel Vadot
75f62a964SEmmanuel Vadottitle: SpacemiT K1 SoC Pin Controller
85f62a964SEmmanuel Vadot
95f62a964SEmmanuel Vadotmaintainers:
105f62a964SEmmanuel Vadot  - Yixun Lan <dlan@gentoo.org>
115f62a964SEmmanuel Vadot
125f62a964SEmmanuel Vadotproperties:
135f62a964SEmmanuel Vadot  compatible:
145f62a964SEmmanuel Vadot    const: spacemit,k1-pinctrl
155f62a964SEmmanuel Vadot
165f62a964SEmmanuel Vadot  reg:
175f62a964SEmmanuel Vadot    items:
185f62a964SEmmanuel Vadot      - description: pinctrl io memory base
195f62a964SEmmanuel Vadot
20*ae5de77eSEmmanuel Vadot  clocks:
21*ae5de77eSEmmanuel Vadot    items:
22*ae5de77eSEmmanuel Vadot      - description: Functional Clock
23*ae5de77eSEmmanuel Vadot      - description: Bus Clock
24*ae5de77eSEmmanuel Vadot
25*ae5de77eSEmmanuel Vadot  clock-names:
26*ae5de77eSEmmanuel Vadot    items:
27*ae5de77eSEmmanuel Vadot      - const: func
28*ae5de77eSEmmanuel Vadot      - const: bus
29*ae5de77eSEmmanuel Vadot
30*ae5de77eSEmmanuel Vadot  resets:
31*ae5de77eSEmmanuel Vadot    maxItems: 1
32*ae5de77eSEmmanuel Vadot
335f62a964SEmmanuel VadotpatternProperties:
345f62a964SEmmanuel Vadot  '-cfg$':
355f62a964SEmmanuel Vadot    type: object
365f62a964SEmmanuel Vadot    additionalProperties: false
375f62a964SEmmanuel Vadot
385f62a964SEmmanuel Vadot    description:
395f62a964SEmmanuel Vadot      A pinctrl node should contain at least one subnode representing the
405f62a964SEmmanuel Vadot      pinctrl groups available on the machine.
415f62a964SEmmanuel Vadot
425f62a964SEmmanuel Vadot    patternProperties:
435f62a964SEmmanuel Vadot      '-pins$':
445f62a964SEmmanuel Vadot        type: object
455f62a964SEmmanuel Vadot        additionalProperties: false
465f62a964SEmmanuel Vadot
475f62a964SEmmanuel Vadot        description:
485f62a964SEmmanuel Vadot          Each subnode will list the pins it needs, and how they should
495f62a964SEmmanuel Vadot          be configured, with regard to muxer configuration, bias pull,
505f62a964SEmmanuel Vadot          drive strength, input schmitt trigger, slew rate, power source.
515f62a964SEmmanuel Vadot
525f62a964SEmmanuel Vadot        allOf:
535f62a964SEmmanuel Vadot          - $ref: pincfg-node.yaml#
545f62a964SEmmanuel Vadot          - $ref: pinmux-node.yaml#
555f62a964SEmmanuel Vadot
565f62a964SEmmanuel Vadot        properties:
575f62a964SEmmanuel Vadot          pinmux:
585f62a964SEmmanuel Vadot            description:
595f62a964SEmmanuel Vadot              The list of GPIOs and their mux settings that properties in the
605f62a964SEmmanuel Vadot              node apply to. This should be set using the K1_PADCONF macro to
615f62a964SEmmanuel Vadot              construct the value.
625f62a964SEmmanuel Vadot
635f62a964SEmmanuel Vadot          bias-disable: true
645f62a964SEmmanuel Vadot
655f62a964SEmmanuel Vadot          bias-pull-down: true
665f62a964SEmmanuel Vadot
675f62a964SEmmanuel Vadot          bias-pull-up:
685f62a964SEmmanuel Vadot            description: |
695f62a964SEmmanuel Vadot              typical value for selecting bias pull up or strong pull up.
705f62a964SEmmanuel Vadot              0: normal bias pull up
715f62a964SEmmanuel Vadot              1: strong bias pull up
725f62a964SEmmanuel Vadot            enum: [ 0, 1 ]
735f62a964SEmmanuel Vadot
745f62a964SEmmanuel Vadot          drive-strength:
755f62a964SEmmanuel Vadot            description: |
765f62a964SEmmanuel Vadot              typical current when output high level.
775f62a964SEmmanuel Vadot              1.8V output: 11, 21, 32, 42 (mA)
785f62a964SEmmanuel Vadot              3.3V output: 7, 10, 13, 16, 19, 23, 26, 29 (mA)
795f62a964SEmmanuel Vadot
805f62a964SEmmanuel Vadot          input-schmitt:
815f62a964SEmmanuel Vadot            description: |
825f62a964SEmmanuel Vadot              typical threshold for schmitt trigger.
835f62a964SEmmanuel Vadot              0: buffer mode
845f62a964SEmmanuel Vadot              1: trigger mode
855f62a964SEmmanuel Vadot              2, 3: trigger mode
865f62a964SEmmanuel Vadot            $ref: /schemas/types.yaml#/definitions/uint32
875f62a964SEmmanuel Vadot            enum: [ 0, 1, 2, 3 ]
885f62a964SEmmanuel Vadot
895f62a964SEmmanuel Vadot          power-source:
905f62a964SEmmanuel Vadot            description: external power supplies at 1.8v or 3.3v.
915f62a964SEmmanuel Vadot            enum: [ 1800, 3300 ]
925f62a964SEmmanuel Vadot
935f62a964SEmmanuel Vadot          slew-rate:
945f62a964SEmmanuel Vadot            description: |
955f62a964SEmmanuel Vadot              slew rate for output buffer.
965f62a964SEmmanuel Vadot              0: disable it
975f62a964SEmmanuel Vadot              1: enable it (via bundled value from drive strength)
985f62a964SEmmanuel Vadot              2: slow speed 0
995f62a964SEmmanuel Vadot              3: slow speed 1
1005f62a964SEmmanuel Vadot              4: medium speed
1015f62a964SEmmanuel Vadot              5: fast speed
1025f62a964SEmmanuel Vadot            enum: [ 0, 1, 2, 3, 4, 5 ]
1035f62a964SEmmanuel Vadot
1045f62a964SEmmanuel Vadot        required:
1055f62a964SEmmanuel Vadot          - pinmux
1065f62a964SEmmanuel Vadot
1075f62a964SEmmanuel Vadotrequired:
1085f62a964SEmmanuel Vadot  - compatible
1095f62a964SEmmanuel Vadot  - reg
110*ae5de77eSEmmanuel Vadot  - clocks
111*ae5de77eSEmmanuel Vadot  - clock-names
1125f62a964SEmmanuel Vadot
1135f62a964SEmmanuel VadotadditionalProperties: false
1145f62a964SEmmanuel Vadot
1155f62a964SEmmanuel Vadotexamples:
1165f62a964SEmmanuel Vadot  - |
1175f62a964SEmmanuel Vadot    #define K1_PADCONF(pin, func) (((pin) << 16) | (func))
1185f62a964SEmmanuel Vadot
1195f62a964SEmmanuel Vadot    soc {
1205f62a964SEmmanuel Vadot        #address-cells = <2>;
1215f62a964SEmmanuel Vadot        #size-cells = <2>;
1225f62a964SEmmanuel Vadot
1235f62a964SEmmanuel Vadot        pinctrl@d401e000 {
1245f62a964SEmmanuel Vadot            compatible = "spacemit,k1-pinctrl";
1255f62a964SEmmanuel Vadot            reg = <0x0 0xd401e000 0x0 0x400>;
126*ae5de77eSEmmanuel Vadot            clocks = <&syscon_apbc 42>,
127*ae5de77eSEmmanuel Vadot                     <&syscon_apbc 94>;
128*ae5de77eSEmmanuel Vadot            clock-names = "func", "bus";
1295f62a964SEmmanuel Vadot
1305f62a964SEmmanuel Vadot            uart0_2_cfg: uart0-2-cfg {
1315f62a964SEmmanuel Vadot                uart0-2-pins {
1325f62a964SEmmanuel Vadot                    pinmux = <K1_PADCONF(68, 2)>,
1335f62a964SEmmanuel Vadot                             <K1_PADCONF(69, 2)>;
1345f62a964SEmmanuel Vadot
1355f62a964SEmmanuel Vadot                    bias-pull-up = <0>;
1365f62a964SEmmanuel Vadot                    drive-strength = <32>;
1375f62a964SEmmanuel Vadot                };
1385f62a964SEmmanuel Vadot            };
1395f62a964SEmmanuel Vadot        };
1405f62a964SEmmanuel Vadot    };
1415f62a964SEmmanuel Vadot
1425f62a964SEmmanuel Vadot...
143