Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dt-bindings: pinctrl: qcom: add gpio-ranges, gpio-reserved-ranges

This patch adds the gpio-ranges and gpio-reserved-ranges property
definitions to the binding text files supported by the pinctrl-msm
driver framework.

gpio-ranges:
For DT-based platforms the pinctrl-msm framework currently relies
on the deprecated-for-DT gpiochip_add_pin_range() function to add
the range of GPIOs to be handled by the pin controller. Due to
interactions within gpiolib code, this causes the pinctrl-msm
driver to bail out (-517) during boot when a gpio-hog is declared.
This can be fatal and cause the system to not boot or reset
(for a detailed explanation and call-trace, refer to patch:
"pinctrl: msm: fix gpio-hog related boot issues" in this series).

gpio-reserved-ranges:
The binding has been added as a precaution since the TrustZone
firmware (aka QSEE), which is running as the hypervisor, might
have reserved certain, but undisclosed pins. Hence reading or
writing to the registers for those pins will cause an
XPU violation and this subsequently crashes the kernel.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Christian Lamparter and committed by
Linus Walleij
c1e802f6 74677701

+93
+6
Documentation/devicetree/bindings/pinctrl/qcom,apq8064-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 72 67 73 68 pinctrl-names = "default"; 74 69 pinctrl-0 = <&gsbi5_uart_default>; 70 + gpio-ranges = <&msmgpio 0 0 90>; 75 71 76 72 gsbi5_uart_default: gsbi5_uart_default { 77 73 mux {
+9
Documentation/devicetree/bindings/pinctrl/qcom,apq8084-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 162 154 163 155 gpio-controller; 164 156 #gpio-cells = <2>; 157 + gpio-ranges = <&tlmm 0 0 147>; 165 158 interrupt-controller; 166 159 #interrupt-cells = <2>; 167 160 interrupts = <0 208 0>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,ipq4019-pinctrl.txt
··· 13 13 - #gpio-cells : Should be two. 14 14 The first cell is the gpio pin number and the 15 15 second cell is used for optional parameters. 16 + - gpio-ranges: see ../gpio/gpio.txt 17 + 18 + Optional properties: 19 + 20 + - gpio-reserved-ranges: see ../gpio/gpio.txt 16 21 17 22 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 18 23 a general description of GPIO and interrupt bindings. ··· 69 64 70 65 gpio-controller; 71 66 #gpio-cells = <2>; 67 + gpio-ranges = <&tlmm 0 0 100>; 72 68 interrupt-controller; 73 69 #interrupt-cells = <2>; 74 70 interrupts = <0 208 0>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,ipq8064-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 72 67 73 68 gpio-controller; 74 69 #gpio-cells = <2>; 70 + gpio-ranges = <&pinmux 0 0 69>; 75 71 interrupt-controller; 76 72 #interrupt-cells = <2>; 77 73 interrupts = <0 32 0x4>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,ipq8074-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 156 148 interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 157 149 gpio-controller; 158 150 #gpio-cells = <2>; 151 + gpio-ranges = <&tlmm 0 0 70>; 159 152 interrupt-controller; 160 153 #interrupt-cells = <2>; 161 154
+9
Documentation/devicetree/bindings/pinctrl/qcom,mdm9615-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 135 127 136 128 gpio-controller; 137 129 #gpio-cells = <2>; 130 + gpio-ranges = <&msmgpio 0 0 88>; 138 131 interrupt-controller; 139 132 #interrupt-cells = <2>; 140 133 interrupts = <0 16 0x4>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,msm8660-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 67 62 68 63 gpio-controller; 69 64 #gpio-cells = <2>; 65 + gpio-ranges = <&msmgpio 0 0 173>; 70 66 interrupt-controller; 71 67 #interrupt-cells = <2>; 72 68 interrupts = <0 16 0x4>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8916-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 170 162 interrupts = <0 208 0>; 171 163 gpio-controller; 172 164 #gpio-cells = <2>; 165 + gpio-ranges = <&tlmm 0 0 122>; 173 166 interrupt-controller; 174 167 #interrupt-cells = <2>; 175 168
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8960-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 164 156 165 157 gpio-controller; 166 158 #gpio-cells = <2>; 159 + gpio-ranges = <&msmgpio 0 0 152>; 167 160 interrupt-controller; 168 161 #interrupt-cells = <2>; 169 162 interrupts = <0 16 0x4>;
+6
Documentation/devicetree/bindings/pinctrl/qcom,msm8974-pinctrl.txt
··· 10 10 - #gpio-cells : Should be two. 11 11 The first cell is the gpio pin number and the 12 12 second cell is used for optional parameters. 13 + - gpio-ranges: see ../gpio/gpio.txt 14 + 15 + Optional properties: 16 + 17 + - gpio-reserved-ranges: see ../gpio/gpio.txt 13 18 14 19 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 15 20 a general description of GPIO and interrupt bindings. ··· 92 87 93 88 gpio-controller; 94 89 #gpio-cells = <2>; 90 + gpio-ranges = <&msmgpio 0 0 146>; 95 91 interrupt-controller; 96 92 #interrupt-cells = <2>; 97 93 interrupts = <0 208 0>;
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8994-pinctrl.txt
··· 42 42 Definition: must be 2. Specifying the pin number and flags, as defined 43 43 in <dt-bindings/gpio/gpio.h> 44 44 45 + - gpio-ranges: 46 + Usage: required 47 + Definition: see ../gpio/gpio.txt 48 + 49 + - gpio-reserved-ranges: 50 + Usage: optional 51 + Definition: see ../gpio/gpio.txt 52 + 45 53 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 46 54 a general description of GPIO and interrupt bindings. 47 55 ··· 168 160 interrupts = <GIC_SPI 208 IRQ_TYPE_LEVEL_HIGH>; 169 161 gpio-controller; 170 162 #gpio-cells = <2>; 163 + gpio-ranges = <&msmgpio 0 0 146>; 171 164 interrupt-controller; 172 165 #interrupt-cells = <2>; 173 166
+9
Documentation/devicetree/bindings/pinctrl/qcom,msm8996-pinctrl.txt
··· 40 40 Definition: must be 2. Specifying the pin number and flags, as defined 41 41 in <dt-bindings/gpio/gpio.h> 42 42 43 + - gpio-ranges: 44 + Usage: required 45 + Definition: see ../gpio/gpio.txt 46 + 47 + - gpio-reserved-ranges: 48 + Usage: optional 49 + Definition: see ../gpio/gpio.txt 50 + 43 51 Please refer to ../gpio/gpio.txt and ../interrupt-controller/interrupts.txt for 44 52 a general description of GPIO and interrupt bindings. 45 53 ··· 188 180 reg = <0x01010000 0x300000>; 189 181 interrupts = <0 208 0>; 190 182 gpio-controller; 183 + gpio-ranges = <&tlmm 0 0 150>; 191 184 #gpio-cells = <2>; 192 185 interrupt-controller; 193 186 #interrupt-cells = <2>;