]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
riscv: dts: thead: Add TH1520 GPIO ranges
authorEmil Renner Berthing <emil.renner.berthing@canonical.com>
Mon, 14 Oct 2024 17:54:19 +0000 (10:54 -0700)
committerDrew Fustini <dfustini@tenstorrent.com>
Tue, 15 Oct 2024 17:01:17 +0000 (10:01 -0700)
Add gpio-ranges properties to the TH1520 device tree, so user space can
change basic pinconf settings for GPIOs and are not allowed to use pads
already used by other functions.

Adjust number of GPIOs available for the different controllers.

Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Thomas Bonnefille <thomas.bonnefille@bootlin.com>
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Signed-off-by: Drew Fustini <dfustini@tenstorrent.com>
arch/riscv/boot/dts/thead/th1520.dtsi

index 93c17f52fbe9fa5e1828e113dec1698189f18730..9c6cbb4fc3d7e7e00ec3cd031cb1cb6cc1f5c600 100644 (file)
                                gpio-controller;
                                #gpio-cells = <2>;
                                ngpios = <32>;
+                               gpio-ranges = <&padctrl0_apsys 0 0 32>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                compatible = "snps,dw-apb-gpio-port";
                                gpio-controller;
                                #gpio-cells = <2>;
-                               ngpios = <32>;
+                               ngpios = <23>;
+                               gpio-ranges = <&padctrl0_apsys 0 32 23>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                gpio-controller;
                                #gpio-cells = <2>;
                                ngpios = <32>;
+                               gpio-ranges = <&padctrl1_apsys 0 0 32>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                compatible = "snps,dw-apb-gpio-port";
                                gpio-controller;
                                #gpio-cells = <2>;
-                               ngpios = <32>;
+                               ngpios = <31>;
+                               gpio-ranges = <&padctrl1_apsys 0 32 31>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                compatible = "snps,dw-apb-gpio-port";
                                gpio-controller;
                                #gpio-cells = <2>;
-                               ngpios = <32>;
+                               ngpios = <16>;
+                               gpio-ranges = <&padctrl_aosys 0 9 16>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;
                                compatible = "snps,dw-apb-gpio-port";
                                gpio-controller;
                                #gpio-cells = <2>;
-                               ngpios = <32>;
+                               ngpios = <23>;
+                               gpio-ranges = <&padctrl_aosys 0 25 22>, <&padctrl_aosys 22 7 1>;
                                reg = <0>;
                                interrupt-controller;
                                #interrupt-cells = <2>;