Skip to contentSkip to conversation

Enable USB and SD for Deepcomputing FML13V05 board

PATCH Superseded Sandie Cao 4 participants 9 messages Nov 2 – Nov 5

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sandie Cao

author
#0 lore raw

v3 cover Enable USB and SD for Deepcomputing FML13V05 board

This series updates Deepcomputing FML13V05 Device Tree: Add P1 PMIC regulator tree, add USB controller and USB phy, Enable SD card.

This series is rebased on next-20261030.

---
Changes in v3:
- Remove useless gpio header.
- Add Onboard SD Card comment.
- Link to v2: https://lore.kernel.org/all/20261020081633.3673704-1-
[email protected]/

Changes in v2:
- Remove usb3b, usb3c node define in k3.dtsi, it's already uploaded by other patch.
- Add phys and phys-name define for usb3b, usb3c, usb3d in k3-deepcomputing-fml13v05.
- Remove cd-gpios, use non-removable for sdhci0.
- Remove vmmc-supply for sdhci0.
- Link to v1: https://lore.kernel.org/all/20260922110231.3426011-1-
[email protected]/

---

Sandie Cao (3):
riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator
tree
riscv: dts: spacemit: k3-deepcomputing-fml13v05: add USB controller
and USB phy support
riscv: dts: spacemit: k3-deepcomputing-fml13v05: Enable SD card
support

 .../spacemit/k3-deepcomputing-fml13v05.dts    | 227 ++++++++++++++++++
 1 file changed, 227 insertions(+)

base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c

Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v3 1/3 riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator tree

Add the P1 PMIC's regulator topology tree for DeepComputing FML13V05 board

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 155 ++++++++++++++++++
 1 file changed, 155 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +155 -0
index b5d5112de358..804abc85602a 100644
@@ -22,6 +22,161 @@ memory@100000000 {
 		device_type = "memory";
 		reg = <0x1 0x00000000 0x4 0x00000000>;
 	};
