From afdf88b9a165710e6132fab6ec245a61f4394d6e Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Tue, 20 May 2025 07:50:56 +0800 Subject: [PATCH] ramips: dts: adjust the power regulators of MMC controller - Fix MMC bus IO voltage. The GPIO voltage of mt762x series SoCs is fixed 3.3V. There are no visible registers that can control the voltage level. Also add "no-1-8-v" property to indicate that MMC controller doesn't support 1.8V IO. - Drop useless property "enable-active-high". These dummy fixed voltage regulators are not controlled by the GPIO. We don't need to set the GPIO polarity. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/18886 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/dts/mt7620a.dtsi | 30 +++++++------------ .../ramips/dts/mt7620a_hiwifi_hc5861.dts | 10 +++---- target/linux/ramips/dts/mt7621.dtsi | 30 +++++++------------ target/linux/ramips/dts/mt7628an.dtsi | 30 +++++++------------ 4 files changed, 37 insertions(+), 63 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index 0555674802c..7542d43bae0 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -32,26 +32,20 @@ compatible = "mti,cpu-interrupt-controller"; }; - mmc_reg_1v8: regulator-1v8 { + reg_vmmc: regulator-vmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <1800000>; - regulator-name = "mmc_io"; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "mmc_power"; }; - mmc_reg_3v3: regulator-3v3 { + reg_vqmmc: regulator-vqmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; regulator-max-microvolt = <3300000>; regulator-min-microvolt = <3300000>; - regulator-name = "mmc_power"; + regulator-name = "mmc_io"; }; palmbus: palmbus@10000000 { @@ -528,20 +522,18 @@ reg = <0x10130000 0x4000>; bus-width = <4>; - + max-frequency = <24000000>; cap-mmc-highspeed; cap-sd-highspeed; + disable-wp; + no-1-8-v; clocks = <&sysc 15>, <&sysc 15>; clock-names = "source", "hclk"; - disable-wp; - interrupt-parent = <&intc>; interrupts = <14>; - max-frequency = <24000000>; - pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdhci_pins>; pinctrl-1 = <&sdhci_pins>; @@ -549,8 +541,8 @@ resets = <&sysc 30>; reset-names = "hrst"; - vmmc-supply = <&mmc_reg_3v3>; - vqmmc-supply = <&mmc_reg_1v8>; + vmmc-supply = <®_vmmc>; + vqmmc-supply = <®_vqmmc>; status = "disabled"; }; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index dacd5f27de2..fcd40402921 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -87,12 +87,6 @@ mediatek,ephy-base = /bits/ 8 <12>; }; -&mmc_reg_3v3 { - /delete-property/ enable-active-high; - - gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; -}; - &pcie { status = "okay"; }; @@ -107,6 +101,10 @@ }; }; +®_vmmc { + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; +}; + &wmac { pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 711f84689fa..0031f74c752 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -42,26 +42,20 @@ bootargs = "console=ttyS0,57600"; }; - mmc_reg_1v8: regulator-1v8 { + reg_vmmc: regulator-vmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <1800000>; - regulator-name = "mmc_io"; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "mmc_power"; }; - mmc_reg_3v3: regulator-3v3 { + reg_vqmmc: regulator-vqmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; regulator-max-microvolt = <3300000>; regulator-min-microvolt = <3300000>; - regulator-name = "mmc_power"; + regulator-name = "mmc_io"; }; reg_vbus: regulator-vbus { @@ -369,20 +363,18 @@ reg = <0x1e130000 0x4000>; bus-width = <4>; - + max-frequency = <48000000>; cap-mmc-highspeed; cap-sd-highspeed; + disable-wp; + no-1-8-v; clocks = <&sysc MT7621_CLK_SHXC>, <&sysc MT7621_CLK_SHXC>; clock-names = "source", "hclk"; - disable-wp; - interrupt-parent = <&gic>; interrupts = ; - max-frequency = <48000000>; - pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdhci_pins>; pinctrl-1 = <&sdhci_pins>; @@ -390,8 +382,8 @@ resets = <&sysc MT7621_RST_SDXC>; reset-names = "hrst"; - vmmc-supply = <&mmc_reg_3v3>; - vqmmc-supply = <&mmc_reg_1v8>; + vmmc-supply = <®_vmmc>; + vqmmc-supply = <®_vqmmc>; status = "disabled"; }; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index 79763332b8b..e705d46b1e5 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -30,26 +30,20 @@ compatible = "mti,cpu-interrupt-controller"; }; - mmc_reg_1v8: regulator-1v8 { + reg_vmmc: regulator-vmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; - regulator-max-microvolt = <1800000>; - regulator-min-microvolt = <1800000>; - regulator-name = "mmc_io"; + regulator-max-microvolt = <3300000>; + regulator-min-microvolt = <3300000>; + regulator-name = "mmc_power"; }; - mmc_reg_3v3: regulator-3v3 { + reg_vqmmc: regulator-vqmmc { compatible = "regulator-fixed"; - - enable-active-high; - regulator-always-on; regulator-max-microvolt = <3300000>; regulator-min-microvolt = <3300000>; - regulator-name = "mmc_power"; + regulator-name = "mmc_io"; }; palmbus: palmbus@10000000 { @@ -382,20 +376,18 @@ reg = <0x10130000 0x4000>; bus-width = <4>; - + max-frequency = <24000000>; cap-mmc-highspeed; cap-sd-highspeed; + disable-wp; + no-1-8-v; clocks = <&sysc 16>, <&sysc 16>; clock-names = "source", "hclk"; - disable-wp; - interrupt-parent = <&intc>; interrupts = <14>; - max-frequency = <24000000>; - pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdxc_pins>; pinctrl-1 = <&sdxc_pins>; @@ -403,8 +395,8 @@ resets = <&sysc 30>; reset-names = "hrst"; - vmmc-supply = <&mmc_reg_3v3>; - vqmmc-supply = <&mmc_reg_1v8>; + vmmc-supply = <®_vmmc>; + vqmmc-supply = <®_vqmmc>; status = "disabled"; }; -- 2.47.2