Skip to contentSkip to conversation

Enable USB and SD for Deepcomputing FML13V05 board

PATCH Superseded Sandie Cao 3 participants 6 messages Oct 20 – Oct 22

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Sandie Cao

author
#0 lore raw

v2 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 based on next-20261016.

---
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    | 223 ++++++++++++++++++
 1 file changed, 223 insertions(+)

base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64

Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v2 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
author
#2 lore raw

PATCH v2 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
#3 lore raw

PATCH v2 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 Micro SD card slot.

---
 .../dts/spacemit/k3-deepcomputing-fml13v05.dts | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +18 -0
index 84f66dd8f962..09e3d46a2ea3 100644
@@ -2,6 +2,7 @@
 /*
  * Copyright (C) 2026 DeepComputing (HK) Limited
  */
+#include <dt-bindings/gpio/gpio.h>
 
 #include "k3.dtsi"
 #include "k3-pinctrl.dtsi"
@@ -184,6 +185,23 @@ &combophy {
 	status = "okay";
 };
 
+&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
#4 lore raw

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

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] riscv: dts: spacemit: Micro SD slot sdhci0 marked non-removable - [Low] riscv: dts: spacemit…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] riscv: dts: spacemit: Micro SD slot sdhci0 marked non-removable
- [Low] riscv: dts: spacemit: unused dt-bindings/gpio/gpio.h include
--

commit 05afaddc88a27a23eeffb218991ebf7aa2ae92f1
Author: Sandie Cao <[email protected]>

riscv: dts: spacemit: k3-deepcomputing-fml13v05: Enable SD card support

This commit enables the sdhci0 controller node in the DeepComputing FML13V05 board device tree to support the Micro SD card slot.

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts line 5

Quoted 9 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +1 -0
index 84f66dd8f962e..09e3d46a2ea3e 100644
@@ -2,6 +2,7 @@
 /*
  * Copyright (C) 2026 DeepComputing (HK) Limited
  */
+#include <dt-bindings/gpio/gpio.h>

[Severity: Low]
Is this dt-bindings/gpio/gpio.h include needed here? Neither the new sdhci0 node nor the rest of k3-deepcomputing-fml13v05.dts references any GPIO macros (and k3-pinctrl.dtsi already includes this header), unless a cd-gpios property was intended to be added to sdhci0.

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

Quoted 13 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +6 -0
 #include "k3.dtsi"
 #include "k3-pinctrl.dtsi"
@@ -184,6 +185,23 @@ &combophy {
 	status = "okay";
 };
 
+&sdhci0 {
+	pinctrl-names = "default","uhs";
+	pinctrl-0 = <&mmc1_cfg>;
+	pinctrl-1 = <&mmc1_uhs_cfg>;
+	bus-width = <4>;
+	non-removable;

[Severity: Medium]
Should a Micro SD card slot be marked non-removable?

In mmc_of_parse(), non-removable sets MMC_CAP_NONREMOVABLE, which makes mmc_card_is_removable(host) return false.

Although the SpacemiT K3 SDHCI driver sets SDHCI_QUIRK_BROKEN_CARD_DETECTION in spacemit_sdhci_k3_pdata, __sdhci_add_host() only enables polling when the card is removable:

drivers/mmc/host/sdhci.c:__sdhci_add_host() {
	if ((host->quirks & SDHCI_QUIRK_BROKEN_CARD_DETECTION) &&
	    mmc_card_is_removable(mmc) &&
	    mmc_gpio_get_cd(mmc) < 0)
		mmc->caps |= MMC_CAP_NEEDS_POLL;
}

Additionally, mmc_rescan() only scans a non-removable host once at boot, and mmc_detect_card_removed() immediately returns 0:

drivers/mmc/core/core.c:mmc_rescan() {
	/* If there is a non-removable card registered, only scan once */
	if (!mmc_card_is_removable(host) && host->rescan_entered)
		return;
	host->rescan_entered = 1;
}

If the board boots without a Micro SD card inserted, cards inserted later will not be detected, and runtime card removal or swapping will not be handled. Should this use cd-gpios (if a card-detect GPIO is wired) or broken-cd instead of non-removable?

Quoted 14 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +11 -0
+	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
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
reviewer
#5 lore raw

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

In reply to Sandie Cao
Quoted 12 lines · Sandie Cao

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

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

arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts line 5

Quoted 4 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +1 -0
@@ -2,6 +2,7 @@
 /*
  * Copyright (C) 2026 DeepComputing (HK) Limited
  */
+#include <dt-bindings/gpio/gpio.h>

This header is no longer needed now that cd-gpios has been removed.

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

Quoted 13 lines
arch/riscv/boot/dts/spacemit/k3-deepcomputing-fml13v05.dts +6 -0
 #include "k3.dtsi"
 #include "k3-pinctrl.dtsi"
@@ -184,6 +185,23 @@ &combophy {
 	status = "okay";
 };
 
+&sdhci0 {
+	pinctrl-names = "default","uhs";
+	pinctrl-0 = <&mmc1_cfg>;
+	pinctrl-1 = <&mmc1_uhs_cfg>;
+	bus-width = <4>;
+	non-removable;

Could we add a comment explaining why the SD card is marked as non-removable?

Signature · 1 line
Troy Mitchell