+
+	reg_aux_vcc3v3: regulator-aux-vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	reg_aux_vcc5v: regulator-aux-vcc5v {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+};
+
+&i2c8 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c8_cfg>;
+	status = "okay";
+
+	p1@41 {
+		compatible = "spacemit,p1";
+		reg = <0x41>;
+		interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
+		vin1-supply = <&reg_aux_vcc5v>;
+		vin2-supply = <&reg_aux_vcc5v>;
+		vin3-supply = <&reg_aux_vcc5v>;
+		vin4-supply = <&reg_aux_vcc5v>;
+		vin5-supply = <&reg_aux_vcc5v>;
+		vin6-supply = <&reg_aux_vcc5v>;
+		aldoin-supply = <&reg_aux_vcc5v>;
+		dldoin1-supply = <&buck4>;
+		dldoin2-supply = <&buck4>;
+
+		regulators {
+			buck1: buck1 {
+				regulator-min-microvolt = <1050000>;
+				regulator-max-microvolt = <1050000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			buck2: buck2 {
+				regulator-min-microvolt = <1050000>;
+				regulator-max-microvolt = <1050000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			buck3: buck3 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <800000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			buck4: buck4 {
+				regulator-min-microvolt = <2100000>;
+				regulator-max-microvolt = <2100000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			buck5: buck5 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			buck6: buck6 {
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <500000>;
+				regulator-ramp-delay = <5000>;
+				regulator-always-on;
+			};
+
+			aldo1: aldo1 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			aldo2: aldo2 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			aldo3: aldo3 {
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <3400000>;
+			};
+
+			aldo4: aldo4 {
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo1: dldo1 {
+				regulator-min-microvolt = <1200000>;
+				regulator-max-microvolt = <1200000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo2: dldo2 {
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo3: dldo3 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo4: dldo4 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+			};
+
+			dldo5: dldo5 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo6: dldo6 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo7: dldo7 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+		};
+	};
 };
 
 &uart0 {
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v3 1/3] riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator tree

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [High] riscv: dts: spacemit: missing regulator-always-on on dldo4 in fml13v05 - [Low] riscv: dts…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] riscv: dts: spacemit: missing regulator-always-on on dldo4 in fml13v05
- [Low] riscv: dts: spacemit: unused reg_aux_vcc3v3 regulator node in fml13v05 --

commit 4ce9192349ccaa9cafe27a0ab82d02be78ea635e
Author: Sandie Cao <[email protected]>

riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator tree

This commit adds the P1 PMIC node and regulator topology to the DeepComputing FML13V05 board device tree.

Quoted 34 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +26 -0
index b5d5112de3581..804abc85602ab 100644
@@ -22,6 +22,161 @@ memory@100000000 {
 		device_type = "memory";
 		reg = <0x1 0x00000000 0x4 0x00000000>;
 	};
+
+	reg_aux_vcc3v3: regulator-aux-vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	reg_aux_vcc5v: regulator-aux-vcc5v {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+};
+
+&i2c8 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c8_cfg>;
+	status = "okay";
+
+	p1@41 {
+		compatible = "spacemit,p1";
+		reg = <0x41>;

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts memory@100000000 { · line 60

Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +10 -0
+		interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
+		vin1-supply = <&reg_aux_vcc5v>;
+		vin2-supply = <&reg_aux_vcc5v>;
+		vin3-supply = <&reg_aux_vcc5v>;
+		vin4-supply = <&reg_aux_vcc5v>;
+		vin5-supply = <&reg_aux_vcc5v>;
+		vin6-supply = <&reg_aux_vcc5v>;
+		aldoin-supply = <&reg_aux_vcc5v>;
+		dldoin1-supply = <&buck4>;
+		dldoin2-supply = <&buck4>;

[Severity: Low]
Is reg_aux_vcc3v3 needed in this patch?

In p1@41, vin1-supply through vin6-supply and aldoin-supply all reference reg_aux_vcc5v, while dldoin1-supply and dldoin2-supply reference buck4. The reg_aux_vcc3v3 fixed regulator node has no GPIO control and no consumers in k3-deepcomputing-fml13v05.dts, including after the subsequent USB and SD card patches in the series (where hub@1 uses compatible usb5e3,608, which forbids vdd-supply in Documentation/devicetree/bindings/usb/genesys,gl850g.yaml, and sdhci0 only references aldo1).

[ ... ]

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts memory@100000000 { · line 156

Quoted 12 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +12 -0
+			dldo3: dldo3 {
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <800000>;
+				regulator-always-on;
+				regulator-boot-on;
+			};
+
+			dldo4: dldo4 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+			};

[Severity: High]
Should dldo4 also have regulator-always-on?

When p1_regulator_probe() registers dldo4 with regulator-boot-on and without regulator-always-on, of_get_regulation_constraints() sets constraints->boot_on = true, constraints->always_on = false, and sets REGULATOR_CHANGE_STATUS in constraints->valid_ops_mask. During set_machine_constraints(), _regulator_do_enable(rdev) enables dldo4 in hardware, while rdev->use_count stays at 0 because no node in k3.dtsi or k3-deepcomputing-fml13v05.dts references &dldo4 as a supply.

Thirty seconds after late_initcall_sync(regulator_init_complete), regulator_init_complete_work_function() calls regulator_late_cleanup() in drivers/regulator/core.c:

	if (c && c->always_on)
		return 0;

	if (!regulator_ops_is_valid(rdev, REGULATOR_CHANGE_STATUS))
		return 0;

	regulator_lock(rdev);

	if (rdev->use_count)
		goto unlock;

	/* If reading the status failed, assume that it's off. */
	if (_regulator_is_enabled(rdev) <= 0)
		goto unlock;

	if (have_full_constraints()) {
		/* We log since this may kill the system if it goes
		 * wrong.
		 */
		rdev_info(rdev, "disabling\n");
		ret = _regulator_do_disable(rdev);

This disables the 1.8V dldo4 rail at boot. All other fixed boot-on LDO rails in p1@41 (aldo1, aldo2, aldo4, dldo1..dldo3, dldo5..dldo7), as well as dldo4 in arch/riscv/boot/dts/spacemit/k3-com260.dtsi (fixed in commit f314c98807c1 ("riscv: dts: spacemit: k3-com260: keep dldo4 enabled") to prevent a CPU hard-lockup), specify regulator-always-on.

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

Re: [PATCH v3 1/3] riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator tree

In reply to Sandie Cao

Hi Sandie,

Quoted 29 lines

Add the P1 PMIC's regulator topology tree for DeepComputing FML13V05 board

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 155 ++++++++++++++++++
 1 file changed, 155 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +14 -0
index b5d5112de358..804abc85602a 100644
@@ -22,6 +22,161 @@ memory@100000000 {
 		device_type = "memory";
 		reg = <0x1 0x00000000 0x4 0x00000000>;
 	};
+
+	reg_aux_vcc3v3: regulator-aux-vcc3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC3V3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	reg_aux_vcc5v: regulator-aux-vcc5v {
+		compatible = "regulator-fixed";
+		regulator-name = "AUX_VCC5V";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts memory@100000000 { · line 48

Quoted 10 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +10 -0
+		regulator-always-on;
+	};
+};
+
+&i2c8 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c8_cfg>;
+	status = "okay";
+
+	p1@41 {

I believe this should be pmic@41
If it needs a label it could be p1: pmic@41 but the node name should be more descriptive.

Kind regards,
Maud

author
#4 lore raw

Re: [PATCH v3 1/3] riscv: dts: spacemit: k3-deepcomputing-fml13v05: add P1 PMIC regulator tree

Hi Maud:

Quoted 31 lines

From: "Maud Spierings"<[email protected]>
Date:  Wed, Nov 4, 2026, 23:31

Quoted 28 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +20 -0
index b5d5112de358..804abc85602a 100644
@@ -22,6 +22,161 @@ memory@100000000 {
                  device_type = "memory";
                  reg = <0x1 0x00000000 0x4 0x00000000>;
          };
+
+        reg_aux_vcc3v3: regulator-aux-vcc3v3 {
+                compatible = "regulator-fixed";
+                regulator-name = "AUX_VCC3V3";
+                regulator-min-microvolt = <3300000>;
+                regulator-max-microvolt = <3300000>;
+                regulator-always-on;
+        };
+
+        reg_aux_vcc5v: regulator-aux-vcc5v {
+                compatible = "regulator-fixed";
+                regulator-name = "AUX_VCC5V";
+                regulator-min-microvolt = <5000000>;
+                regulator-max-microvolt = <5000000>;
+                regulator-always-on;
+        };
+};
+
+&i2c8 {
+        pinctrl-names = "default";
Quoted 8 lines

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts memory@100000000 { · line 48

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +4 -0
+        pinctrl-0 = <&i2c8_cfg>;
+        status = "okay";
+
+        p1@41 {


I believe this should be pmic@41
If it needs a label it could be p1: pmic@41 but the node name should be more descriptive.

This patch follows k3-pico-itx.dts, it uses p1@41. And k3-com260.dtsi uses pmic@41. I will uses pmic@41 in next version.

Best regards
Sandie

Quoted 4 lines


Kind regards,
Maud

author
#5 lore raw

PATCH v3 2/3 riscv: dts: spacemit: k3-deepcomputing-fml13v05: add USB controller and USB phy support

In reply to Sandie Cao

Add USB device node (b, c, d) to DeepComputing FML13V05 board. USB A works on otg mode, it isn't configured currently.
- 4 USB-C Ports
- Port 1: PD 3.0 (65W Max), USB 3.2 Gen 1
- Port 2: PD 3.0 (65W Max), USB 3.2 Gen 1, DP 1.4 (4K@60Hz)
- Port 3 & 4: USB 3.2 Gen 1

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +50 -0
index 804abc85602a..84f66dd8f962 100644
@@ -179,8 +179,58 @@ dldo7: dldo7 {
 	};
 };
 
+&combophy {
+	spacemit,apmu = <&syscon_apmu 0x17>;
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
 	status = "okay";
 };
+
+&usb2_host {
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+
+	hub@1 {
+		compatible = "usb5e3,608";
+		reg = <1>;
+	};
+};
+
+&usb2_phy {
+	status = "okay";
+};
+
+&usb3b_u2phy {
+	status = "okay";
+};
+
+&usb3b {
+	phys = <&usb3b_u2phy>, <&combophy 2 PHY_TYPE_USB3>;
+	phy-names = "usb2-phy", "usb3-phy";
+	status = "okay";
+};
+
+&usb3c_u2phy {
+	status = "okay";
+};
+
+&usb3c {
+	phys = <&usb3c_u2phy>, <&combophy 3 PHY_TYPE_USB3>;
+	phy-names = "usb2-phy", "usb3-phy";
+	status = "okay";
+};
+
+&usb3d_u2phy {
+	status = "okay";
+};
+
+&usb3d {
+	phys = <&usb3d_u2phy>, <&combophy 4 PHY_TYPE_USB3>;
+	phy-names = "usb2-phy", "usb3-phy";
+	status = "okay";
+};
Signature · 1 line
2.43.0
author
#6 lore raw

PATCH v3 3/3 riscv: dts: spacemit: k3-deepcomputing-fml13v05: Enable SD card support

In reply to Sandie Cao

Add the device tree node SDHCI-0 controller for onboard Micro SD card slot.

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +22 -0
index 84f66dd8f962..4471338a9774 100644
@@ -184,6 +184,28 @@ &combophy {
 	status = "okay";
 };
 
+/*
+ * Onboard SD card slot:
+ * Plugin/Plugout the SD card before power-on the board for secure.
+ * It works as a boot media. so set it to non-removable.
+ */
+&sdhci0 {
+	pinctrl-names = "default","uhs";
+	pinctrl-0 = <&mmc1_cfg>;
+	pinctrl-1 = <&mmc1_uhs_cfg>;
+	bus-width = <4>;
+	non-removable;
+	no-mmc;
+	no-sdio;
+	disable-wp;
+	cap-sd-highspeed;
+	vqmmc-supply = <&aldo1>;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
+	sd-uhs-sdr104;
+	status = "okay";
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
Signature · 1 line
2.43.0
reviewer
#7 lore raw

Re: [PATCH v3 3/3] riscv: dts: spacemit: k3-deepcomputing-fml13v05: Enable SD card support

Quoted 12 lines · Sandie Cao

Add the device tree node SDHCI-0 controller for onboard Micro SD card slot.

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +0 -0
index 84f66dd8f962..4471338a9774 100644

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts &combophy { · line 189

Quoted 6 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +3 -0
@@ -184,6 +184,28 @@ &combophy {
 	status = "okay";
 };
 
+/*
+ * Onboard SD card slot:
+ * Plugin/Plugout the SD card before power-on the board for secure.

How about: "Please insert or remove the SD card while the device is powered off."

Quoted 3 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +3 -0
+ * It works as a boot media. so set it to non-removable.
+ */
+&sdhci0 {

[...]

Quoted 1 line
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +1 -0
+	non-removable;

[...]

Quoted 5 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +2 -0
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
Signature · 1 line
Troy Mitchell
author
#8 lore raw

Re: [PATCH v3 3/3] riscv: dts: spacemit: k3-deepcomputing-fml13v05: Enable SD card support

Hi, Troy:

Quoted 10 lines

From: "Troy Mitchell"<[email protected]> Date:  Thu, Nov 5, 2026, 09:20

Quoted 7 lines · Sandie Cao

Add the device tree node SDHCI-0 controller for onboard Micro SD card slot.

---
 .../spacemit/k3-deepcomputing-fml13v05.dts    | 22 +++++++++++++++++++

 1 file changed, 22 insertions(+)
Quoted 12 lines
Quoted 11 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +0 -0
index 84f66dd8f962..4471338a9774 100644
@@ -184,6 +184,28 @@ &combophy {
          status = "okay";
  };


+/*
+ * Onboard SD card slot:
+ * Plugin/Plugout the SD card before power-on the board for secure.

How about: "Please insert or remove the SD card while the device is powered off."

Ok. I will fix in next version.

Best Regards
Sandie

Quoted 16 lines
Quoted 3 lines

+ * It works as a boot media. so set it to non-removable.
+ */
+&sdhci0 {

[...]

Quoted 1 line

+        non-removable;

[...]

Quoted 5 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +2 -0
+};
+

 &uart0 {
         pinctrl-names = "default";
         pinctrl-0 = <&uart0_0_cfg>;



--
Troy Mitchell