diff mbox series

[v2,03/18] arm64: dts: mediatek: mt7988: add fixed regulators for 1v8 and 3v3

Message ID 20241202122602.30734-4-linux@fw-web.de (mailing list archive)
State New
Headers show
Series continue mt7988 devicetree work | expand

Commit Message

Frank Wunderlich Dec. 2, 2024, 12:25 p.m. UTC
From: Frank Wunderlich <frank-w@public-files.de>

Add regulator nodes used for mmc to Bananapi R4 board.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
v2:
- move mmc regulators to board dts of bpi-r4
---
 .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

AngeloGioacchino Del Regno Dec. 3, 2024, 9:40 a.m. UTC | #1
Il 02/12/24 13:25, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> Add regulator nodes used for mmc to Bananapi R4 board.
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>

If you're adding the eMMC regulators, I assume that there's an eMMC, or that even
if there's no device in some version of the board, these two regulators are always
assigned to the eMMC device - right?

You should, at this point, do exactly that: you can leave the mmc0 disabled and
only enable it in a DTBO.

&mmc0 {
	/* eMMC gets enabled by DTBO if present */
	vmmc-supply = <&reg_3p3v>;
	vqmmc-supply = <&reg_1p8v>;
};

Cheers,
Angelo

> ---
> v2:
> - move mmc regulators to board dts of bpi-r4
> ---
>   .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
>   1 file changed, 18 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
> index d914eae2b524..df53512c6890 100644
> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
> @@ -8,6 +8,24 @@ / {
>   	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
>   	model = "Banana Pi BPI-R4";
>   	chassis-type = "embedded";
> +
> +	reg_1p8v: regulator-1p8v {
> +		compatible = "regulator-fixed";
> +		regulator-name = "fixed-1.8V";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		regulator-boot-on;
> +		regulator-always-on;
> +	};
> +
> +	reg_3p3v: regulator-3p3v {
> +		compatible = "regulator-fixed";
> +		regulator-name = "fixed-3.3V";
> +		regulator-min-microvolt = <3300000>;
> +		regulator-max-microvolt = <3300000>;
> +		regulator-boot-on;
> +		regulator-always-on;
> +	};
>   };
>   
>   &pio {
Frank Wunderlich Dec. 3, 2024, 10:51 a.m. UTC | #2
Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
>Il 02/12/24 13:25, Frank Wunderlich ha scritto:
>> From: Frank Wunderlich <frank-w@public-files.de>
>> 
>> Add regulator nodes used for mmc to Bananapi R4 board.
>> 
>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>
>If you're adding the eMMC regulators, I assume that there's an eMMC, or that even
>if there's no device in some version of the board, these two regulators are always
>assigned to the eMMC device - right?

Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I can move the regulators to the dtbo,but then they are defined twice (at least 3v3).

>You should, at this point, do exactly that: you can leave the mmc0 disabled and
>only enable it in a DTBO.

I enable it only in dtbo...

>&mmc0 {
>	/* eMMC gets enabled by DTBO if present */
>	vmmc-supply = <&reg_3p3v>;
>	vqmmc-supply = <&reg_1p8v>;
>};

Problem is here that sdcard uses only the 3v3 twice

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso

And emmc needs both

https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso

Only defining the vmmc-supply in dts and set only the other in dtso is possible but but imho not nice.

>Cheers,
>Angelo
>
>> ---
>> v2:
>> - move mmc regulators to board dts of bpi-r4
>> ---
>>   .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
>>   1 file changed, 18 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>> index d914eae2b524..df53512c6890 100644
>> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>> @@ -8,6 +8,24 @@ / {
>>   	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
>>   	model = "Banana Pi BPI-R4";
>>   	chassis-type = "embedded";
>> +
>> +	reg_1p8v: regulator-1p8v {
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "fixed-1.8V";
>> +		regulator-min-microvolt = <1800000>;
>> +		regulator-max-microvolt = <1800000>;
>> +		regulator-boot-on;
>> +		regulator-always-on;
>> +	};
>> +
>> +	reg_3p3v: regulator-3p3v {
>> +		compatible = "regulator-fixed";
>> +		regulator-name = "fixed-3.3V";
>> +		regulator-min-microvolt = <3300000>;
>> +		regulator-max-microvolt = <3300000>;
>> +		regulator-boot-on;
>> +		regulator-always-on;
>> +	};
>>   };
>>     &pio {
>
>


regards Frank
AngeloGioacchino Del Regno Dec. 3, 2024, 2:20 p.m. UTC | #3
Il 03/12/24 11:51, Frank Wunderlich ha scritto:
> Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>:
>> Il 02/12/24 13:25, Frank Wunderlich ha scritto:
>>> From: Frank Wunderlich <frank-w@public-files.de>
>>>
>>> Add regulator nodes used for mmc to Bananapi R4 board.
>>>
>>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>>
>> If you're adding the eMMC regulators, I assume that there's an eMMC, or that even
>> if there's no device in some version of the board, these two regulators are always
>> assigned to the eMMC device - right?
> 
> Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I can move the regulators to the dtbo,but then they are defined twice (at least 3v3).
> 
>> You should, at this point, do exactly that: you can leave the mmc0 disabled and
>> only enable it in a DTBO.
> 
> I enable it only in dtbo...
> 
>> &mmc0 {
>> 	/* eMMC gets enabled by DTBO if present */
>> 	vmmc-supply = <&reg_3p3v>;
>> 	vqmmc-supply = <&reg_1p8v>;
>> };
> 
> Problem is here that sdcard uses only the 3v3 twice
> 
> https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso
> 
> And emmc needs both
> 
> https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso
> 
> Only defining the vmmc-supply in dts and set only the other in dtso is possible but but imho not nice.
> 

If you added that in the commit description in the first place, I wouldn't
have sent you that suggestion ;-)

So, please add the reason that you just explained to me in the description
of this commit and just leave the code as-is.

Cheers!

>> Cheers,
>> Angelo
>>
>>> ---
>>> v2:
>>> - move mmc regulators to board dts of bpi-r4
>>> ---
>>>    .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 ++++++++++++++++++
>>>    1 file changed, 18 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>> index d914eae2b524..df53512c6890 100644
>>> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>> @@ -8,6 +8,24 @@ / {
>>>    	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
>>>    	model = "Banana Pi BPI-R4";
>>>    	chassis-type = "embedded";
>>> +
>>> +	reg_1p8v: regulator-1p8v {
>>> +		compatible = "regulator-fixed";
>>> +		regulator-name = "fixed-1.8V";
>>> +		regulator-min-microvolt = <1800000>;
>>> +		regulator-max-microvolt = <1800000>;
>>> +		regulator-boot-on;
>>> +		regulator-always-on;
>>> +	};
>>> +
>>> +	reg_3p3v: regulator-3p3v {
>>> +		compatible = "regulator-fixed";
>>> +		regulator-name = "fixed-3.3V";
>>> +		regulator-min-microvolt = <3300000>;
>>> +		regulator-max-microvolt = <3300000>;
>>> +		regulator-boot-on;
>>> +		regulator-always-on;
>>> +	};
>>>    };
>>>      &pio {
>>
>>
> 
> 
> regards Frank
Frank Wunderlich Dec. 3, 2024, 3:08 p.m. UTC | #4
Am 2024-12-03 15:20, schrieb AngeloGioacchino Del Regno:
> Il 03/12/24 11:51, Frank Wunderlich ha scritto:
>> Am 3. Dezember 2024 10:40:54 MEZ schrieb AngeloGioacchino Del Regno 
>> <angelogioacchino.delregno@collabora.com>:
>>> Il 02/12/24 13:25, Frank Wunderlich ha scritto:
>>>> From: Frank Wunderlich <frank-w@public-files.de>
>>>> 
>>>> Add regulator nodes used for mmc to Bananapi R4 board.
>>>> 
>>>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>>> 
>>> If you're adding the eMMC regulators, I assume that there's an eMMC, 
>>> or that even
>>> if there's no device in some version of the board, these two 
>>> regulators are always
>>> assigned to the eMMC device - right?
>> 
>> Like BPi-R3 there is one mmc controller mapped to either sd or emmc. I 
>> can move the regulators to the dtbo,but then they are defined twice 
>> (at least 3v3).
>> 
>>> You should, at this point, do exactly that: you can leave the mmc0 
>>> disabled and
>>> only enable it in a DTBO.
>> 
>> I enable it only in dtbo...
>> 
>>> &mmc0 {
>>> 	/* eMMC gets enabled by DTBO if present */
>>> 	vmmc-supply = <&reg_3p3v>;
>>> 	vqmmc-supply = <&reg_1p8v>;
>>> };
>> 
>> Problem is here that sdcard uses only the 3v3 twice
>> 
>> https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-sd.dtso
>> 
>> And emmc needs both
>> 
>> https://github.com/frank-w/BPI-Router-Linux/blob/6.12-main/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-emmc.dtso
>> 
>> Only defining the vmmc-supply in dts and set only the other in dtso is 
>> possible but but imho not nice.
>> 
> 
> If you added that in the commit description in the first place, I 
> wouldn't
> have sent you that suggestion ;-)
> 
> So, please add the reason that you just explained to me in the 
> description
> of this commit and just leave the code as-is.

OK, would this be ok?

arm64: dts: mediatek: mt7988a-bpi-r4: add fixed regulators for 1v8 and 
3v3

Add regulator nodes used for mmc to Bananapi R4 board.
This board has 1 MMC controller used for SDMMC and eMMC where only one 
can
be used at one time, selected by hardware switches. SD use 3v3 for both
supplies and emmc uses both regulators.
So defining both regulators in board dts and referencing them in the dt
overlay.

> Cheers!
> 
>>> Cheers,
>>> Angelo
>>> 
>>>> ---
>>>> v2:
>>>> - move mmc regulators to board dts of bpi-r4
>>>> ---
>>>>    .../dts/mediatek/mt7988a-bananapi-bpi-r4.dts   | 18 
>>>> ++++++++++++++++++
>>>>    1 file changed, 18 insertions(+)
>>>> 
>>>> diff --git 
>>>> a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts 
>>>> b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>>> index d914eae2b524..df53512c6890 100644
>>>> --- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>>> +++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
>>>> @@ -8,6 +8,24 @@ / {
>>>>    	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
>>>>    	model = "Banana Pi BPI-R4";
>>>>    	chassis-type = "embedded";
>>>> +
>>>> +	reg_1p8v: regulator-1p8v {
>>>> +		compatible = "regulator-fixed";
>>>> +		regulator-name = "fixed-1.8V";
>>>> +		regulator-min-microvolt = <1800000>;
>>>> +		regulator-max-microvolt = <1800000>;
>>>> +		regulator-boot-on;
>>>> +		regulator-always-on;
>>>> +	};
>>>> +
>>>> +	reg_3p3v: regulator-3p3v {
>>>> +		compatible = "regulator-fixed";
>>>> +		regulator-name = "fixed-3.3V";
>>>> +		regulator-min-microvolt = <3300000>;
>>>> +		regulator-max-microvolt = <3300000>;
>>>> +		regulator-boot-on;
>>>> +		regulator-always-on;
>>>> +	};
>>>>    };
>>>>      &pio {
>>> 
>>> 
>> 
>> 
>> regards Frank
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
index d914eae2b524..df53512c6890 100644
--- a/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
@@ -8,6 +8,24 @@  / {
 	compatible = "bananapi,bpi-r4", "mediatek,mt7988a";
 	model = "Banana Pi BPI-R4";
 	chassis-type = "embedded";
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
 };
 
 &pio {