Skip to contentSkip to conversation

ARM: mstar: Board filling out pt. 1

PATCH New Daniel Palmer 2 participants 15 messages Jul 13

Subsystems (2)
lore
Share & tools
lore

Daniel Palmer

author maintainer
#0 lore raw

cover ARM: mstar: Board filling out pt. 1

I have had ~700 commits in my own tree for these boards for a long time now. Display, audio etc work but this stuff hasn't been mainlined as spliting everything out was a nightmare and I didn't have the time.

I have an intern called Claude now and we've cleaned up my tree so I can start pushing parts of it again.

The following are devicetree commits that do not depend on drivers etc that are not already in mainline so can be applied now.

Daniel Palmer (8):
ARM: dts: mstar: unitv2: Wire up LEDs
ARM: dts: mstar: unitv2: Add regulators
ARM: dts: mstar: unitv2: Add button
ARM: dts: mstar: unitv2: Link cpu to core regulator
ARM: dts: mstar: miyoo-mini: Add vibrator
ARM: dts: mstar: miyoo-mini: Add vbat switch
ARM: dts: mstar: sbc2d06: Add regulators
ARM: dts: mstar: ssd201htv2: Add SD card supply regulator

 .../mstar-infinity2m-ssd202d-miyoo-mini.dts   | 17 +++++
 .../mstar-infinity2m-ssd202d-ssd201htv2.dts   | 10 +++
 .../mstar-infinity2m-ssd202d-unitv2.dts       | 69 +++++++++++++++++++
 ...sd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts | 17 +++++
 4 files changed, 113 insertions(+)
Signature · 1 line
2.53.0
author maintainer
#1 lore raw

PATCH 1/8 ARM: dts: mstar: unitv2: Wire up LEDs

From: Daniel Palmer <[email protected]>

Add the red and white leds present on the unitv2.

---
 .../mstar-infinity2m-ssd202d-unitv2.dts       | 21 +++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +21 -0
index a81684002e45..f02de5b475af 100644
@@ -7,6 +7,9 @@
 /dts-v1/;
 #include "mstar-infinity2m-ssd202d.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
 / {
 	model = "UnitV2";
 	compatible = "m5stack,unitv2", "mstar,infinity2m";
@@ -18,6 +21,24 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio SSD20XD_GPIO_GPIO0 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "cpu";
+		};
+
+		led-1 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_INDICATOR;
+			gpios = <&gpio SSD20XD_GPIO_GPIO1 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "heartbeat";
+		};
+	};
 };
 
 &pm_uart {
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH 2/8 ARM: dts: mstar: unitv2: Add regulators

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add the fixed regulators for the core, IO and DRAM voltage rails and the GPIO controlled switch that supplies the WiFi chip.

---
 .../mstar-infinity2m-ssd202d-unitv2.dts       | 32 +++++++++++++++++++
 1 file changed, 32 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +32 -0
index f02de5b475af..5e79819a070a 100644
@@ -39,6 +39,38 @@ led-1 {
 			linux,default-trigger = "heartbeat";
 		};
 	};
