| 1 |
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) |
| 2 |
%YAML 1.2 |
| 3 |
--- |
| 4 |
$id: http://devicetree.org/schemas/pinctrl/renesas,r9a09g077-pinctrl.yaml# |
| 5 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 |
|
| 7 |
title: Renesas RZ/T2H and RZ/N2H Pin and GPIO controller |
| 8 |
|
| 9 |
maintainers: |
| 10 |
- Lad Prabhakar <[email protected]> |
| 11 |
|
| 12 |
description: |
| 13 |
The Renesas RZ/T2H and RZ/N2H SoCs feature a combined Pin and GPIO controller. |
| 14 |
Pin multiplexing and GPIO configuration are performed on a per-pin basis. |
| 15 |
Each port supports up to 8 pins, each configurable for either GPIO (port mode) |
| 16 |
or alternate function mode. Each pin supports function mode values ranging from |
| 17 |
0x0 to 0x2A, allowing selection from up to 43 different functions. |
| 18 |
|
| 19 |
properties: |
| 20 |
compatible: |
| 21 |
enum: |
| 22 |
- renesas,r9a09g077-pinctrl # RZ/T2H |
| 23 |
- renesas,r9a09g087-pinctrl # RZ/N2H |
| 24 |
|
| 25 |
reg: |
| 26 |
minItems: 1 |
| 27 |
items: |
| 28 |
- description: Non-safety I/O Port base |
| 29 |
- description: Safety I/O Port safety region base |
| 30 |
- description: Safety I/O Port Non-safety region base |
| 31 |
|
| 32 |
reg-names: |
| 33 |
minItems: 1 |
| 34 |
items: |
| 35 |
- const: nsr |
| 36 |
- const: srs |
| 37 |
- const: srn |
| 38 |
|
| 39 |
gpio-controller: true |
| 40 |
|
| 41 |
'#gpio-cells': |
| 42 |
const: 2 |
| 43 |
description: |
| 44 |
The first cell contains the global GPIO port index, constructed using the |
| 45 |
RZT2H_GPIO() helper macro from <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h> |
| 46 |
(e.g. "RZT2H_GPIO(3, 0)" for P03_0). The second cell represents the consumer |
| 47 |
flag. Use the macros defined in include/dt-bindings/gpio/gpio.h. |
| 48 |
|
| 49 |
gpio-ranges: |
| 50 |
maxItems: 1 |
| 51 |
|
| 52 |
interrupt-controller: true |
| 53 |
|
| 54 |
'#interrupt-cells': |
| 55 |
const: 2 |
| 56 |
description: |
| 57 |
The first cell contains the global GPIO port index, constructed using the |
| 58 |
RZT2H_GPIO() helper macro from <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h> |
| 59 |
and the second cell is used to specify the flag. |
| 60 |
E.g. "interrupts = <RZT2H_GPIO(8, 6) IRQ_TYPE_EDGE_FALLING>;" if P08_6 is |
| 61 |
being used as an interrupt. |
| 62 |
|
| 63 |
clocks: |
| 64 |
maxItems: 1 |
| 65 |
|
| 66 |
power-domains: |
| 67 |
maxItems: 1 |
| 68 |
|
| 69 |
definitions: |
| 70 |
renesas-rzt2h-n2h-pins-node: |
| 71 |
type: object |
| 72 |
allOf: |
| 73 |
- $ref: pincfg-node.yaml# |
| 74 |
- $ref: pinmux-node.yaml# |
| 75 |
properties: |
| 76 |
pinmux: |
| 77 |
description: |
| 78 |
Values are constructed from I/O port number, pin number, and |
| 79 |
alternate function configuration number using the RZT2H_PORT_PINMUX() |
| 80 |
helper macro from <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h>. |
| 81 |
pins: true |
| 82 |
phandle: true |
| 83 |
input: true |
| 84 |
input-enable: true |
| 85 |
output-enable: true |
| 86 |
oneOf: |
| 87 |
- required: [pinmux] |
| 88 |
- required: [pins] |
| 89 |
additionalProperties: false |
| 90 |
|
| 91 |
patternProperties: |
| 92 |
# Grouping nodes: allow multiple "-pins" subnodes within a "-group" |
| 93 |
'.*-group$': |
| 94 |
type: object |
| 95 |
description: |
| 96 |
Pin controller client devices can organize pin configuration entries into |
| 97 |
grouping nodes ending in "-group". These group nodes may contain multiple |
| 98 |
child nodes each ending in "-pins" to configure distinct sets of pins. |
| 99 |
additionalProperties: false |
| 100 |
patternProperties: |
| 101 |
'-pins$': |
| 102 |
$ref: '#/definitions/renesas-rzt2h-n2h-pins-node' |
| 103 |
|
| 104 |
# Standalone "-pins" nodes under client devices or groups |
| 105 |
'-pins$': |
| 106 |
$ref: '#/definitions/renesas-rzt2h-n2h-pins-node' |
| 107 |
|
| 108 |
'-hog$': |
| 109 |
type: object |
| 110 |
description: GPIO hog node |
| 111 |
properties: |
| 112 |
gpio-hog: true |
| 113 |
gpios: true |
| 114 |
input: true |
| 115 |
output-high: true |
| 116 |
output-low: true |
| 117 |
line-name: true |
| 118 |
required: |
| 119 |
- gpio-hog |
| 120 |
- gpios |
| 121 |
additionalProperties: false |
| 122 |
|
| 123 |
allOf: |
| 124 |
- $ref: pinctrl.yaml# |
| 125 |
|
| 126 |
required: |
| 127 |
- compatible |
| 128 |
- reg |
| 129 |
- reg-names |
| 130 |
- gpio-controller |
| 131 |
- '#gpio-cells' |
| 132 |
- gpio-ranges |
| 133 |
- clocks |
| 134 |
- power-domains |
| 135 |
|
| 136 |
unevaluatedProperties: false |
| 137 |
|
| 138 |
examples: |
| 139 |
- | |
| 140 |
#include <dt-bindings/clock/renesas,r9a09g077-cpg-mssr.h> |
| 141 |
#include <dt-bindings/pinctrl/renesas,r9a09g077-pinctrl.h> |
| 142 |
|
| 143 |
pinctrl@802c0000 { |
| 144 |
compatible = "renesas,r9a09g077-pinctrl"; |
| 145 |
reg = <0x802c0000 0x2000>, |
| 146 |
<0x812c0000 0x2000>, |
| 147 |
<0x802b0000 0x2000>; |
| 148 |
reg-names = "nsr", "srs", "srn"; |
| 149 |
clocks = <&cpg CPG_CORE R9A09G077_CLK_PCLKM>; |
| 150 |
gpio-controller; |
| 151 |
#gpio-cells = <2>; |
| 152 |
gpio-ranges = <&pinctrl 0 0 288>; |
| 153 |
interrupt-controller; |
| 154 |
#interrupt-cells = <2>; |
| 155 |
power-domains = <&cpg>; |
| 156 |
|
| 157 |
serial0-pins { |
| 158 |
pinmux = <RZT2H_PORT_PINMUX(38, 0, 1)>, /* Tx */ |
| 159 |
<RZT2H_PORT_PINMUX(38, 1, 1)>; /* Rx */ |
| 160 |
}; |
| 161 |
|
| 162 |
sd1-pwr-en-hog { |
| 163 |
gpio-hog; |
| 164 |
gpios = <RZT2H_GPIO(39, 2) 0>; |
| 165 |
output-high; |
| 166 |
line-name = "sd1_pwr_en"; |
| 167 |
}; |
| 168 |
|
| 169 |
i2c0-pins { |
| 170 |
pins = "RIIC0_SDA", "RIIC0_SCL"; |
| 171 |
input-enable; |
| 172 |
}; |
| 173 |
|
| 174 |
sd0-sd-group { |
| 175 |
ctrl-pins { |
| 176 |
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */ |
| 177 |
<RZT2H_PORT_PINMUX(12, 1, 0x29)>; /* SD0_CMD */ |
| 178 |
}; |
| 179 |
|
| 180 |
data-pins { |
| 181 |
pinmux = <RZT2H_PORT_PINMUX(12, 0, 0x29)>, /* SD0_CLK */ |
| 182 |
<RZT2H_PORT_PINMUX(12, 1, 0x29)>; /* SD0_CMD */ |
| 183 |
}; |
| 184 |
}; |
| 185 |
}; |