arm64: dts: rockchip: fix nEXTRST on SOQuartz
authorNicolas Frattaroli <frattaroli.nicolas@gmail.com>
Fri, 21 Apr 2023 15:26:10 +0000 (17:26 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 7 May 2023 21:46:47 +0000 (23:46 +0200)
In pre-production prototypes (of which I only know one person
having one, Peter Geis), GPIO0 pin A5 was tied to the SDMMC
power enable pin on the CM4 connector. On all production models,
this is not the case; instead, this pin is used for the nEXTRST
signal, and the SDMMC power enable pin is always pulled high.

Since everyone currently using the SOQuartz device trees will
want this change, it is made to the tree without splitting the
trees into two separate ones of which users will then inevitably
choose the wrong one.

This fixes USB and PCIe on a wide variety of CM4IO-compatible
boards which use the nEXTRST signal.

Fixes: 5859b5a9c3ac ("arm64: dts: rockchip: add SoQuartz CM4IO dts")
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
Link: https://lore.kernel.org/r/20230421152610.21688-1-frattaroli.nicolas@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3566-soquartz-cm4.dts
arch/arm64/boot/dts/rockchip/rk3566-soquartz.dtsi

index 263ce40770ddeda22b02c2f2e2f807947c8c0ee4..cddf6cd2fecb1bf34458a98adc93b59560f98fde 100644 (file)
                regulator-max-microvolt = <5000000>;
                vin-supply = <&vcc12v_dcin>;
        };
+
+       vcc_sd_pwr: vcc-sd-pwr-regulator {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc_sd_pwr";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc3v3_sys>;
+       };
 };
 
 /* phy for pcie */
 };
 
 &sdmmc0 {
-       vmmc-supply = <&sdmmc_pwr>;
-       status = "okay";
-};
-
-&sdmmc_pwr {
-       regulator-min-microvolt = <3300000>;
-       regulator-max-microvolt = <3300000>;
+       vmmc-supply = <&vcc_sd_pwr>;
        status = "okay";
 };
 
index 102e448bc026a78a3783dd9530c4f12a0aad0e09..31aa2b8efe39314087190027c495cb2b4a26c163 100644 (file)
                regulator-max-microvolt = <3300000>;
                vin-supply = <&vcc5v0_sys>;
        };
-
-       sdmmc_pwr: sdmmc-pwr-regulator {
-               compatible = "regulator-fixed";
-               enable-active-high;
-               gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
-               pinctrl-names = "default";
-               pinctrl-0 = <&sdmmc_pwr_h>;
-               regulator-name = "sdmmc_pwr";
-               status = "disabled";
-       };
 };
 
 &cpu0 {
        status = "disabled";
 };
 
+&gpio0 {
+       nextrst-hog {
+               gpio-hog;
+               /*
+                * GPIO_ACTIVE_LOW + output-low here means that the pin is set
+                * to high, because output-low decides the value pre-inversion.
+                */
+               gpios = <RK_PA5 GPIO_ACTIVE_LOW>;
+               line-name = "nEXTRST";
+               output-low;
+       };
+};
+
 &gpu {
        mali-supply = <&vdd_gpu>;
        status = "okay";
                        rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
                };
        };
-
-       sdmmc-pwr {
-               sdmmc_pwr_h: sdmmc-pwr-h {
-                       rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
-               };
-       };
 };
 
 &pmu_io_domains {