+
+	reg_vcc_core: regulator-vcc-core {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_core";
+		regulator-min-microvolt = <950000>;
+		regulator-max-microvolt = <950000>;
+		regulator-boot-on;
+	};
+
+	reg_vcc_io: regulator-vcc-io {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_io";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;
+	};
+
+	reg_vcc_dram: regulator-vcc-dram {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_dram";
+		regulator-min-microvolt = <1500000>;
+		regulator-max-microvolt = <1500000>;
+		regulator-boot-on;
+	};
+
+	reg_vcc_wifi: regulator-vcc-wifi {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_wifi";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO14 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &pm_uart {
Signature · 1 line
2.53.0
#3 lore raw

Re: [PATCH 2/8] ARM: dts: mstar: unitv2: Add regulators

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Missing `enable-active-high` property in `reg_vcc_wifi` causes the gpiolib core to forcefully…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing enable-active-high property in reg_vcc_wifi causes the gpiolib core to forcefully invert its GPIO polarity to active-low. --

--- Patch [2]: [PATCH 2/8] ARM: dts: mstar: unitv2: Add regulators --- commit 45b1e50aa0d58e3444d010d9375cea0bd438d0d9
Author: Daniel Palmer <[email protected]>
ARM: dts: mstar: unitv2: Add regulators

This commit adds fixed regulators for the core, IO, and DRAM voltage rails. It also introduces a GPIO-controlled switch that supplies the WiFi chip.

Quoted 3 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +0 -0

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts led-1 { · line 72

Quoted 6 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +6 -0
+	reg_vcc_wifi: regulator-vcc-wifi {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_wifi";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO14 GPIO_ACTIVE_HIGH>;

[Severity: Medium]
Will the gpiolib core force this GPIO to active-low polarity?

Due to a legacy quirk for regulator-fixed nodes in the gpiolib core, the GPIO_ACTIVE_HIGH flag in the phandle is ignored in favor of the boolean enable-active-high property. Without the enable-active-high property present here, will the WiFi chip receive inverted power control and fail to operate?

Quoted 2 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +1 -0
+	};
 };

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
author maintainer
#4 lore raw

PATCH 3/8 ARM: dts: mstar: unitv2: Add button

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add the front panel button as a polled gpio-keys device reporting BTN_0.

---
 .../sigmastar/mstar-infinity2m-ssd202d-unitv2.dts    | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +12 -0
index 5e79819a070a..b5a282cd1a67 100644
@@ -8,6 +8,7 @@
 #include "mstar-infinity2m-ssd202d.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/leds/common.h>
 
 / {
@@ -40,6 +41,17 @@ led-1 {
 		};
 	};
 
+	gpio-keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <100>;
+
+		button {
+			label = "button";
+			gpios = <&gpio SSD20XD_GPIO_GPIO2 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+	};
+
 	reg_vcc_core: regulator-vcc-core {
 		compatible = "regulator-fixed";
 		regulator-name = "vcc_core";
Signature · 1 line
2.53.0
author maintainer
#5 lore raw

PATCH 4/8 ARM: dts: mstar: unitv2: Link cpu to core regulator

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Reference the core voltage regulator as the CPU supply so the regulator is described as feeding the CPU.

---
 .../boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts    | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +4 -0
index b5a282cd1a67..6c1ae3e10875 100644
@@ -85,6 +85,10 @@ reg_vcc_wifi: regulator-vcc-wifi {
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_vcc_core>;
+};
+
 &pm_uart {
 	status = "okay";
 };
Signature · 1 line
2.53.0
#6 lore raw

Re: [PATCH 4/8] ARM: dts: mstar: unitv2: Link cpu to core regulator

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Incomplete hardware description: `cpu-supply` is omitted for `cpu1` on a dual-core SoC. --

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Incomplete hardware description: cpu-supply is omitted for cpu1 on a dual-core SoC. --

--- Patch [4]: [PATCH 4/8] ARM: dts: mstar: unitv2: Link cpu to core regulator --- commit 15b5fb30c26091d181dfb33beb3faccbf6865c52
Author: Daniel Palmer <[email protected]>

ARM: dts: mstar: unitv2: Link cpu to core regulator

This commit adds a reference to the core voltage regulator as the CPU supply, ensuring the regulator is correctly described as feeding the CPU.

Quoted 3 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +0 -0

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts reg_vcc_wifi: regulator-vcc-wifi { · line 91

Quoted 8 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +4 -0
@@ -85,6 +85,10 @@ reg_vcc_wifi: regulator-vcc-wifi {
 	};
 };
 
+&cpu0 {
+	cpu-supply = <&reg_vcc_core>;
+};
+

[Severity: Low]
Since the SSD202D is a dual-core SoC and both Cortex-A7 cores share the same physical voltage domain fed by reg_vcc_core, should there also be a matching cpu-supply property added for &cpu1?

While the cpufreq-dt driver might infer the shared supply via the opp-shared property when processing cpu0, would adding it for cpu1 provide a more complete OS-agnostic hardware description for the device tree?

Quoted 3 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-unitv2.dts +0 -0
 &pm_uart {
 	status = "okay";
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4
author maintainer
#7 lore raw

PATCH 5/8 ARM: dts: mstar: miyoo-mini: Add vibrator

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add the vibration motor, which is driven by a GPIO, on the Miyoo Mini.

---
 .../dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts   | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +6 -0
index 1bbbf47132dc..5e927f41fa73 100644
@@ -18,6 +18,12 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	vibrator {
+		compatible = "gpio-vibrator";
+		enable-gpios = <&gpio SSD20XD_GPIO_UART0_TX GPIO_ACTIVE_LOW>;
+	};
+
 };
 
 &pm_uart {
Signature · 1 line
2.53.0
#8 lore raw

Re: [PATCH 5/8] ARM: dts: mstar: miyoo-mini: Add vibrator

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Missing `#include <dt-bindings/gpio/gpio.h>` causes device tree compilation failure due to an…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Missing #include <dt-bindings/gpio/gpio.h> causes device tree compilation failure due to an undefined GPIO_ACTIVE_LOW macro. --

--- Patch [5]: [PATCH 5/8] ARM: dts: mstar: miyoo-mini: Add vibrator --- commit c4d7e499cb7660d52f8d45adc7aae0663b10a9a9
Author: Daniel Palmer <[email protected]>

ARM: dts: mstar: miyoo-mini: Add vibrator

This commit adds a vibration motor node to the Miyoo Mini device tree, configuring it to be driven by a GPIO pin.

Quoted 3 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +0 -0

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts aliases { · line 24

Quoted 8 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +4 -0
@@ -18,6 +18,12 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	vibrator {
+		compatible = "gpio-vibrator";
+		enable-gpios = <&gpio SSD20XD_GPIO_UART0_TX GPIO_ACTIVE_LOW>;

[Severity: Low]
Does this file compile successfully without the gpio bindings header?

It looks like GPIO_ACTIVE_LOW is used in the new vibrator node, but the file doesn't appear to include <dt-bindings/gpio/gpio.h>.

Will this result in a compilation failure from the device tree compiler due to the undefined macro?

Quoted 5 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +2 -0
+	};
+
 };
 
 &pm_uart {
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=5
author maintainer
#9 lore raw

PATCH 6/8 ARM: dts: mstar: miyoo-mini: Add vbat switch

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add a GPIO controlled fixed regulator for the battery voltage rail on the Miyoo Mini.

---
 .../sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +11 -0
index 5e927f41fa73..fde4703eb52b 100644
@@ -7,6 +7,8 @@
 /dts-v1/;
 #include "mstar-infinity2m-ssd202d.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "Miyoo Mini";
 	compatible = "miyoo,miyoo-mini", "mstar,infinity2m";
@@ -24,6 +26,15 @@ vibrator {
 		enable-gpios = <&gpio SSD20XD_GPIO_UART0_TX GPIO_ACTIVE_LOW>;
 	};
 
+	reg_vbat: regulator-vbat {
+		compatible = "regulator-fixed";
+		regulator-name = "vbat";
+		regulator-min-microvolt = <4200000>;
+		regulator-max-microvolt = <4200000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO85 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
 };
 
 &pm_uart {
Signature · 1 line
2.53.0
#10 lore raw

Re: [PATCH 6/8] ARM: dts: mstar: miyoo-mini: Add vbat switch

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] Missing `regulator-boot-on` will cause a power glitch if the rail is already on, or…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing regulator-boot-on will cause a power glitch if the rail is already on, or regulator-always-on will drain battery if it's an ADC switch. --

--- Patch [6]: [PATCH 6/8] ARM: dts: mstar: miyoo-mini: Add vbat switch --- commit a658b11235430fff38550ae571d1b7afe1a12775
Author: Daniel Palmer <[email protected]>

ARM: dts: mstar: miyoo-mini: Add vbat switch

This commit adds a GPIO-controlled fixed regulator for the battery voltage rail on the Miyoo Mini device.

Quoted 4 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +0 -0
index 5e927f41fa733..fde4703eb52bc 100644

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts vibrator { · line 36

Quoted 12 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +8 -0
@@ -24,6 +26,15 @@ vibrator {
 		enable-gpios = <&gpio SSD20XD_GPIO_UART0_TX GPIO_ACTIVE_LOW>;
 	};
 
+	reg_vbat: regulator-vbat {
+		compatible = "regulator-fixed";
+		regulator-name = "vbat";
+		regulator-min-microvolt = <4200000>;
+		regulator-max-microvolt = <4200000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO85 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;

[Severity: Medium]
Will this configuration cause a power glitch during probe or an unintended battery drain?

Because regulator-boot-on is omitted, the fixed regulator driver initializes the GPIO request as GPIOD_OUT_LOW, instantly dropping the line to 0V. The regulator core will later process regulator-always-on and re-enable it, but this gap can cause a power glitch if this rail is a system power hold latch already enabled by the bootloader.

Alternatively, if this GPIO controls a voltage divider switch for an ADC reading, leaving it regulator-always-on will cause a continuous battery drain.

Should regulator-boot-on be added, or regulator-always-on be removed depending on the exact hardware function?

Quoted 2 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-miyoo-mini.dts +1 -0
+	};
 };
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=6
author maintainer
#11 lore raw

PATCH 7/8 ARM: dts: mstar: sbc2d06: Add regulators

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add the board's fixed regulators.

---
 ...-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts +17 -0
index b15c40762bc0..8dbff5e53e5f 100644
@@ -20,4 +20,21 @@ sys_led {
 			linux,default-trigger = "heartbeat";
 		};
 	};
+
+	vcc_vbus: regulator-vcc-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO14 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+
+	vcc_sd: regulator-vcc-sd {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO90 GPIO_ACTIVE_HIGH>;
+	};
 };
Signature · 1 line
2.53.0
#12 lore raw

Re: [PATCH 7/8] ARM: dts: mstar: sbc2d06: Add regulators

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] The `vcc_sd` and `reg_vcc_wifi` fixed regulators specify `GPIO_ACTIVE_HIGH` but omit the…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The vcc_sd and reg_vcc_wifi fixed regulators specify GPIO_ACTIVE_HIGH but omit the enable-active-high property, causing their GPIO polarity to be incorrectly forced to active-low. --

--- Patch [7]: [PATCH 7/8] ARM: dts: mstar: sbc2d06: Add regulators --- commit 9f0e98cb27cc735c61124ee041d094826dabd5cf
Author: Daniel Palmer <[email protected]>

ARM: dts: mstar: sbc2d06: Add regulators

This commit adds the board's fixed regulators.

Quoted 4 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts +0 -0
index b15c40762bc0a..8dbff5e53e5f2 100644

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts sys_led { · line 39

Quoted 7 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-wirelesstag-ido-sbc2d06-v1b-22w.dts +7 -0
+	vcc_sd: regulator-vcc-sd {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO90 GPIO_ACTIVE_HIGH>;
+	};

[Severity: High]
Does this missing enable-active-high property cause the SD card power supply to fail to turn on?

The vcc_sd fixed regulator specifies GPIO_ACTIVE_HIGH but omits the enable-active-high property. When the regulator framework attempts to enable it, gpiolib intercepts the GPIO request via of_gpio_flags_quirks(). Because the property is missing, the quirk forcefully applies the OF_GPIO_ACTIVE_LOW flag, overriding the GPIO_ACTIVE_HIGH phandle argument, and logs "enforce active low on GPIO handle".

The regulator framework would then incorrectly drive the GPIO low to enable it. This could prevent the SD card from powering on, potentially breaking boot if the root filesystem is located on it.

A similar issue appears to be present in reg_vcc_wifi (regulator-vcc-wifi) from an earlier patch in this series, which also omits the enable-active-high property.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=7
author maintainer
#13 lore raw

PATCH 8/8 ARM: dts: mstar: ssd201htv2: Add SD card supply regulator

In reply to Daniel Palmer

From: Daniel Palmer <[email protected]>

Add the fixed regulator that supplies the SD card slot on the ssd201htv2.

---
 .../sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts  | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts +10 -0
index 5d81641414a2..9f0ce16a0874 100644
@@ -7,6 +7,8 @@
 /dts-v1/;
 #include "mstar-infinity2m-ssd202d.dtsi"
 
+#include <dt-bindings/gpio/gpio.h>
+
 / {
 	model = "SSD201_HT_V2";
 	compatible = "honestar,ssd201htv2", "mstar,infinity2m";
@@ -18,6 +20,14 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_sd_vdd: regulator-sd-vdd {
+		compatible = "regulator-fixed";
+		regulator-name = "sd_vdd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO0 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &pm_uart {
Signature · 1 line
2.53.0
#14 lore raw

Re: [PATCH 8/8] ARM: dts: mstar: ssd201htv2: Add SD card supply regulator

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The fixed regulator node `reg_sd_vdd` is missing the `enable-active-high;` property, causing the…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The fixed regulator node reg_sd_vdd is missing the enable-active-high; property, causing the GPIO subsystem to silently override the polarity to active-low despite the GPIO_ACTIVE_HIGH flag. --

--- Patch [8]: [PATCH 8/8] ARM: dts: mstar: ssd201htv2: Add SD card supply regulator --- commit 54af4e7814b68ef5327152ebd2b9e1372991e4d5
Author: Daniel Palmer <[email protected]>

ARM: dts: mstar: ssd201htv2: Add SD card supply regulator

Add the fixed regulator that supplies the SD card slot on the ssd201htv2.

Quoted 4 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts +0 -0
index 5d81641414a21..9f0ce16a08748 100644

[ ... ]

arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts aliases { · line 29

Quoted 11 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts +7 -0
@@ -18,6 +20,14 @@ aliases {
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
+
+	reg_sd_vdd: regulator-sd-vdd {
+		compatible = "regulator-fixed";
+		regulator-name = "sd_vdd";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio SSD20XD_GPIO_GPIO0 GPIO_ACTIVE_HIGH>;

[Severity: Medium]
Is the enable-active-high; property missing here?

For regulator-fixed nodes, the GPIO subsystem applies a legacy quirk in drivers/gpio/gpiolib-of.c:of_gpio_set_polarity_by_property() where the absence of enable-active-high forces an active-low override. This ignores the GPIO_ACTIVE_HIGH flag.

Will this cause the regulator framework to drive the GPIO low instead of high, failing to power the SD card on this board?

Quoted 4 lines
arch/arm/boot/dts/sigmastar/mstar-infinity2m-ssd202d-ssd201htv2.dts +1 -0
+	};
 };
 
 &pm_uart {
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=8