1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2c66ec88fSEmmanuel Vadot%YAML 1.2 3c66ec88fSEmmanuel Vadot--- 4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pinctrl/renesas,rza2-pinctrl.yaml# 5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6c66ec88fSEmmanuel Vadot 7c66ec88fSEmmanuel Vadottitle: Renesas RZ/A2 combined Pin and GPIO controller 8c66ec88fSEmmanuel Vadot 9c66ec88fSEmmanuel Vadotmaintainers: 10c66ec88fSEmmanuel Vadot - Chris Brandt <chris.brandt@renesas.com> 11c66ec88fSEmmanuel Vadot - Geert Uytterhoeven <geert+renesas@glider.be> 12c66ec88fSEmmanuel Vadot 13c66ec88fSEmmanuel Vadotdescription: 14c66ec88fSEmmanuel Vadot The Renesas SoCs of the RZ/A2 series feature a combined Pin and GPIO 15c66ec88fSEmmanuel Vadot controller. 16c66ec88fSEmmanuel Vadot Pin multiplexing and GPIO configuration is performed on a per-pin basis. 17c66ec88fSEmmanuel Vadot Each port features up to 8 pins, each of them configurable for GPIO function 18c66ec88fSEmmanuel Vadot (port mode) or in alternate function mode. 19c66ec88fSEmmanuel Vadot Up to 8 different alternate function modes exist for each single pin. 20c66ec88fSEmmanuel Vadot 21c66ec88fSEmmanuel Vadotproperties: 22c66ec88fSEmmanuel Vadot compatible: 23*8d13bc63SEmmanuel Vadot const: renesas,r7s9210-pinctrl # RZ/A2M 24c66ec88fSEmmanuel Vadot 25c66ec88fSEmmanuel Vadot reg: 26c66ec88fSEmmanuel Vadot maxItems: 1 27c66ec88fSEmmanuel Vadot 28c66ec88fSEmmanuel Vadot gpio-controller: true 29c66ec88fSEmmanuel Vadot 30c66ec88fSEmmanuel Vadot '#gpio-cells': 31c66ec88fSEmmanuel Vadot const: 2 32c66ec88fSEmmanuel Vadot description: 33c66ec88fSEmmanuel Vadot The first cell contains the global GPIO port index, constructed using the 34c66ec88fSEmmanuel Vadot RZA2_PIN() helper macro in r7s9210-pinctrl.h. 35c66ec88fSEmmanuel Vadot E.g. "RZA2_PIN(PORT6, 0)" for P6_0. 36c66ec88fSEmmanuel Vadot 37c66ec88fSEmmanuel Vadot gpio-ranges: 38c66ec88fSEmmanuel Vadot maxItems: 1 39c66ec88fSEmmanuel Vadot 40aa1a8ff2SEmmanuel VadotadditionalProperties: 41c66ec88fSEmmanuel Vadot type: object 42aa1a8ff2SEmmanuel Vadot 43c66ec88fSEmmanuel Vadot allOf: 44c66ec88fSEmmanuel Vadot - $ref: pincfg-node.yaml# 45c66ec88fSEmmanuel Vadot - $ref: pinmux-node.yaml# 46aa1a8ff2SEmmanuel Vadot 47c66ec88fSEmmanuel Vadot description: 48c66ec88fSEmmanuel Vadot The child nodes of the pin controller designate pins to be used for 49c66ec88fSEmmanuel Vadot specific peripheral functions or as GPIO. 50c66ec88fSEmmanuel Vadot 51c66ec88fSEmmanuel Vadot A pin multiplexing sub-node describes how to configure a set of 52c66ec88fSEmmanuel Vadot (or a single) pin in some desired alternate function mode. 53c66ec88fSEmmanuel Vadot The values for the pinmux properties are a combination of port name, 54c66ec88fSEmmanuel Vadot pin number and the desired function index. Use the RZA2_PINMUX macro 55c66ec88fSEmmanuel Vadot located in include/dt-bindings/pinctrl/r7s9210-pinctrl.h to easily 56c66ec88fSEmmanuel Vadot define these. 57c66ec88fSEmmanuel Vadot For assigning GPIO pins, use the macro RZA2_PIN also in 58c66ec88fSEmmanuel Vadot to express the desired port pin. 59c66ec88fSEmmanuel Vadot 60c66ec88fSEmmanuel Vadot properties: 61c66ec88fSEmmanuel Vadot pinmux: 62c66ec88fSEmmanuel Vadot description: 63c66ec88fSEmmanuel Vadot Values are constructed from GPIO port number, pin number, and 64c66ec88fSEmmanuel Vadot alternate function configuration number using the RZA2_PINMUX() 65c66ec88fSEmmanuel Vadot helper macro in r7s9210-pinctrl.h. 66c66ec88fSEmmanuel Vadot 67c66ec88fSEmmanuel Vadot required: 68c66ec88fSEmmanuel Vadot - pinmux 69c66ec88fSEmmanuel Vadot 70c66ec88fSEmmanuel Vadot additionalProperties: false 71c66ec88fSEmmanuel Vadot 72e67e8565SEmmanuel VadotallOf: 73fac71e4eSEmmanuel Vadot - $ref: pinctrl.yaml# 74e67e8565SEmmanuel Vadot 75c66ec88fSEmmanuel Vadotrequired: 76c66ec88fSEmmanuel Vadot - compatible 77c66ec88fSEmmanuel Vadot - reg 78c66ec88fSEmmanuel Vadot - gpio-controller 79c66ec88fSEmmanuel Vadot - '#gpio-cells' 80c66ec88fSEmmanuel Vadot - gpio-ranges 81c66ec88fSEmmanuel Vadot 82c66ec88fSEmmanuel Vadotexamples: 83c66ec88fSEmmanuel Vadot - | 84c66ec88fSEmmanuel Vadot #include <dt-bindings/pinctrl/r7s9210-pinctrl.h> 856be33864SEmmanuel Vadot pinctrl: pinctrl@fcffe000 { 86c66ec88fSEmmanuel Vadot compatible = "renesas,r7s9210-pinctrl"; 87c66ec88fSEmmanuel Vadot reg = <0xfcffe000 0x1000>; 88c66ec88fSEmmanuel Vadot 89c66ec88fSEmmanuel Vadot gpio-controller; 90c66ec88fSEmmanuel Vadot #gpio-cells = <2>; 91c66ec88fSEmmanuel Vadot gpio-ranges = <&pinctrl 0 0 176>; 92c66ec88fSEmmanuel Vadot 93c66ec88fSEmmanuel Vadot /* Serial Console */ 94c66ec88fSEmmanuel Vadot scif4_pins: serial4 { 95c66ec88fSEmmanuel Vadot pinmux = <RZA2_PINMUX(PORT9, 0, 4)>, /* TxD4 */ 96c66ec88fSEmmanuel Vadot <RZA2_PINMUX(PORT9, 1, 4)>; /* RxD4 */ 97c66ec88fSEmmanuel Vadot }; 98c66ec88fSEmmanuel Vadot }; 99