* [PATCH v2 1/6] riscv: dts: spacemit: k1: Move common U-Boot nodes to shared DTSI
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
@ 2026-11-23 19:36 ` Anand Moon
2026-11-23 19:37 ` [PATCH v2 2/6] riscv: dts: spacemit: k1-musepi-pro: Drop redundant DT overrides Anand Moon
` (5 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:36 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tim Ouyang, Leo Liang, Yao Zi, Tom Rini, Guodong Xu,
Raymond Mao, u-boot-spacemit
The Banana Pi BPI-F3 and MusePi Pro U-Boot device trees contain
identical Binman descriptions and memory node overrides.
Move the Binman description into spacemit-k1-binman.dtsi and the
memory override into spacemit-k1-u-boot.dtsi.
Include the common U-Boot device tree through DEVICE_TREE_INCLUDES
to avoid duplicating these definitions in the board-specific files.
This is a device tree reorganization with no intended functional
changes.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi | 32 -----------------------
arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 29 --------------------
arch/riscv/dts/spacemit-k1-binman.dtsi | 29 ++++++++++++++++++++
arch/riscv/dts/spacemit-k1-u-boot.dtsi | 13 +++++++++
configs/spacemit_k1_defconfig | 1 +
5 files changed, 43 insertions(+), 61 deletions(-)
create mode 100644 arch/riscv/dts/spacemit-k1-binman.dtsi
create mode 100644 arch/riscv/dts/spacemit-k1-u-boot.dtsi
diff --git a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
index 36c1bfc12fb..bc117f5987a 100644
--- a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
+++ b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
@@ -3,15 +3,6 @@
* Copyright (C) 2026 RISCstar Ltd.
*/
-#include "binman.dtsi"
-
-/ {
- memory@0 {
- device_type = "memory";
- reg = <0x00000000 0x00000000 0x00000000 0x80000000>;
- };
-};
-
&uart0 {
bootph-pre-ram;
};
@@ -96,26 +87,3 @@
bootph-pre-ram;
max-frequency = <204800000>;
};
-
-&binman {
- u-boot-spl-ddr {
- type = "section";
- filename = "u-boot-spl-ddr.bin";
- pad-byte = <0xff>;
-
- u-boot-spl {
- };
-
- ddr-fw {
- type = "blob";
- filename = "ddr_fw.bin";
- align = <64>;
- };
-
- u-boot-any {
- type = "section";
- size = <0>;
- offset = <0>;
- };
- };
-};
diff --git a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
index f2688a1868f..03cfed10521 100644
--- a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
+++ b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
@@ -4,7 +4,6 @@
*/
#include <dt-bindings/clock/spacemit,k1-syscon.h>
-#include "binman.dtsi"
/ {
aliases {
@@ -15,11 +14,6 @@
chosen {
stdout-path = "serial0:115200n8";
};
-
- memory@0 {
- device_type = "memory";
- reg = <0x00000000 0x00000000 0x00000000 0x80000000>;
- };
};
&syscon_mpmu {
@@ -133,26 +127,3 @@
bootph-pre-ram;
max-frequency = <204800000>;
};
-
-&binman {
- u-boot-spl-ddr {
- type = "section";
- filename = "u-boot-spl-ddr.bin";
- pad-byte = <0xff>;
-
- u-boot-spl {
- };
-
- ddr-fw {
- type = "blob";
- filename = "ddr_fw.bin";
- align = <64>;
- };
-
- u-boot-any {
- type = "section";
- size = <0>;
- offset = <0>;
- };
- };
-};
diff --git a/arch/riscv/dts/spacemit-k1-binman.dtsi b/arch/riscv/dts/spacemit-k1-binman.dtsi
new file mode 100644
index 00000000000..2ff6bd2cc43
--- /dev/null
+++ b/arch/riscv/dts/spacemit-k1-binman.dtsi
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright (C) 2026 RISCstar Ltd.
+ */
+
+#include "binman.dtsi"
+
+&binman {
+ u-boot-spl-ddr {
+ type = "section";
+ filename = "u-boot-spl-ddr.bin";
+ pad-byte = <0xff>;
+
+ u-boot-spl {
+ };
+
+ ddr-fw {
+ type = "blob";
+ filename = "ddr_fw.bin";
+ align = <64>;
+ };
+
+ u-boot-any {
+ type = "section";
+ size = <0>;
+ offset = <0>;
+ };
+ };
+};
diff --git a/arch/riscv/dts/spacemit-k1-u-boot.dtsi b/arch/riscv/dts/spacemit-k1-u-boot.dtsi
new file mode 100644
index 00000000000..0d92edf9fc1
--- /dev/null
+++ b/arch/riscv/dts/spacemit-k1-u-boot.dtsi
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright (C) 2026 RISCstar Ltd.
+ */
+
+/ {
+ memory@0 {
+ device_type = "memory";
+ reg = <0x00000000 0x00000000 0x00000000 0x80000000>;
+ };
+};
+
+#include "spacemit-k1-binman.dtsi"
diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
index d9cb6c8cebc..0f6e9284259 100644
--- a/configs/spacemit_k1_defconfig
+++ b/configs/spacemit_k1_defconfig
@@ -66,6 +66,7 @@ CONFIG_CMD_EXT4=y
CONFIG_CMD_FAT=y
CONFIG_EFI_PARTITION=y
CONFIG_OF_UPSTREAM=y
+CONFIG_DEVICE_TREE_INCLUDES="spacemit-k1-u-boot.dtsi"
CONFIG_OF_LIST="spacemit/k1-bananapi-f3 spacemit/k1-musepi-pro"
CONFIG_MULTI_DTB_FIT=y
CONFIG_ENV_OVERWRITE=y
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 2/6] riscv: dts: spacemit: k1-musepi-pro: Drop redundant DT overrides
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
2026-11-23 19:36 ` [PATCH v2 1/6] riscv: dts: spacemit: k1: Move common U-Boot nodes to shared DTSI Anand Moon
@ 2026-11-23 19:37 ` Anand Moon
2026-11-23 19:37 ` [PATCH v2 3/6] riscv: dts: spacemit: k1: Move common U-Boot properties to shared DTSI Anand Moon
` (4 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:37 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tim Ouyang, Leo Liang, Yao Zi, Tom Rini,
u-boot-spacemit
The upstream MusePi Pro device tree already defines the serial0,
mmc0 and mmc1 aliases, as well as the chosen stdout-path.
Remove the duplicate definitions from the U-Boot-specific device
tree while retaining the console alias.
No functional changes are intended.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
index 03cfed10521..ddea04a8e3e 100644
--- a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
+++ b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
@@ -8,11 +8,6 @@
/ {
aliases {
console = &uart0;
- serial0 = &uart0;
- };
-
- chosen {
- stdout-path = "serial0:115200n8";
};
};
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 3/6] riscv: dts: spacemit: k1: Move common U-Boot properties to shared DTSI
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
2026-11-23 19:36 ` [PATCH v2 1/6] riscv: dts: spacemit: k1: Move common U-Boot nodes to shared DTSI Anand Moon
2026-11-23 19:37 ` [PATCH v2 2/6] riscv: dts: spacemit: k1-musepi-pro: Drop redundant DT overrides Anand Moon
@ 2026-11-23 19:37 ` Anand Moon
2026-11-23 19:37 ` [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver Anand Moon
` (3 subsequent siblings)
6 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:37 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tim Ouyang, Leo Liang, Yao Zi, Tom Rini, Guodong Xu,
Raymond Mao, u-boot-spacemit
Move common U-Boot device tree properties from the Banana Pi F3
and MusePi Pro board-specific DTSI files into spacemit-k1-u-boot.dtsi.
Consolidate early boot properties for UART, clocks, I2C, eMMC and
SDHCI controllers to reduce duplication between the boards.
Also move the clock configuration for the MPMU and APBC system
controllers into the shared DTSI.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi | 54 ----------------
arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 79 -----------------------
arch/riscv/dts/spacemit-k1-u-boot.dtsi | 76 ++++++++++++++++++++++
3 files changed, 76 insertions(+), 133 deletions(-)
diff --git a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
index bc117f5987a..4e9f2c13203 100644
--- a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
+++ b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi
@@ -3,50 +3,6 @@
* Copyright (C) 2026 RISCstar Ltd.
*/
-&uart0 {
- bootph-pre-ram;
-};
-
-&osc_32k {
- bootph-pre-ram;
-};
-
-&vctcxo_1m {
- bootph-pre-ram;
-};
-
-&vctcxo_3m {
- bootph-pre-ram;
-};
-
-&vctcxo_24m {
- bootph-pre-ram;
-};
-
-&syscon_mpmu {
- bootph-pre-ram;
-};
-
-&pll {
- bootph-pre-ram;
-};
-
-&syscon_apmu {
- bootph-pre-ram;
-};
-
-&syscon_apbc {
- bootph-pre-ram;
-};
-
-&i2c2 {
- bootph-pre-ram;
-
- eeprom@50 {
- bootph-pre-ram;
- };
-};
-
/*
* The kernel pmic@41 nodes use the standard regulator-* properties only.
* The SPL board code looks up the bucks that DDR training depends on by
@@ -77,13 +33,3 @@
};
};
};
-
-&emmc {
- bootph-pre-ram;
- max-frequency = <204800000>;
-};
-
-&sdhci0 {
- bootph-pre-ram;
- max-frequency = <204800000>;
-};
diff --git a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
index ddea04a8e3e..834d9f46b48 100644
--- a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
+++ b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi
@@ -3,75 +3,6 @@
* Copyright (C) 2026 RISCstar Ltd.
*/
-#include <dt-bindings/clock/spacemit,k1-syscon.h>
-
-/ {
- aliases {
- console = &uart0;
- };
-};
-
-&syscon_mpmu {
- clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>, <&vctcxo_24m>,
- <&pll CLK_PLL1_D4>;
- clock-names = "osc", "vctcxo_1m", "vctcxo_3m", "vctcxo_24m",
- "pll1_d4";
-};
-
-&syscon_apbc {
- clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>, <&vctcxo_24m>,
- <&pll CLK_PLL1_D4>,
- <&syscon_mpmu CLK_PLL1_31P5>,
- <&syscon_apmu CLK_PMUA_ACLK>;
- clock-names = "osc", "vctcxo_1m", "vctcxo_3m", "vctcxo_24m",
- "pll1_d4", "pll1_d78_31p5", "pmua_aclk";
-};
-
-&uart0 {
- bootph-pre-ram;
-};
-
-&osc_32k {
- bootph-pre-ram;
-};
-
-&vctcxo_1m {
- bootph-pre-ram;
-};
-
-&vctcxo_3m {
- bootph-pre-ram;
-};
-
-&vctcxo_24m {
- bootph-pre-ram;
-};
-
-&syscon_mpmu {
- bootph-pre-ram;
-};
-
-&pll {
- bootph-pre-ram;
-};
-
-&syscon_apmu {
- bootph-pre-ram;
-};
-
-&syscon_apbc {
- bootph-pre-ram;
-};
-
-&i2c2 {
- bootph-pre-ram;
-
- eeprom@50 {
- bootph-pre-ram;
- status = "okay";
- };
-};
-
&i2c8 {
bootph-pre-ram;
status = "okay";
@@ -112,13 +43,3 @@
status = "okay";
};
};
-
-&emmc {
- bootph-pre-ram;
- max-frequency = <204800000>;
-};
-
-&sdhci0 {
- bootph-pre-ram;
- max-frequency = <204800000>;
-};
diff --git a/arch/riscv/dts/spacemit-k1-u-boot.dtsi b/arch/riscv/dts/spacemit-k1-u-boot.dtsi
index 0d92edf9fc1..c084e15cb94 100644
--- a/arch/riscv/dts/spacemit-k1-u-boot.dtsi
+++ b/arch/riscv/dts/spacemit-k1-u-boot.dtsi
@@ -3,11 +3,87 @@
* Copyright (C) 2026 RISCstar Ltd.
*/
+#include <dt-bindings/clock/spacemit,k1-syscon.h>
+
/ {
memory@0 {
device_type = "memory";
reg = <0x00000000 0x00000000 0x00000000 0x80000000>;
};
+
+ aliases {
+ console = &uart0;
+ };
+};
+
+&syscon_mpmu {
+ clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>, <&vctcxo_24m>,
+ <&pll CLK_PLL1_D4>;
+ clock-names = "osc", "vctcxo_1m", "vctcxo_3m", "vctcxo_24m",
+ "pll1_d4";
+};
+
+&syscon_apbc {
+ clocks = <&osc_32k>, <&vctcxo_1m>, <&vctcxo_3m>, <&vctcxo_24m>,
+ <&pll CLK_PLL1_D4>,
+ <&syscon_mpmu CLK_PLL1_31P5>,
+ <&syscon_apmu CLK_PMUA_ACLK>;
+ clock-names = "osc", "vctcxo_1m", "vctcxo_3m", "vctcxo_24m",
+ "pll1_d4", "pll1_d78_31p5", "pmua_aclk";
+};
+
+&uart0 {
+ bootph-pre-ram;
+};
+
+&osc_32k {
+ bootph-pre-ram;
+};
+
+&vctcxo_1m {
+ bootph-pre-ram;
+};
+
+&vctcxo_3m {
+ bootph-pre-ram;
+};
+
+&vctcxo_24m {
+ bootph-pre-ram;
+};
+
+&syscon_mpmu {
+ bootph-pre-ram;
+};
+
+&pll {
+ bootph-pre-ram;
+};
+
+&syscon_apmu {
+ bootph-pre-ram;
+};
+
+&syscon_apbc {
+ bootph-pre-ram;
+};
+
+&i2c2 {
+ bootph-pre-ram;
+
+ eeprom@50 {
+ bootph-pre-ram;
+ };
+};
+
+&emmc {
+ bootph-pre-ram;
+ max-frequency = <204800000>;
+};
+
+&sdhci0 {
+ bootph-pre-ram;
+ max-frequency = <204800000>;
};
#include "spacemit-k1-binman.dtsi"
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
` (2 preceding siblings ...)
2026-11-23 19:37 ` [PATCH v2 3/6] riscv: dts: spacemit: k1: Move common U-Boot properties to shared DTSI Anand Moon
@ 2026-11-23 19:37 ` Anand Moon
2026-11-24 10:52 ` Yixun Lan
2026-11-23 19:37 ` [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver Anand Moon
` (2 subsequent siblings)
6 siblings, 1 reply; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:37 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tom Rini, Raymond Mao, u-boot-spacemit
Add a Kconfig option to enable the SpacemiT K1/K3 pinctrl driver
in SPL, allowing pin multiplexing and pin configuration during
early board initialization.
Depend on SPL_PINCTRL instead of SPL_DM_GPIO, as pinctrl support
does not require the GPIO subsystem.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
drivers/pinctrl/spacemit/Kconfig | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig
index 87cba336923..ad5b458480a 100644
--- a/drivers/pinctrl/spacemit/Kconfig
+++ b/drivers/pinctrl/spacemit/Kconfig
@@ -7,3 +7,11 @@ config PINCTRL_SPACEMIT_K1
The driver is controlled by a device tree node which contains both
the GPIO definitions and pin control functions for each available
multiplex function.
+
+config SPL_PINCTRL_SPACEMIT_K1
+ bool "SpacemiT K1/K3 pinctrl driver in SPL"
+ depends on SPL_PINCTRL && (TARGET_SPACEMIT_K1 || TARGET_SPACEMIT_K3)
+ select PINCTRL_SPACEMIT_K1
+ help
+ Enable the SpacemiT K1/K3 pinctrl driver in SPL to configure
+ pin multiplexing and pin settings during early initialization.
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver
2026-11-23 19:37 ` [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver Anand Moon
@ 2026-11-24 10:52 ` Yixun Lan
2026-11-25 3:07 ` Anand Moon
0 siblings, 1 reply; 15+ messages in thread
From: Yixun Lan @ 2026-11-24 10:52 UTC (permalink / raw)
To: Anand Moon
Cc: u-boot, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Tom Rini, Raymond Mao, u-boot-spacemit
On 19:37 Mon 23 Nov , Anand Moon wrote:
> Add a Kconfig option to enable the SpacemiT K1/K3 pinctrl driver
> in SPL, allowing pin multiplexing and pin configuration during
> early board initialization.
>
..
> Depend on SPL_PINCTRL instead of SPL_DM_GPIO, as pinctrl support
> does not require the GPIO subsystem.
>
Not put above into commit message, but should in Changelog..
> Cc: Dave Klotz <DaveWK225@protonmail.com>
> Cc: Eric Chung <eric.chung@riscstar.com>
> Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> Cc: E Shattow <e@freeshell.de>
> Cc: Yixun Lan <dlan@kernel.org>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Otherwise, Looks good
Reviewed-by: Yixun Lan <dlan@kernel.org>
> ---
> drivers/pinctrl/spacemit/Kconfig | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/pinctrl/spacemit/Kconfig b/drivers/pinctrl/spacemit/Kconfig
> index 87cba336923..ad5b458480a 100644
> --- a/drivers/pinctrl/spacemit/Kconfig
> +++ b/drivers/pinctrl/spacemit/Kconfig
> @@ -7,3 +7,11 @@ config PINCTRL_SPACEMIT_K1
> The driver is controlled by a device tree node which contains both
> the GPIO definitions and pin control functions for each available
> multiplex function.
> +
> +config SPL_PINCTRL_SPACEMIT_K1
> + bool "SpacemiT K1/K3 pinctrl driver in SPL"
> + depends on SPL_PINCTRL && (TARGET_SPACEMIT_K1 || TARGET_SPACEMIT_K3)
> + select PINCTRL_SPACEMIT_K1
> + help
> + Enable the SpacemiT K1/K3 pinctrl driver in SPL to configure
> + pin multiplexing and pin settings during early initialization.
> --
> 2.56.1
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver
2026-11-24 10:52 ` Yixun Lan
@ 2026-11-25 3:07 ` Anand Moon
0 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-25 3:07 UTC (permalink / raw)
To: Yixun Lan
Cc: u-boot, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Tom Rini, Raymond Mao, u-boot-spacemit
Hi Yixun,
On Tue, 24 Nov 2026 at 16:22, Yixun Lan <dlan@kernel.org> wrote:
>
> On 19:37 Mon 23 Nov , Anand Moon wrote:
> > Add a Kconfig option to enable the SpacemiT K1/K3 pinctrl driver
> > in SPL, allowing pin multiplexing and pin configuration during
> > early board initialization.
> >
> ..
> > Depend on SPL_PINCTRL instead of SPL_DM_GPIO, as pinctrl support
> > does not require the GPIO subsystem.
> >
> Not put above into commit message, but should in Changelog..
>
Ok, Thanks
> > Cc: Dave Klotz <DaveWK225@protonmail.com>
> > Cc: Eric Chung <eric.chung@riscstar.com>
> > Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> > Cc: E Shattow <e@freeshell.de>
> > Cc: Yixun Lan <dlan@kernel.org>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> Otherwise, Looks good
> Reviewed-by: Yixun Lan <dlan@kernel.org>
>
Thanks
-Anand
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
` (3 preceding siblings ...)
2026-11-23 19:37 ` [PATCH v2 4/6] pinctrl: spacemit: Add SPL support for K1/K3 pinctrl driver Anand Moon
@ 2026-11-23 19:37 ` Anand Moon
2026-11-24 10:53 ` Yixun Lan
2026-11-23 19:37 ` [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL Anand Moon
2026-11-25 15:35 ` [PATCH v2 0/6] riscv: spacemit: Add " Anand Moon
6 siblings, 1 reply; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:37 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tom Rini, Johan Jonker, Raymond Mao
Allow SPL to access GPIOs on SpacemiT K1 and K3 platforms during
early board initialization, including GPIO-based card detection
for SD controllers.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
drivers/gpio/Kconfig | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 7f12e39dad8..ac7bd642cf6 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -457,6 +457,13 @@ config SPACEMIT_GPIO
arranged into a number of banks (different for each SoC type) each
with 32 GPIOs.
+config SPL_SPACEMIT_GPIO
+ bool "SpacemiT GPIO driver in SPL"
+ depends on SPL_DM_GPIO && (TARGET_SPACEMIT_K1 || TARGET_SPACEMIT_K3)
+ select SPACEMIT_GPIO
+ help
+ Enable the SpacemiT GPIO driver in SPL to provide GPIO
+ access during early board initialization.
config SUNXI_GPIO
bool "Allwinner GPIO driver"
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver
2026-11-23 19:37 ` [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver Anand Moon
@ 2026-11-24 10:53 ` Yixun Lan
0 siblings, 0 replies; 15+ messages in thread
From: Yixun Lan @ 2026-11-24 10:53 UTC (permalink / raw)
To: Anand Moon
Cc: u-boot, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Tom Rini, Johan Jonker, Raymond Mao
hi Anand,
On 19:37 Mon 23 Nov , Anand Moon wrote:
> Allow SPL to access GPIOs on SpacemiT K1 and K3 platforms during
> early board initialization, including GPIO-based card detection
> for SD controllers.
>
> Cc: Dave Klotz <DaveWK225@protonmail.com>
> Cc: Eric Chung <eric.chung@riscstar.com>
> Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> Cc: E Shattow <e@freeshell.de>
> Cc: Yixun Lan <dlan@kernel.org>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
Reviewed-by: Yixun Lan <dlan@kernel.org>
> ---
> drivers/gpio/Kconfig | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 7f12e39dad8..ac7bd642cf6 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -457,6 +457,13 @@ config SPACEMIT_GPIO
> arranged into a number of banks (different for each SoC type) each
> with 32 GPIOs.
>
> +config SPL_SPACEMIT_GPIO
> + bool "SpacemiT GPIO driver in SPL"
> + depends on SPL_DM_GPIO && (TARGET_SPACEMIT_K1 || TARGET_SPACEMIT_K3)
> + select SPACEMIT_GPIO
> + help
> + Enable the SpacemiT GPIO driver in SPL to provide GPIO
> + access during early board initialization.
>
> config SUNXI_GPIO
> bool "Allwinner GPIO driver"
> --
> 2.56.1
>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
` (4 preceding siblings ...)
2026-11-23 19:37 ` [PATCH v2 5/6] gpio: spacemit: Add SPL support for K1/K3 GPIO driver Anand Moon
@ 2026-11-23 19:37 ` Anand Moon
2026-11-24 6:33 ` Junhui Liu
2026-11-25 15:35 ` [PATCH v2 0/6] riscv: spacemit: Add " Anand Moon
6 siblings, 1 reply; 15+ messages in thread
From: Anand Moon @ 2026-11-23 19:37 UTC (permalink / raw)
To: u-boot
Cc: Anand Moon, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit
Enable GPIO and pinctrl support in SPL for the SpacemiT K1 SoC.
Select the SPL driver model GPIO framework and the SpacemiT GPIO
driver, along with the pinctrl framework and K1 pinctrl driver.
These drivers allow SPL to configure pin multiplexing and access
GPIOs required by early boot peripherals, including I2C, MMC and
other board-specific devices.
Cc: Dave Klotz <DaveWK225@protonmail.com>
Cc: Eric Chung <eric.chung@riscstar.com>
Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
Cc: E Shattow <e@freeshell.de>
Cc: Yixun Lan <dlan@kernel.org>
Signed-off-by: Anand Moon <linux.amoon@gmail.com>
---
configs/spacemit_k1_defconfig | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
index 0f6e9284259..6c60ca789a9 100644
--- a/configs/spacemit_k1_defconfig
+++ b/configs/spacemit_k1_defconfig
@@ -121,3 +121,8 @@ CONFIG_USB_DWC3_GENERIC=y
CONFIG_USB_STORAGE=y
CONFIG_USB_ONBOARD_HUB=y
CONFIG_SPL_LIB_RATIONAL=y
+CONFIG_SPL_GPIO=y
+CONFIG_SPL_DM_GPIO=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_SPL_SPACEMIT_GPIO=y
+CONFIG_SPL_PINCTRL_SPACEMIT_K1=y
--
2.56.1
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL
2026-11-23 19:37 ` [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL Anand Moon
@ 2026-11-24 6:33 ` Junhui Liu
2026-11-24 7:02 ` Anand Moon
0 siblings, 1 reply; 15+ messages in thread
From: Junhui Liu @ 2026-11-24 6:33 UTC (permalink / raw)
To: Anand Moon, u-boot
Cc: Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow, Yixun Lan,
Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit
Hi Anand,
On Tue Nov 24, 2026 at 3:37 AM CST, Anand Moon wrote:
> Enable GPIO and pinctrl support in SPL for the SpacemiT K1 SoC.
>
> Select the SPL driver model GPIO framework and the SpacemiT GPIO
> driver, along with the pinctrl framework and K1 pinctrl driver.
>
> These drivers allow SPL to configure pin multiplexing and access
> GPIOs required by early boot peripherals, including I2C, MMC and
> other board-specific devices.
>
> Cc: Dave Klotz <DaveWK225@protonmail.com>
> Cc: Eric Chung <eric.chung@riscstar.com>
> Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> Cc: E Shattow <e@freeshell.de>
> Cc: Yixun Lan <dlan@kernel.org>
> Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> ---
> configs/spacemit_k1_defconfig | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
> index 0f6e9284259..6c60ca789a9 100644
> --- a/configs/spacemit_k1_defconfig
> +++ b/configs/spacemit_k1_defconfig
> @@ -121,3 +121,8 @@ CONFIG_USB_DWC3_GENERIC=y
> CONFIG_USB_STORAGE=y
> CONFIG_USB_ONBOARD_HUB=y
> CONFIG_SPL_LIB_RATIONAL=y
> +CONFIG_SPL_GPIO=y
> +CONFIG_SPL_DM_GPIO=y
> +CONFIG_SPL_PINCTRL=y
> +CONFIG_SPL_SPACEMIT_GPIO=y
> +CONFIG_SPL_PINCTRL_SPACEMIT_K1=y
As I mentioned in your v1 series, CLK_AIB and CLK_AIB_BUS are still
missing from the SPL clock driver, but this patch enables SPL pinctrl.
Once the pinctrl controller and pin configuration nodes are retained
in the SPL DT and used by a device, K1 hangs during boot.
--
Best regards,
Junhui Liu
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL
2026-11-24 6:33 ` Junhui Liu
@ 2026-11-24 7:02 ` Anand Moon
0 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-24 7:02 UTC (permalink / raw)
To: Junhui Liu
Cc: u-boot, Dave Klotz, Eric Chung, Hung-Chun Tseng, E Shattow,
Yixun Lan, Tom Rini, Guodong Xu, Raymond Mao, u-boot-spacemit
Hi Junhui,
On Tue, 24 Nov 2026 at 12:04, Junhui Liu <junhui.liu@pigmoral.tech> wrote:
>
> Hi Anand,
>
> On Tue Nov 24, 2026 at 3:37 AM CST, Anand Moon wrote:
> > Enable GPIO and pinctrl support in SPL for the SpacemiT K1 SoC.
> >
> > Select the SPL driver model GPIO framework and the SpacemiT GPIO
> > driver, along with the pinctrl framework and K1 pinctrl driver.
> >
> > These drivers allow SPL to configure pin multiplexing and access
> > GPIOs required by early boot peripherals, including I2C, MMC and
> > other board-specific devices.
> >
> > Cc: Dave Klotz <DaveWK225@protonmail.com>
> > Cc: Eric Chung <eric.chung@riscstar.com>
> > Cc: Hung-Chun Tseng <alan.tseng.cs@gmail.com>
> > Cc: E Shattow <e@freeshell.de>
> > Cc: Yixun Lan <dlan@kernel.org>
> > Signed-off-by: Anand Moon <linux.amoon@gmail.com>
> > ---
> > configs/spacemit_k1_defconfig | 5 +++++
> > 1 file changed, 5 insertions(+)
> >
> > diff --git a/configs/spacemit_k1_defconfig b/configs/spacemit_k1_defconfig
> > index 0f6e9284259..6c60ca789a9 100644
> > --- a/configs/spacemit_k1_defconfig
> > +++ b/configs/spacemit_k1_defconfig
> > @@ -121,3 +121,8 @@ CONFIG_USB_DWC3_GENERIC=y
> > CONFIG_USB_STORAGE=y
> > CONFIG_USB_ONBOARD_HUB=y
> > CONFIG_SPL_LIB_RATIONAL=y
> > +CONFIG_SPL_GPIO=y
> > +CONFIG_SPL_DM_GPIO=y
> > +CONFIG_SPL_PINCTRL=y
> > +CONFIG_SPL_SPACEMIT_GPIO=y
> > +CONFIG_SPL_PINCTRL_SPACEMIT_K1=y
>
> As I mentioned in your v1 series, CLK_AIB and CLK_AIB_BUS are still
> missing from the SPL clock driver, but this patch enables SPL pinctrl.
> Once the pinctrl controller and pin configuration nodes are retained
> in the SPL DT and used by a device, K1 hangs during boot.
>
Thanks for your feedback. I might have missed it. I will check this.
> --
> Best regards,
> Junhui Liu
>
Thanks
-Anand
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL
2026-11-23 19:36 [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL Anand Moon
` (5 preceding siblings ...)
2026-11-23 19:37 ` [PATCH v2 6/6] riscv: spacemit: k1: Enable GPIO and pinctrl support in SPL Anand Moon
@ 2026-11-25 15:35 ` Anand Moon
2026-11-25 16:23 ` E Shattow
6 siblings, 1 reply; 15+ messages in thread
From: Anand Moon @ 2026-11-25 15:35 UTC (permalink / raw)
To: u-boot; +Cc: Yixun Lan, Zixian Zeng
Hi All,
+Zixian Zeng
On Tue, 24 Nov 2026 at 01:07, Anand Moon <linux.amoon@gmail.com> wrote:
>
> This series consolidates common U-Boot device tree properties for
> SpacemiT K1 boards and enables GPIO and pinctrl support in SPL.
>
> The device tree changes move common early boot properties into shared
> DTSI files, reducing duplication between the Banana Pi BPI-F3 and
> MusePi Pro boards.
>
> The remaining patches add SPL build support for the SpacemiT K1/K3
> GPIO and pinctrl drivers and enable these drivers in the K1 SPL
> configuration.
>
> The series consists of six patches:
>
> 1. Move common K1 U-Boot nodes into a shared DTSI.
> 2. Remove redundant MusePi Pro device tree overrides.
> 3. Move common K1 U-Boot properties into the shared DTSI.
> 4. Add SPL support for the K1/K3 pinctrl driver.
> 5. Add SPL support for the K1/K3 GPIO driver.
> 6. Enable GPIO and pinctrl support in K1 SPL.
>
Following the description on the Linux mainline list:
[1] https://lore.kernel.org/all/20261123-fix-bpf3-eeprom-v1-1-df8cce6ef2b5@gmail.com/
I am currently working on enabling multi-DTB support in U-Boot SPL
for SpacemiT K1 boards.
While investigating the board detection issue, I noticed that the EEPROM
on my Banana Pi BPI-F3 does not contain a Product Name TLV entry.
alarm@k1:~$ sudo hexdump -C /sys/bus/i2c/devices/2-0050/eeprom
00000000 54 6c 76 49 6e 66 6f 00 01 00 20 24 06 fe fe fe |TlvInfo... $....|
00000010 d5 52 bd 2a 02 00 02 23 0c 39 38 61 39 63 33 61 |.R.*...#.98a9c3a|
00000020 32 62 64 34 37 fe 04 3b e3 ff bd ff ff ff ff ff |2bd47..;........|
00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00000100
Although the EEPROM is readable, the missing Product Name TLV entry
explains why read_product_name() returns `-ENOENT` (-2), assuming the
EEPROM read and validation succeed.
Consequently, automatic board detection fails, and U-Boot falls back to
CONFIG_DEFAULT_DEVICE_TREE, which may select an incorrect device
tree for the target board.
Since the SD card-detect GPIO polarity differs between the Banana Pi BPI-F3
and MusePi Pro, selecting the incorrect device tree can result in SD
card detection
and boot failures.
The following SPL boot log shows the board detection failure, although
DDR initialization completes successfully:
```
U-Boot SPL 2026.10-01060-gf3080abcfe92-dirty (Oct 24 2026 - 17:30:03 +0530)
Fail to detect board:-2
vdd_core, value:900000
vdd_1v8, value:1800000
vdd_1v8_mmc, value:1800000
DDR firmware: [0xc0820900]:0xf0227179, size:0x8d98
DDR is ready
```
Could you please confirm whether the Product Name TLV entry is
expected to be programmed into the EEPROM during manufacturing?
Also, is there a recommended approach for handling boards with missing
product information in the EEPROM to ensure reliable automatic device
tree selection?
> Changes in v2:
> - Consolidate additional common U-Boot properties into
> spacemit-k1-u-boot.dtsi.
> - Reduce duplication in the board-specific DTSI files.
> - Retain board-specific configuration where required.
>
This current series is incomplete, I missed few code cnages
But I am working on a few changes to fix
Please review the DTS changes and share your feedback.
Thanks
-Anand
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL
2026-11-25 15:35 ` [PATCH v2 0/6] riscv: spacemit: Add " Anand Moon
@ 2026-11-25 16:23 ` E Shattow
2026-11-26 6:04 ` Anand Moon
0 siblings, 1 reply; 15+ messages in thread
From: E Shattow @ 2026-11-25 16:23 UTC (permalink / raw)
To: Anand Moon, u-boot; +Cc: Yixun Lan, Zixian Zeng
Hi Anand,
On 11/25/26 07:35, Anand Moon wrote:
> Hi All,
>
> +Zixian Zeng
>
> On Tue, 24 Nov 2026 at 01:07, Anand Moon <linux.amoon@gmail.com> wrote:
>>
>> This series consolidates common U-Boot device tree properties for
>> SpacemiT K1 boards and enables GPIO and pinctrl support in SPL.
>>
>> The device tree changes move common early boot properties into shared
>> DTSI files, reducing duplication between the Banana Pi BPI-F3 and
>> MusePi Pro boards.
>>
>> The remaining patches add SPL build support for the SpacemiT K1/K3
>> GPIO and pinctrl drivers and enable these drivers in the K1 SPL
>> configuration.
>>
>> The series consists of six patches:
>>
>> 1. Move common K1 U-Boot nodes into a shared DTSI.
>> 2. Remove redundant MusePi Pro device tree overrides.
>> 3. Move common K1 U-Boot properties into the shared DTSI.
>> 4. Add SPL support for the K1/K3 pinctrl driver.
>> 5. Add SPL support for the K1/K3 GPIO driver.
>> 6. Enable GPIO and pinctrl support in K1 SPL.
>>
> Following the description on the Linux mainline list:
>
> [1] https://lore.kernel.org/all/20261123-fix-bpf3-eeprom-v1-1-df8cce6ef2b5@gmail.com/
>
> I am currently working on enabling multi-DTB support in U-Boot SPL
> for SpacemiT K1 boards.
>
> While investigating the board detection issue, I noticed that the EEPROM
> on my Banana Pi BPI-F3 does not contain a Product Name TLV entry.
>
> alarm@k1:~$ sudo hexdump -C /sys/bus/i2c/devices/2-0050/eeprom
> 00000000 54 6c 76 49 6e 66 6f 00 01 00 20 24 06 fe fe fe |TlvInfo... $....|
> 00000010 d5 52 bd 2a 02 00 02 23 0c 39 38 61 39 63 33 61 |.R.*...#.98a9c3a|
> 00000020 32 62 64 34 37 fe 04 3b e3 ff bd ff ff ff ff ff |2bd47..;........|
> 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> *
> 00000100
>
> Although the EEPROM is readable, the missing Product Name TLV entry
> explains why read_product_name() returns `-ENOENT` (-2), assuming the
> EEPROM read and validation succeed.
>
> Consequently, automatic board detection fails, and U-Boot falls back to
> CONFIG_DEFAULT_DEVICE_TREE, which may select an incorrect device
> tree for the target board.
>
> Since the SD card-detect GPIO polarity differs between the Banana Pi BPI-F3
> and MusePi Pro, selecting the incorrect device tree can result in SD
> card detection
> and boot failures.
>
> The following SPL boot log shows the board detection failure, although
> DDR initialization completes successfully:
>
> ```
> U-Boot SPL 2026.10-01060-gf3080abcfe92-dirty (Oct 24 2026 - 17:30:03 +0530)
> Fail to detect board:-2
> vdd_core, value:900000
> vdd_1v8, value:1800000
> vdd_1v8_mmc, value:1800000
> DDR firmware: [0xc0820900]:0xf0227179, size:0x8d98
> DDR is ready
> ```
> Could you please confirm whether the Product Name TLV entry is
> expected to be programmed into the EEPROM during manufacturing?
>
> Also, is there a recommended approach for handling boards with missing
> product information in the EEPROM to ensure reliable automatic device
> tree selection?
>
Is specialized equipment needed to pulldown the WP pin on these boards,
or would a common office paperclip (and a steady hand) do it?
In other examples we've just invented some reasonable-sounding product
ID and stuck that into the logic. Particularly several Milk-V
product-lines had wrong EEPROM values and majority of their sales
through a vendor that would swap product models without informing the
customer, and Pine64 shipped non-programmed EEPROM on early
manufacturing run of Star64 boards. There's several of the StarFive
JH-7110 SoC -having boards by third party (not StarFive) where the
manufacturer uses the same EEPROM product ID as the StarFive VisionFive
2 1.3b reference board even though the hardware is widely different.
With a steady hand and a paperclip...:
https://freeshell.de/e/riscv64/vf2eeprom/
...it's not too much trouble to pulldown the WP leg of that IC part on
the board and write a new product ID to EEPROM. For the integrated
products like Pine64 PineTab-V however it may require specialized
equipment and/or significant risk of physical damage to the product to
get access to the WP pin of EEPROM IC part.
Something I intend to do and haven't yet is a bare-minimum dts for
JH-7110 SoC -having boards which has just enough functionality to write
new EEPROM values and SPL fastboot by default through the on-SoC USB
interface. Currently in respect for an abundance of caution to prevent
data corruption and hardware breakage if the EEPROM ID does not match it
does not continue to boot. However, not being able to continue to boot
with a non-valid EEPROM also makes this software then useless for
updating EEPROM... so the way it is postured currently is that vendor
BSP is recommended for EEPROM setting actions. This is not a solved
problem in my opinion and it would be welcome to have a general document
that describes this.
>> Changes in v2:
>> - Consolidate additional common U-Boot properties into
>> spacemit-k1-u-boot.dtsi.
>> - Reduce duplication in the board-specific DTSI files.
>> - Retain board-specific configuration where required.
>>
>
> This current series is incomplete, I missed few code cnages
> But I am working on a few changes to fix
>
> Please review the DTS changes and share your feedback.
>
> Thanks
> -Anand
A note about spacemit-k1-u-boot.dtsi it does generally look good however
the per-board property overrides (as determined by Linux upstream
organization) should go in per-board -u-boot.dtsi files. When device
tree changes get merged in Linux upstream for e.g. bootph-pre-ram hints
or prior to being a proper cherry-pick in U-Boot then it's so much less
confusing if there is a 1:to:1 relationship between upstream where/when
something is merged and then looking at U-Boot to figure out if/when it
can be safely deleted as being redundant. I haven't looked at the K1
dtsi with much attention but I trust you're aware of this.
Best regards,
-E
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/6] riscv: spacemit: Add GPIO and pinctrl support in SPL
2026-11-25 16:23 ` E Shattow
@ 2026-11-26 6:04 ` Anand Moon
0 siblings, 0 replies; 15+ messages in thread
From: Anand Moon @ 2026-11-26 6:04 UTC (permalink / raw)
To: E Shattow; +Cc: u-boot, Yixun Lan, Zixian Zeng, Hung-Chun Tseng
Hi E Shattow,
Thanks for your feedback,
On Wed, 25 Nov 2026 at 21:53, E Shattow <e@freeshell.de> wrote:
>
> Hi Anand,
>
> On 11/25/26 07:35, Anand Moon wrote:
> > Hi All,
> >
> > +Zixian Zeng
> >
> > On Tue, 24 Nov 2026 at 01:07, Anand Moon <linux.amoon@gmail.com> wrote:
> >>
> >> This series consolidates common U-Boot device tree properties for
> >> SpacemiT K1 boards and enables GPIO and pinctrl support in SPL.
> >>
> >> The device tree changes move common early boot properties into shared
> >> DTSI files, reducing duplication between the Banana Pi BPI-F3 and
> >> MusePi Pro boards.
> >>
> >> The remaining patches add SPL build support for the SpacemiT K1/K3
> >> GPIO and pinctrl drivers and enable these drivers in the K1 SPL
> >> configuration.
> >>
> >> The series consists of six patches:
> >>
> >> 1. Move common K1 U-Boot nodes into a shared DTSI.
> >> 2. Remove redundant MusePi Pro device tree overrides.
> >> 3. Move common K1 U-Boot properties into the shared DTSI.
> >> 4. Add SPL support for the K1/K3 pinctrl driver.
> >> 5. Add SPL support for the K1/K3 GPIO driver.
> >> 6. Enable GPIO and pinctrl support in K1 SPL.
> >>
> > Following the description on the Linux mainline list:
> >
> > [1] https://lore.kernel.org/all/20261123-fix-bpf3-eeprom-v1-1-df8cce6ef2b5@gmail.com/
> >
> > I am currently working on enabling multi-DTB support in U-Boot SPL
> > for SpacemiT K1 boards.
> >
> > While investigating the board detection issue, I noticed that the EEPROM
> > on my Banana Pi BPI-F3 does not contain a Product Name TLV entry.
> >
> > alarm@k1:~$ sudo hexdump -C /sys/bus/i2c/devices/2-0050/eeprom
> > 00000000 54 6c 76 49 6e 66 6f 00 01 00 20 24 06 fe fe fe |TlvInfo... $....|
> > 00000010 d5 52 bd 2a 02 00 02 23 0c 39 38 61 39 63 33 61 |.R.*...#.98a9c3a|
> > 00000020 32 62 64 34 37 fe 04 3b e3 ff bd ff ff ff ff ff |2bd47..;........|
> > 00000030 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
> > *
> > 00000100
> >
> > Although the EEPROM is readable, the missing Product Name TLV entry
> > explains why read_product_name() returns `-ENOENT` (-2), assuming the
> > EEPROM read and validation succeed.
> >
> > Consequently, automatic board detection fails, and U-Boot falls back to
> > CONFIG_DEFAULT_DEVICE_TREE, which may select an incorrect device
> > tree for the target board.
> >
> > Since the SD card-detect GPIO polarity differs between the Banana Pi BPI-F3
> > and MusePi Pro, selecting the incorrect device tree can result in SD
> > card detection
> > and boot failures.
> >
> > The following SPL boot log shows the board detection failure, although
> > DDR initialization completes successfully:
> >
> > ```
> > U-Boot SPL 2026.10-01060-gf3080abcfe92-dirty (Oct 24 2026 - 17:30:03 +0530)
> > Fail to detect board:-2
> > vdd_core, value:900000
> > vdd_1v8, value:1800000
> > vdd_1v8_mmc, value:1800000
> > DDR firmware: [0xc0820900]:0xf0227179, size:0x8d98
> > DDR is ready
> > ```
> > Could you please confirm whether the Product Name TLV entry is
> > expected to be programmed into the EEPROM during manufacturing?
> >
> > Also, is there a recommended approach for handling boards with missing
> > product information in the EEPROM to ensure reliable automatic device
> > tree selection?
> >
>
> Is specialized equipment needed to pulldown the WP pin on these boards,
> or would a common office paperclip (and a steady hand) do it?
>
> In other examples we've just invented some reasonable-sounding product
> ID and stuck that into the logic. Particularly several Milk-V
> product-lines had wrong EEPROM values and majority of their sales
> through a vendor that would swap product models without informing the
> customer, and Pine64 shipped non-programmed EEPROM on early
> manufacturing run of Star64 boards. There's several of the StarFive
> JH-7110 SoC -having boards by third party (not StarFive) where the
> manufacturer uses the same EEPROM product ID as the StarFive VisionFive
> 2 1.3b reference board even though the hardware is widely different.
> With a steady hand and a paperclip...:
>
> https://freeshell.de/e/riscv64/vf2eeprom/
>
> ...it's not too much trouble to pulldown the WP leg of that IC part on
> the board and write a new product ID to EEPROM. For the integrated
> products like Pine64 PineTab-V however it may require specialized
> equipment and/or significant risk of physical damage to the product to
> get access to the WP pin of EEPROM IC part.
>
> Something I intend to do and haven't yet is a bare-minimum dts for
> JH-7110 SoC -having boards which has just enough functionality to write
> new EEPROM values and SPL fastboot by default through the on-SoC USB
> interface. Currently in respect for an abundance of caution to prevent
> data corruption and hardware breakage if the EEPROM ID does not match it
> does not continue to boot. However, not being able to continue to boot
> with a non-valid EEPROM also makes this software then useless for
> updating EEPROM... so the way it is postured currently is that vendor
> BSP is recommended for EEPROM setting actions. This is not a solved
> problem in my opinion and it would be welcome to have a general document
> that describes this.
Ok I see the issue, with a few boards like: StarFive VisionFive2 (V1)
and Milk-V Mars CM
which fail to boot once I updated the u-boot and image to SPI flash
a long time ago.
>
> >> Changes in v2:
> >> - Consolidate additional common U-Boot properties into
> >> spacemit-k1-u-boot.dtsi.
> >> - Reduce duplication in the board-specific DTSI files.
> >> - Retain board-specific configuration where required.
> >>
> >
> > This current series is incomplete, I missed few code cnages
> > But I am working on a few changes to fix
> >
> > Please review the DTS changes and share your feedback.
> >
> > Thanks
> > -Anand
>
> A note about spacemit-k1-u-boot.dtsi it does generally look good however
> the per-board property overrides (as determined by Linux upstream
> organization) should go in per-board -u-boot.dtsi files. When device
> tree changes get merged in Linux upstream for e.g. bootph-pre-ram hints
> or prior to being a proper cherry-pick in U-Boot then it's so much less
> confusing if there is a 1:to:1 relationship between upstream where/when
> something is merged and then looking at U-Boot to figure out if/when it
> can be safely deleted as being redundant. I haven't looked at the K1
> dtsi with much attention but I trust you're aware of this.
>
Thanks for the feedback. I understand the importance of maintaining
a one-to-one relationship between the upstream Linux device trees and
the corresponding U-Boot device tree overrides.
I have identified a few additional changes required in spacemit-k1-u-boot.dtsi,
along with changes to the clock driver and Binman configuration to
support SPL booting.
My intention is to upstream the required `bootph-pre-ram` properties
and missing regulator names to the Linux device trees.
Once these changes are merged and synchronized with U-Boot, the redundant
board-specific overrides can be removed, potentially eliminating the need for
per-board `-u-boot.dtsi` files.
For now, I will keep the board-specific property overrides in their respective
-u-boot.dtsi files and retain only the common properties in
spacemit-k1-u-boot.dtsi.
I will address these changes in the next revision of the series.
> Best regards,
>
> -E
Thanks
-Anand
^ permalink raw reply [flat|nested] 15+ messages in thread