* [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board
@ 2026-10-07 5:11 Yixun Lan
2026-10-07 5:11 ` [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX Yixun Lan
` (5 more replies)
0 siblings, 6 replies; 14+ messages in thread
From: Yixun Lan @ 2026-10-07 5:11 UTC (permalink / raw)
To: u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow, Yixun Lan
Add initial support for SpacemiT K3 Pico-ITX board, the config file
will enable all basic components which make it able to run into U-Boot
serial console.
The series actually depend on previous sent patches, I'm not adding
dependency to this series, but list it here for reference.
Pinctrl:
https://patch.msgid.link/20260923-01-k3-pinctrl-support-v2-0-e76a917ee252@kernel.org
GPIO:
https://patch.msgid.link/20260822-01-gpio-pinctrl-support-v1-1-6be2f4c71c5d@kernel.org
clock and reset:
https://patch.msgid.link/20260923-01-k3-clock-reset-support-v2-0-6ec0abb1c7b5@kernel.org
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
Changes in v4:
- update doc
- add separate binman.dtsi file
- Link to v3: https://patch.msgid.link/20261003-00-basic-spacemit-k3-v3-0-dea68cd1bd7d@kernel.org
Changes in v3:
- rename header and dtsi file with vendor prefix
- Link to v2: https://patch.msgid.link/20261002-00-basic-spacemit-k3-v2-0-fd6779a0317c@kernel.org
Changes in v2:
- drop board_get_usable_ram_top()
- drop empty source file
- Link to v1: https://patch.msgid.link/20260923-00-basic-spacemit-k3-v1-0-fa1015f2cd1b@kernel.org
---
Yixun Lan (4):
board: spacemit: add SpacemiT K3 Pico-ITX
riscv: dts: spacemit: k3: add binman node
configs: spacemit: Add K3 default configuration
doc: spacemit: k3: Add Pico-ITX board
arch/riscv/Kconfig | 5 +
arch/riscv/cpu/k3/Kconfig | 18 +++
arch/riscv/cpu/k3/Makefile | 5 +
arch/riscv/cpu/k3/dram.c | 21 ++++
arch/riscv/dts/spacemit-k3-binman.dtsi | 6 +
arch/riscv/dts/spacemit-k3-u-boot.dtsi | 6 +
board/spacemit/k3/Kconfig | 30 +++++
board/spacemit/k3/MAINTAINERS | 8 ++
configs/spacemit_k3_defconfig | 51 ++++++++
doc/board/spacemit/index.rst | 1 +
doc/board/spacemit/spacemit-pico-itx.rst | 200 +++++++++++++++++++++++++++++++
include/configs/spacemit-k3.h | 13 ++
12 files changed, 364 insertions(+)
---
base-commit: cf615aafae36fc49f55e3e6a3648d29201b26d51
change-id: 20260921-00-basic-spacemit-k3-838119645d39
Best regards,
--
Yixun Lan <dlan@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
@ 2026-10-07 5:11 ` Yixun Lan
2026-10-07 10:51 ` E Shattow
2026-10-07 5:11 ` [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node Yixun Lan
` (4 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Yixun Lan @ 2026-10-07 5:11 UTC (permalink / raw)
To: u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow, Yixun Lan
Add initial support for K3 Pico-ITX board, in this version, the DRAM
information is parsed from DTS "/memory" node. And with UART enabled,
the U-Boot serial console works fine now.
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
arch/riscv/Kconfig | 5 +++++
arch/riscv/cpu/k3/Kconfig | 18 ++++++++++++++++++
arch/riscv/cpu/k3/Makefile | 5 +++++
arch/riscv/cpu/k3/dram.c | 21 +++++++++++++++++++++
board/spacemit/k3/Kconfig | 30 ++++++++++++++++++++++++++++++
board/spacemit/k3/MAINTAINERS | 8 ++++++++
include/configs/spacemit-k3.h | 13 +++++++++++++
7 files changed, 100 insertions(+)
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c1b2890f1f3..386241efd4a 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -53,6 +53,9 @@ config TARGET_SIPEED_MAIX
config TARGET_SPACEMIT_K1
bool "Support Spacemit K1 SoC"
+config TARGET_SPACEMIT_K3
+ bool "Support SpacemiT K3 SoC"
+
config TARGET_STARFIVE_VISIONFIVE2
bool "Support StarFive VisionFive2 Board"
select BOARD_LATE_INIT
@@ -124,6 +127,7 @@ source "board/sophgo/milkv_duo/Kconfig"
source "board/sophgo/milkv_duo_256m/Kconfig"
source "board/sophgo/licheerv_nano/Kconfig"
source "board/spacemit/k1/Kconfig"
+source "board/spacemit/k3/Kconfig"
source "board/starfive/visionfive2/Kconfig"
source "board/thead/th1520_lpi4a/Kconfig"
source "board/xilinx/mbv/Kconfig"
@@ -138,6 +142,7 @@ source "arch/riscv/cpu/mpfs/Kconfig"
source "arch/riscv/cpu/generic/Kconfig"
source "arch/riscv/cpu/jh7110/Kconfig"
source "arch/riscv/cpu/k1/Kconfig"
+source "arch/riscv/cpu/k3/Kconfig"
source "arch/riscv/cpu/k230/Kconfig"
source "arch/riscv/cpu/th1520/Kconfig"
diff --git a/arch/riscv/cpu/k3/Kconfig b/arch/riscv/cpu/k3/Kconfig
new file mode 100644
index 00000000000..5474ac11243
--- /dev/null
+++ b/arch/riscv/cpu/k3/Kconfig
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+
+if TARGET_SPACEMIT_K3
+
+config SPACEMIT_K3
+ bool
+ select BINMAN
+ select ARCH_EARLY_INIT_R
+ select SYS_CACHE_SHIFT_6
+ imply CPU
+ imply CPU_RISCV
+ imply RISCV_TIMER if RISCV_SMODE
+ imply CMD_CPU
+ imply OF_UPSTREAM
+
+endif
diff --git a/arch/riscv/cpu/k3/Makefile b/arch/riscv/cpu/k3/Makefile
new file mode 100644
index 00000000000..fba4e4b0a3f
--- /dev/null
+++ b/arch/riscv/cpu/k3/Makefile
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+
+obj-y += dram.o
diff --git a/arch/riscv/cpu/k3/dram.c b/arch/riscv/cpu/k3/dram.c
new file mode 100644
index 00000000000..e20d35dc1bf
--- /dev/null
+++ b/arch/riscv/cpu/k3/dram.c
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+ */
+
+#include <fdtdec.h>
+#include <init.h>
+#include <linux/sizes.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+ return fdtdec_setup_mem_size_base();
+}
+
+int dram_init_banksize(void)
+{
+ return fdtdec_setup_memory_banksize();
+}
diff --git a/board/spacemit/k3/Kconfig b/board/spacemit/k3/Kconfig
new file mode 100644
index 00000000000..1a63c73b6bb
--- /dev/null
+++ b/board/spacemit/k3/Kconfig
@@ -0,0 +1,30 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+
+if TARGET_SPACEMIT_K3
+
+config SYS_BOARD
+ default "k3"
+
+config SYS_VENDOR
+ default "spacemit"
+
+config SYS_CPU
+ default "k3"
+
+config SYS_CONFIG_NAME
+ default "spacemit-k3"
+
+config TEXT_BASE
+ default 0x102000000
+
+config SPL_OPENSBI_LOAD_ADDR
+ hex
+ default 0x100000000
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select SPACEMIT_K3
+
+endif
diff --git a/board/spacemit/k3/MAINTAINERS b/board/spacemit/k3/MAINTAINERS
new file mode 100644
index 00000000000..34cf1ed4453
--- /dev/null
+++ b/board/spacemit/k3/MAINTAINERS
@@ -0,0 +1,8 @@
+SPACEMIT K3
+M: Yixun Lan <dlan@kernel.org>
+S: Maintained
+F: arch/riscv/cpu/k3/
+F: board/spacemit/k3/
+F: configs/spacemit_k3_defconfig
+F: include/configs/k3.h
+F: arch/riscv/dts/k3-u-boot.dtsi
diff --git a/include/configs/spacemit-k3.h b/include/configs/spacemit-k3.h
new file mode 100644
index 00000000000..9dd545e2a3b
--- /dev/null
+++ b/include/configs/spacemit-k3.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+ */
+
+#ifndef __SPACEMIT_K3_H
+#define __SPACEMIT_K3_H
+
+#define CFG_SYS_NS16550_IER 0x40
+
+#define RISCV_SMODE_TIMER_FREQ 24000000
+
+#endif /* __SPACEMIT_K3_H */
--
2.56.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
2026-10-07 5:11 ` [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX Yixun Lan
@ 2026-10-07 5:11 ` Yixun Lan
2026-10-07 9:59 ` E Shattow
2026-10-07 5:11 ` [PATCH v4 3/4] configs: spacemit: Add K3 default configuration Yixun Lan
` (3 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Yixun Lan @ 2026-10-07 5:11 UTC (permalink / raw)
To: u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow, Yixun Lan
SpacemiT K3 follow the standard riscv binman layout, which has opensbi
and U-Boot proper, so include the common binman dtsi file.
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
arch/riscv/dts/spacemit-k3-binman.dtsi | 6 ++++++
arch/riscv/dts/spacemit-k3-u-boot.dtsi | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/arch/riscv/dts/spacemit-k3-binman.dtsi b/arch/riscv/dts/spacemit-k3-binman.dtsi
new file mode 100644
index 00000000000..f1c1c3ee6fd
--- /dev/null
+++ b/arch/riscv/dts/spacemit-k3-binman.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+ */
+
+#include "binman.dtsi"
diff --git a/arch/riscv/dts/spacemit-k3-u-boot.dtsi b/arch/riscv/dts/spacemit-k3-u-boot.dtsi
new file mode 100644
index 00000000000..352e85e7de8
--- /dev/null
+++ b/arch/riscv/dts/spacemit-k3-u-boot.dtsi
@@ -0,0 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+ OR MIT
+/*
+ * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
+ */
+
+#include "spacemit-k3-binman.dtsi"
--
2.56.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 3/4] configs: spacemit: Add K3 default configuration
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
2026-10-07 5:11 ` [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX Yixun Lan
2026-10-07 5:11 ` [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node Yixun Lan
@ 2026-10-07 5:11 ` Yixun Lan
2026-10-07 9:51 ` E Shattow
2026-10-07 5:11 ` [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board Yixun Lan
` (2 subsequent siblings)
5 siblings, 1 reply; 14+ messages in thread
From: Yixun Lan @ 2026-10-07 5:11 UTC (permalink / raw)
To: u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow, Yixun Lan
Add the default configuration for SpacemiT K3 boards, using the
Pico-ITX device tree as the default.
Configure U-Boot to run in RISC-V supervisor mode and enable the
platform clock, reset, GPIO, pinctrl, I2C, PMIC and regulator drivers.
Also configure the memory layout, debug UART and basic filesystem
commands required to boot on the platform.
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
configs/spacemit_k3_defconfig | 51 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 51 insertions(+)
diff --git a/configs/spacemit_k3_defconfig b/configs/spacemit_k3_defconfig
new file mode 100644
index 00000000000..a6d1f35a93e
--- /dev/null
+++ b/configs/spacemit_k3_defconfig
@@ -0,0 +1,51 @@
+CONFIG_RISCV=y
+CONFIG_SYS_MALLOC_LEN=0x1000000
+CONFIG_SYS_MALLOC_F_LEN=0x80000
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x102300000
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="spacemit/k3-pico-itx"
+CONFIG_SYS_BOOTM_LEN=0xa000000
+CONFIG_SYS_LOAD_ADDR=0x102000000
+CONFIG_DEBUG_UART_BASE=0xd4017000
+CONFIG_DEBUG_UART_CLOCK=14700000
+CONFIG_TARGET_SPACEMIT_K3=y
+CONFIG_ARCH_RV64I=y
+CONFIG_CMODEL_MEDANY=y
+CONFIG_RISCV_SMODE=y
+CONFIG_RISCV_ISA_ZICBOM=y
+CONFIG_STACK_SIZE=0x100000
+CONFIG_FIT=y
+CONFIG_SUPPORT_RAW_INITRD=y
+CONFIG_SYS_CBSIZE=256
+CONFIG_SYS_PBSIZE=276
+# CONFIG_BOARD_INIT is not set
+CONFIG_HUSH_PARSER=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_PMIC=y
+CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_FAT=y
+CONFIG_CMD_FS_GENERIC=y
+CONFIG_DEVICE_TREE_INCLUDES="spacemit-k3-u-boot.dtsi"
+CONFIG_SYSCON=y
+CONFIG_CLK_SPACEMIT=y
+CONFIG_CLK_SPACEMIT_K3=y
+CONFIG_SPACEMIT_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_SPACEMIT_K1=y
+CONFIG_MISC=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_SPACEMIT_K1=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_SPACEMIT_P1=y
+CONFIG_DM_REGULATOR=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_DM_REGULATOR_SPACEMIT_P1=y
+CONFIG_DEBUG_UART_NS16550=y
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_SYS_NS16550=y
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_TIMER_EARLY=y
--
2.56.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
` (2 preceding siblings ...)
2026-10-07 5:11 ` [PATCH v4 3/4] configs: spacemit: Add K3 default configuration Yixun Lan
@ 2026-10-07 5:11 ` Yixun Lan
2026-10-07 7:40 ` E Shattow
2026-10-07 11:51 ` [PATCH v4 0/4] riscv: spacemit: Add support for K3 " E Shattow
2026-10-09 7:27 ` Yixun Lan
5 siblings, 1 reply; 14+ messages in thread
From: Yixun Lan @ 2026-10-07 5:11 UTC (permalink / raw)
To: u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow, Yixun Lan
Add documentation for how to test the mainline U-Boot on SpacemiT
K3 Pico-ITX board, currently it still rely on using vendor FSBL.bin
file to initialize DDR and boot U-Boot proper, and the opensbi
firmware is built from an on-going mainline branch.
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
doc/board/spacemit/index.rst | 1 +
doc/board/spacemit/spacemit-pico-itx.rst | 200 +++++++++++++++++++++++++++++++
2 files changed, 201 insertions(+)
diff --git a/doc/board/spacemit/index.rst b/doc/board/spacemit/index.rst
index 71854e5735b..51918f0acc7 100644
--- a/doc/board/spacemit/index.rst
+++ b/doc/board/spacemit/index.rst
@@ -8,4 +8,5 @@ SpacemiT
bananapi-f3
k1-mmc
k1-spl
+ spacemit-pico-itx
diff --git a/doc/board/spacemit/spacemit-pico-itx.rst b/doc/board/spacemit/spacemit-pico-itx.rst
new file mode 100644
index 00000000000..18d11d6671b
--- /dev/null
+++ b/doc/board/spacemit/spacemit-pico-itx.rst
@@ -0,0 +1,200 @@
+.. SPDX-License-Identifier: GPL-2.0-or-later
+
+SpacemiT K3 Pico-ITX
+====================
+
+Building
+~~~~~~~~
+1. Add a RISC-V toolchain to your PATH
+
+2. Setup cross compilation environment variable:
+
+ .. code-block:: console
+
+ export CROSS_COMPILE=<riscv64 toolchain prefix>
+
+3. U-Boot for SpacemiT K3 SoC requires OpenSBI in-development generic
+platform object fw_dynamic.bin to be included in the Flattened Image
+Tree blob. OpenSBI may be first built as below:
+
+ .. code-block:: console
+
+ # Clone OpenSBI fork sources with K3 specific patches
+ git clone https://github.com/spacemit-com/opensbi-upstream opensbi
+ cd opensbi
+ make PLATFORM=generic
+
+4. Then build U-Boot as following:
+
+ .. code-block:: console
+
+ cd <U-Boot-dir>
+ make spacemit_k3_defconfig
+ make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin
+
+This will generate u-boot.itb
+
+Testing
+~~~~~~~
+Currently there is no U-Boot SPL build target. It is required to use 'FSBL.bin' vendor
+board support package SPL for DDR initialization and testing u-boot.itb. Please test with
+fastboot command via USB download.
+
+First, retrieve Bianbu Linux image from archive_ and extract the FSBL.bin firmware.
+
+Second, hold the FEL button of Pico-ITX board, then press reset button and release it .
+The board will enter into firmware download mode.
+
+ .. code-block:: none
+
+ sys: 0x10001200
+ bm:2
+ usb_init : enter 3296,3072
+ usb_core_init : enter
+ DWC3_GRXTHRCFG:0x4400000
+ ROM: usb download handler
+ rst
+ done H
+ setup= 0x1000680 0x400000,
+ rst
+ done H
+ setup= 0x290500 0x0,
+ setup= 0x1000680 0x120000,
+ setup= 0x2000680 0x90000,
+ setup= 0x2000680 0x200000,
+ setup= 0x3000680 0xff0000,
+ setup= 0x3020680 0xff0409,
+ setup= 0x3010680 0xff0409,
+ setup= 0x10900 0x0,
+ usb_rx_bytes : start len[4096]
+ setup= 0x3020680 0xff0409,
+ setup= 0x3040680 0xff0409,
+
+Run following command to test:
+
+ .. code-block:: console
+
+ fastboot stage FSBL.bin
+ fastboot continue
+ sleep 10
+ fastboot stage u-boot.itb
+ fastboot continue
+
+.. _archive: https://archive.spacemit.com/image/k3/version/bianbu/v4.0.7/
+.. _uboot: https://bianbu-linux.spacemit.com/en/device/boot#21-firmware-layout
+
+Booting
+~~~~~~~
+Sample boot log
+~~~~~~~~~~~~~~~
+ .. code-block:: none
+
+ sys: 0x10001200
+ bm:2
+ usb_init : enter 3296,3072
+ usb_core_init : enter
+ DWC3_GRXTHRCFG:0x4400000
+ ROM: usb download handler
+ rst
+ done H
+ setup= 0x1000680 0x400000,
+ rst
+ done H
+ setup= 0x2f0500 0x0,
+ setup= 0x1000680 0x120000,
+ setup= 0x2000680 0x90000,
+ setup= 0x2000680 0x200000,
+ setup= 0x3000680 0xff0000,
+ setup= 0x3020680 0xff0409,
+ setup= 0x3010680 0xff0409,
+ setup= 0x10900 0x0,
+ usb_rx_bytes : start len[4096]
+ setup= 0x3020680 0xff0409,
+ setup= 0x3040680 0xff0409,
+ fastboot_handle_command: max-download-size
+ usb_tx_bytes : start len[14]
+ usb_rx_bytes : start len[4096]
+ fastboot_handle_command: 00072b20
+ Starting download of 469792 bytes
+ usb_tx_bytes : start len[12]
+ usb_rx_bytes : start len[469792]
+ usb_tx_bytes : start len[4]
+ usb_rx_bytes : start len[4096]
+ fastboot_handle_command: continue
+ usb_tx_bytes : start len[4]
+ j...
+ U-Boot SPL 2022.10 (Sep 07 2026 - 11:31:13 +0000)
+ LPDDR5 total size: 16 GB, data rate: 6400 MT/s
+ DDR training consume 5625ms
+ ..
+ OpenSBI v1.9-72-g13a401f8
+ ____ _____ ____ _____
+ / __ \ / ____| _ \_ _|
+ | | | |_ __ ___ _ __ | (___ | |_) || |
+ | | | | '_ \ / _ \ '_ \ \___ \| _ < | |
+ | |__| | |_) | __/ | | |____) | |_) || |_
+ \____/| .__/ \___|_| |_|_____/|____/_____|
+ | |
+ |_|
+ Platform Name : SpacemiT K3 Pico-ITX
+ Platform Features : medeleg
+ Platform HART Count : 8
+ Platform HART Protection : pmp
+ Platform IPI Device : aclint-mswi
+ Platform Timer Device : aclint-mtimer @ 24000000Hz
+ Platform Console Device : uart8250
+ Platform HSM Device : spacemit-k3-hsm
+ Platform PMU Device : ---
+ Platform Reboot Device : spacemit-p1-reset
+ Platform Shutdown Device : spacemit-p1-reset
+ Platform Suspend Device : ---
+ Platform CPPC Device : ---
+ Firmware Base : 0x100000000
+ Firmware Size : 416 KB
+ Firmware RW Offset : 0x40000
+ Firmware RW Size : 160 KB
+ Firmware Heap Offset : 0x57000
+ Firmware Heap Size : 68 KB (total), 1 KB (reserved), 14 KB (used), 52 KB (free)
+ Firmware Scratch Size : 4096 B (total), 1472 B (used), 2624 B (free)
+ Runtime SBI Version : 3.0
+ Standard SBI Extensions : time,rfnc,ipi,base,hsm,srst,pmu,dbcn,fwft,legacy,dbtr,sse
+ Experimental SBI Extensions : none
+ Domain0 Name : root
+ Domain0 Init Order : 0xffffffff
+ Domain0 Boot HART : 0
+ Domain0 HARTs : 0x0*,0x1*,0x2*,0x3*,0x4*,0x5*,0x6*,0x7*
+ Domain0 Region00 : 0x0000000100000000-0x000000010003ffff M: (F,R,X) S/U: ()
+ Domain0 Region01 : 0x0000000100040000-0x000000010007ffff M: (F,R,W) S/U: ()
+ Domain0 Region02 : 0x00000000d4017000-0x00000000d4017fff M: (I,R,W) S/U: (R,W)
+ Domain0 Region03 : 0x00000000e081c000-0x00000000e081ffff M: (I,R,W) S/U: ()
+ Domain0 Region04 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
+ Domain0 Next Address : 0x0000000102000000
+ Domain0 Next Arg1 : 0x0000000102091398
+ Domain0 Next Mode : S-mode
+ Domain0 SysReset : yes
+ Domain0 SysSuspend : yes
+ Boot HART ID : 0
+ Boot HART Domain : root
+ Boot HART Priv Version : v1.12
+ Boot HART Base ISA : rv64imafdcbvhx
+ Boot HART ISA Extensions : smaia,smstateen,sscofpmf,sstc,zicntr,zihpm,smcntrpmf,zicboz,zicbom,svpbmt,sdtrig,svade,ssstateen,v,f,d
+ Boot HART PMP Count : 16
+ Boot HART PMP Granularity : 12 bits
+ Boot HART PMP Address Bits : 38
+ Boot HART MHPM Info : 16 (0x0007fff8)
+ Boot HART Debug Triggers : 4 triggers
+ Boot HART MIDELEG : 0x0000000000003666
+ Boot HART MEDELEG : 0x0000000000f0b509
+
+ <debug_uart>
+
+ U-Boot 2026.10-rc4-00501-g9fba7b59df42 (Sep 22 2026 - 13:08:33 +0000)
+
+ DRAM: 16 GiB
+ Core: 433 devices, 15 uclasses, devicetree: separate
+ Loading Environment from nowhere...Loading Environment from nowhere... OK
+ In: serial@d4017000
+ Out: serial@d4017000
+ Err: serial@d4017000
+ Net: No ethernet found.
+ =>
--
2.56.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board
2026-10-07 5:11 ` [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board Yixun Lan
@ 2026-10-07 7:40 ` E Shattow
0 siblings, 0 replies; 14+ messages in thread
From: E Shattow @ 2026-10-07 7:40 UTC (permalink / raw)
To: Yixun Lan, u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
On 10/6/26 22:11, Yixun Lan wrote:
> Add documentation for how to test the mainline U-Boot on SpacemiT
> K3 Pico-ITX board, currently it still rely on using vendor FSBL.bin
> file to initialize DDR and boot U-Boot proper, and the opensbi
> firmware is built from an on-going mainline branch.
>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> doc/board/spacemit/index.rst | 1 +
> doc/board/spacemit/spacemit-pico-itx.rst | 200 +++++++++++++++++++++++++++++++
> 2 files changed, 201 insertions(+)
>
> diff --git a/doc/board/spacemit/index.rst b/doc/board/spacemit/index.rst
> index 71854e5735b..51918f0acc7 100644
> --- a/doc/board/spacemit/index.rst
> +++ b/doc/board/spacemit/index.rst
> @@ -8,4 +8,5 @@ SpacemiT
> bananapi-f3
> k1-mmc
> k1-spl
> + spacemit-pico-itx
>
> diff --git a/doc/board/spacemit/spacemit-pico-itx.rst b/doc/board/spacemit/spacemit-pico-itx.rst
> new file mode 100644
> index 00000000000..18d11d6671b
> --- /dev/null
> +++ b/doc/board/spacemit/spacemit-pico-itx.rst
> @@ -0,0 +1,200 @@
> +.. SPDX-License-Identifier: GPL-2.0-or-later
> +
> +SpacemiT K3 Pico-ITX
> +====================
> +
> +Building
> +~~~~~~~~
> +1. Add a RISC-V toolchain to your PATH
> +
> +2. Setup cross compilation environment variable:
> +
> + .. code-block:: console
> +
> + export CROSS_COMPILE=<riscv64 toolchain prefix>
> +
> +3. U-Boot for SpacemiT K3 SoC requires OpenSBI in-development generic
> +platform object fw_dynamic.bin to be included in the Flattened Image
> +Tree blob. OpenSBI may be first built as below:
> +
> + .. code-block:: console
> +
> + # Clone OpenSBI fork sources with K3 specific patches
> + git clone https://github.com/spacemit-com/opensbi-upstream opensbi
> + cd opensbi
> + make PLATFORM=generic
> +
> +4. Then build U-Boot as following:
> +
> + .. code-block:: console
> +
> + cd <U-Boot-dir>
> + make spacemit_k3_defconfig
> + make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin
> +
> +This will generate u-boot.itb
> +
> +Testing
> +~~~~~~~
> +Currently there is no U-Boot SPL build target. It is required to use 'FSBL.bin' vendor
> +board support package SPL for DDR initialization and testing u-boot.itb. Please test with
> +fastboot command via USB download.
> +
> +First, retrieve Bianbu Linux image from archive_ and extract the FSBL.bin firmware.
> +
> +Second, hold the FEL button of Pico-ITX board, then press reset button and release it .
> +The board will enter into firmware download mode.
> +
> + .. code-block:: none
> +
> + sys: 0x10001200
> + bm:2
> + usb_init : enter 3296,3072
> + usb_core_init : enter
> + DWC3_GRXTHRCFG:0x4400000
> + ROM: usb download handler
> + rst
> + done H
> + setup= 0x1000680 0x400000,
> + rst
> + done H
> + setup= 0x290500 0x0,
> + setup= 0x1000680 0x120000,
> + setup= 0x2000680 0x90000,
> + setup= 0x2000680 0x200000,
> + setup= 0x3000680 0xff0000,
> + setup= 0x3020680 0xff0409,
> + setup= 0x3010680 0xff0409,
> + setup= 0x10900 0x0,
> + usb_rx_bytes : start len[4096]
> + setup= 0x3020680 0xff0409,
> + setup= 0x3040680 0xff0409,
> +
> +Run following command to test:
> +
> + .. code-block:: console
> +
> + fastboot stage FSBL.bin
> + fastboot continue
> + sleep 10
> + fastboot stage u-boot.itb
> + fastboot continue
> +
> +.. _archive: https://archive.spacemit.com/image/k3/version/bianbu/v4.0.7/
> +.. _uboot: https://bianbu-linux.spacemit.com/en/device/boot#21-firmware-layout
> +
> +Booting
> +~~~~~~~
> +Sample boot log
> +~~~~~~~~~~~~~~~
> + .. code-block:: none
> +
> + sys: 0x10001200
> + bm:2
> + usb_init : enter 3296,3072
> + usb_core_init : enter
> + DWC3_GRXTHRCFG:0x4400000
> + ROM: usb download handler
> + rst
> + done H
> + setup= 0x1000680 0x400000,
> + rst
> + done H
> + setup= 0x2f0500 0x0,
> + setup= 0x1000680 0x120000,
> + setup= 0x2000680 0x90000,
> + setup= 0x2000680 0x200000,
> + setup= 0x3000680 0xff0000,
> + setup= 0x3020680 0xff0409,
> + setup= 0x3010680 0xff0409,
> + setup= 0x10900 0x0,
> + usb_rx_bytes : start len[4096]
> + setup= 0x3020680 0xff0409,
> + setup= 0x3040680 0xff0409,
> + fastboot_handle_command: max-download-size
> + usb_tx_bytes : start len[14]
> + usb_rx_bytes : start len[4096]
> + fastboot_handle_command: 00072b20
> + Starting download of 469792 bytes
> + usb_tx_bytes : start len[12]
> + usb_rx_bytes : start len[469792]
> + usb_tx_bytes : start len[4]
> + usb_rx_bytes : start len[4096]
> + fastboot_handle_command: continue
> + usb_tx_bytes : start len[4]
> + j...
> + U-Boot SPL 2022.10 (Sep 07 2026 - 11:31:13 +0000)
> + LPDDR5 total size: 16 GB, data rate: 6400 MT/s
> + DDR training consume 5625ms
> + ..
> + OpenSBI v1.9-72-g13a401f8
> + ____ _____ ____ _____
> + / __ \ / ____| _ \_ _|
> + | | | |_ __ ___ _ __ | (___ | |_) || |
> + | | | | '_ \ / _ \ '_ \ \___ \| _ < | |
> + | |__| | |_) | __/ | | |____) | |_) || |_
> + \____/| .__/ \___|_| |_|_____/|____/_____|
> + | |
> + |_|
> + Platform Name : SpacemiT K3 Pico-ITX
> + Platform Features : medeleg
> + Platform HART Count : 8
> + Platform HART Protection : pmp
> + Platform IPI Device : aclint-mswi
> + Platform Timer Device : aclint-mtimer @ 24000000Hz
> + Platform Console Device : uart8250
> + Platform HSM Device : spacemit-k3-hsm
> + Platform PMU Device : ---
> + Platform Reboot Device : spacemit-p1-reset
> + Platform Shutdown Device : spacemit-p1-reset
> + Platform Suspend Device : ---
> + Platform CPPC Device : ---
> + Firmware Base : 0x100000000
> + Firmware Size : 416 KB
> + Firmware RW Offset : 0x40000
> + Firmware RW Size : 160 KB
> + Firmware Heap Offset : 0x57000
> + Firmware Heap Size : 68 KB (total), 1 KB (reserved), 14 KB (used), 52 KB (free)
> + Firmware Scratch Size : 4096 B (total), 1472 B (used), 2624 B (free)
> + Runtime SBI Version : 3.0
> + Standard SBI Extensions : time,rfnc,ipi,base,hsm,srst,pmu,dbcn,fwft,legacy,dbtr,sse
> + Experimental SBI Extensions : none
> + Domain0 Name : root
> + Domain0 Init Order : 0xffffffff
> + Domain0 Boot HART : 0
> + Domain0 HARTs : 0x0*,0x1*,0x2*,0x3*,0x4*,0x5*,0x6*,0x7*
> + Domain0 Region00 : 0x0000000100000000-0x000000010003ffff M: (F,R,X) S/U: ()
> + Domain0 Region01 : 0x0000000100040000-0x000000010007ffff M: (F,R,W) S/U: ()
> + Domain0 Region02 : 0x00000000d4017000-0x00000000d4017fff M: (I,R,W) S/U: (R,W)
> + Domain0 Region03 : 0x00000000e081c000-0x00000000e081ffff M: (I,R,W) S/U: ()
> + Domain0 Region04 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
> + Domain0 Next Address : 0x0000000102000000
> + Domain0 Next Arg1 : 0x0000000102091398
> + Domain0 Next Mode : S-mode
> + Domain0 SysReset : yes
> + Domain0 SysSuspend : yes
> + Boot HART ID : 0
> + Boot HART Domain : root
> + Boot HART Priv Version : v1.12
> + Boot HART Base ISA : rv64imafdcbvhx
> + Boot HART ISA Extensions : smaia,smstateen,sscofpmf,sstc,zicntr,zihpm,smcntrpmf,zicboz,zicbom,svpbmt,sdtrig,svade,ssstateen,v,f,d
> + Boot HART PMP Count : 16
> + Boot HART PMP Granularity : 12 bits
> + Boot HART PMP Address Bits : 38
> + Boot HART MHPM Info : 16 (0x0007fff8)
> + Boot HART Debug Triggers : 4 triggers
> + Boot HART MIDELEG : 0x0000000000003666
> + Boot HART MEDELEG : 0x0000000000f0b509
> +
> + <debug_uart>
> +
> + U-Boot 2026.10-rc4-00501-g9fba7b59df42 (Sep 22 2026 - 13:08:33 +0000)
> +
> + DRAM: 16 GiB
> + Core: 433 devices, 15 uclasses, devicetree: separate
> + Loading Environment from nowhere...Loading Environment from nowhere... OK
> + In: serial@d4017000
> + Out: serial@d4017000
> + Err: serial@d4017000
> + Net: No ethernet found.
> + =>
>
Reviewed-by: E Shattow <e@freeshell.de>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 3/4] configs: spacemit: Add K3 default configuration
2026-10-07 5:11 ` [PATCH v4 3/4] configs: spacemit: Add K3 default configuration Yixun Lan
@ 2026-10-07 9:51 ` E Shattow
2026-10-09 6:28 ` Yixun Lan
0 siblings, 1 reply; 14+ messages in thread
From: E Shattow @ 2026-10-07 9:51 UTC (permalink / raw)
To: Yixun Lan, u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
On 10/6/26 22:11, Yixun Lan wrote:
> Add the default configuration for SpacemiT K3 boards, using the
> Pico-ITX device tree as the default.
>
> Configure U-Boot to run in RISC-V supervisor mode and enable the
> platform clock, reset, GPIO, pinctrl, I2C, PMIC and regulator drivers.
> Also configure the memory layout, debug UART and basic filesystem
> commands required to boot on the platform.
>
> Reviewed-by: E Shattow <e@freeshell.de>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> configs/spacemit_k3_defconfig | 51 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 51 insertions(+)
>
> diff --git a/configs/spacemit_k3_defconfig b/configs/spacemit_k3_defconfig
> new file mode 100644
> index 00000000000..a6d1f35a93e
> --- /dev/null
> +++ b/configs/spacemit_k3_defconfig
> @@ -0,0 +1,51 @@
> +CONFIG_RISCV=y
> +CONFIG_SYS_MALLOC_LEN=0x1000000
> +CONFIG_SYS_MALLOC_F_LEN=0x80000
> +CONFIG_NR_DRAM_BANKS=2
> +CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
> +CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x102300000
> +CONFIG_DM_GPIO=y
> +CONFIG_DEFAULT_DEVICE_TREE="spacemit/k3-pico-itx"
> +CONFIG_SYS_BOOTM_LEN=0xa000000
> +CONFIG_SYS_LOAD_ADDR=0x102000000
> +CONFIG_DEBUG_UART_BASE=0xd4017000
> +CONFIG_DEBUG_UART_CLOCK=14700000
> +CONFIG_TARGET_SPACEMIT_K3=y
> +CONFIG_ARCH_RV64I=y
> +CONFIG_CMODEL_MEDANY=y
> +CONFIG_RISCV_SMODE=y
> +CONFIG_RISCV_ISA_ZICBOM=y
> +CONFIG_STACK_SIZE=0x100000
> +CONFIG_FIT=y
> +CONFIG_SUPPORT_RAW_INITRD=y
> +CONFIG_SYS_CBSIZE=256
> +CONFIG_SYS_PBSIZE=276
> +# CONFIG_BOARD_INIT is not set
> +CONFIG_HUSH_PARSER=y
> +CONFIG_CMD_GPIO=y
> +CONFIG_CMD_I2C=y
> +CONFIG_CMD_PMIC=y
> +CONFIG_CMD_REGULATOR=y
> +CONFIG_CMD_FAT=y
> +CONFIG_CMD_FS_GENERIC=y
> +CONFIG_DEVICE_TREE_INCLUDES="spacemit-k3-u-boot.dtsi"
> +CONFIG_SYSCON=y
> +CONFIG_CLK_SPACEMIT=y
> +CONFIG_CLK_SPACEMIT_K3=y
> +CONFIG_SPACEMIT_GPIO=y
> +CONFIG_DM_I2C=y
> +CONFIG_SYS_I2C_SPACEMIT_K1=y
> +CONFIG_MISC=y
> +CONFIG_PINCTRL=y
> +CONFIG_PINCTRL_SPACEMIT_K1=y
> +CONFIG_DM_PMIC=y
> +CONFIG_PMIC_SPACEMIT_P1=y
> +CONFIG_DM_REGULATOR=y
> +CONFIG_DM_REGULATOR_FIXED=y
> +CONFIG_DM_REGULATOR_SPACEMIT_P1=y
> +CONFIG_DEBUG_UART_NS16550=y
> +CONFIG_DEBUG_UART_SHIFT=2
> +CONFIG_DEBUG_UART_ANNOUNCE=y
> +CONFIG_SYS_NS16550=y
> +CONFIG_SYS_NS16550_MEM32=y
> +CONFIG_TIMER_EARLY=y
>
On condition of patch dependencies applied as outlined in the cover
letter to provide PINCTRL_SPACEMIT_K1 SPACEMIT_GPIO (implied
RESET_SPACEMIT_K3) CLK_SPACEMIT_K3 ; With that,
Reviewed-by: E Shattow <e@freeshell.de>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node
2026-10-07 5:11 ` [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node Yixun Lan
@ 2026-10-07 9:59 ` E Shattow
0 siblings, 0 replies; 14+ messages in thread
From: E Shattow @ 2026-10-07 9:59 UTC (permalink / raw)
To: Yixun Lan, u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
On 10/6/26 22:11, Yixun Lan wrote:
> SpacemiT K3 follow the standard riscv binman layout, which has opensbi
> and U-Boot proper, so include the common binman dtsi file.
>
> Reviewed-by: E Shattow <e@freeshell.de>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> arch/riscv/dts/spacemit-k3-binman.dtsi | 6 ++++++
> arch/riscv/dts/spacemit-k3-u-boot.dtsi | 6 ++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/arch/riscv/dts/spacemit-k3-binman.dtsi b/arch/riscv/dts/spacemit-k3-binman.dtsi
> new file mode 100644
> index 00000000000..f1c1c3ee6fd
> --- /dev/null
> +++ b/arch/riscv/dts/spacemit-k3-binman.dtsi
> @@ -0,0 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0+ OR MIT
> +/*
> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> + */
> +
> +#include "binman.dtsi"
> diff --git a/arch/riscv/dts/spacemit-k3-u-boot.dtsi b/arch/riscv/dts/spacemit-k3-u-boot.dtsi
> new file mode 100644
> index 00000000000..352e85e7de8
> --- /dev/null
> +++ b/arch/riscv/dts/spacemit-k3-u-boot.dtsi
> @@ -0,0 +1,6 @@
> +// SPDX-License-Identifier: GPL-2.0+ OR MIT
> +/*
> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> + */
> +
> +#include "spacemit-k3-binman.dtsi"
>
Thanks Yixun for preparing this,
Reviewed-by: E Shattow <e@freeshell.de>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX
2026-10-07 5:11 ` [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX Yixun Lan
@ 2026-10-07 10:51 ` E Shattow
2026-10-09 6:26 ` Yixun Lan
0 siblings, 1 reply; 14+ messages in thread
From: E Shattow @ 2026-10-07 10:51 UTC (permalink / raw)
To: Yixun Lan, u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
Hi Yixun, we should refresh MAINTAINERS such as file rename and added
changes requested are now settled. Keep R-by tag from me on the refresh
if there's no v5 before merge, thanks!
On 10/6/26 22:11, Yixun Lan wrote:
> Add initial support for K3 Pico-ITX board, in this version, the DRAM
> information is parsed from DTS "/memory" node. And with UART enabled,
> the U-Boot serial console works fine now.
>
> Reviewed-by: E Shattow <e@freeshell.de>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> arch/riscv/Kconfig | 5 +++++
> arch/riscv/cpu/k3/Kconfig | 18 ++++++++++++++++++
> arch/riscv/cpu/k3/Makefile | 5 +++++
> arch/riscv/cpu/k3/dram.c | 21 +++++++++++++++++++++
> board/spacemit/k3/Kconfig | 30 ++++++++++++++++++++++++++++++
> board/spacemit/k3/MAINTAINERS | 8 ++++++++
> include/configs/spacemit-k3.h | 13 +++++++++++++
> 7 files changed, 100 insertions(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index c1b2890f1f3..386241efd4a 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -53,6 +53,9 @@ config TARGET_SIPEED_MAIX
> config TARGET_SPACEMIT_K1
> bool "Support Spacemit K1 SoC"
>
> +config TARGET_SPACEMIT_K3
> + bool "Support SpacemiT K3 SoC"
> +
> config TARGET_STARFIVE_VISIONFIVE2
> bool "Support StarFive VisionFive2 Board"
> select BOARD_LATE_INIT
> @@ -124,6 +127,7 @@ source "board/sophgo/milkv_duo/Kconfig"
> source "board/sophgo/milkv_duo_256m/Kconfig"
> source "board/sophgo/licheerv_nano/Kconfig"
> source "board/spacemit/k1/Kconfig"
> +source "board/spacemit/k3/Kconfig"
> source "board/starfive/visionfive2/Kconfig"
> source "board/thead/th1520_lpi4a/Kconfig"
> source "board/xilinx/mbv/Kconfig"
> @@ -138,6 +142,7 @@ source "arch/riscv/cpu/mpfs/Kconfig"
> source "arch/riscv/cpu/generic/Kconfig"
> source "arch/riscv/cpu/jh7110/Kconfig"
> source "arch/riscv/cpu/k1/Kconfig"
> +source "arch/riscv/cpu/k3/Kconfig"
> source "arch/riscv/cpu/k230/Kconfig"
> source "arch/riscv/cpu/th1520/Kconfig"
>
> diff --git a/arch/riscv/cpu/k3/Kconfig b/arch/riscv/cpu/k3/Kconfig
> new file mode 100644
> index 00000000000..5474ac11243
> --- /dev/null
> +++ b/arch/riscv/cpu/k3/Kconfig
> @@ -0,0 +1,18 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> +
> +if TARGET_SPACEMIT_K3
> +
> +config SPACEMIT_K3
> + bool
> + select BINMAN
> + select ARCH_EARLY_INIT_R
> + select SYS_CACHE_SHIFT_6
> + imply CPU
> + imply CPU_RISCV
> + imply RISCV_TIMER if RISCV_SMODE
> + imply CMD_CPU
> + imply OF_UPSTREAM
> +
> +endif
> diff --git a/arch/riscv/cpu/k3/Makefile b/arch/riscv/cpu/k3/Makefile
> new file mode 100644
> index 00000000000..fba4e4b0a3f
> --- /dev/null
> +++ b/arch/riscv/cpu/k3/Makefile
> @@ -0,0 +1,5 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> +
> +obj-y += dram.o
> diff --git a/arch/riscv/cpu/k3/dram.c b/arch/riscv/cpu/k3/dram.c
> new file mode 100644
> index 00000000000..e20d35dc1bf
> --- /dev/null
> +++ b/arch/riscv/cpu/k3/dram.c
> @@ -0,0 +1,21 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> + */
> +
> +#include <fdtdec.h>
> +#include <init.h>
> +#include <linux/sizes.h>
> +#include <asm/global_data.h>
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +int dram_init(void)
> +{
> + return fdtdec_setup_mem_size_base();
> +}
> +
> +int dram_init_banksize(void)
> +{
> + return fdtdec_setup_memory_banksize();
> +}
> diff --git a/board/spacemit/k3/Kconfig b/board/spacemit/k3/Kconfig
> new file mode 100644
> index 00000000000..1a63c73b6bb
> --- /dev/null
> +++ b/board/spacemit/k3/Kconfig
> @@ -0,0 +1,30 @@
> +# SPDX-License-Identifier: GPL-2.0-or-later
> +#
> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> +
> +if TARGET_SPACEMIT_K3
> +
> +config SYS_BOARD
> + default "k3"
> +
> +config SYS_VENDOR
> + default "spacemit"
> +
> +config SYS_CPU
> + default "k3"
> +
> +config SYS_CONFIG_NAME
> + default "spacemit-k3"
> +
> +config TEXT_BASE
> + default 0x102000000
> +
> +config SPL_OPENSBI_LOAD_ADDR
> + hex
> + default 0x100000000
> +
> +config BOARD_SPECIFIC_OPTIONS
> + def_bool y
> + select SPACEMIT_K3
> +
> +endif
> diff --git a/board/spacemit/k3/MAINTAINERS b/board/spacemit/k3/MAINTAINERS
> new file mode 100644
> index 00000000000..34cf1ed4453
> --- /dev/null
> +++ b/board/spacemit/k3/MAINTAINERS
> @@ -0,0 +1,8 @@
> +SPACEMIT K3
> +M: Yixun Lan <dlan@kernel.org>
> +S: Maintained
> +F: arch/riscv/cpu/k3/
> +F: board/spacemit/k3/
> +F: configs/spacemit_k3_defconfig
> +F: include/configs/k3.h
-F: include/configs/k3.h
+F: include/configs/spacemit-k3.h
> +F: arch/riscv/dts/k3-u-boot.dtsi
-F: arch/riscv/dts/k3-u-boot.dtsi
+F: arch/riscv/dts/spacemit-k3-binman.dtsi
+F: arch/riscv/dts/spacemit-k3-u-boot.dtsi
Note aside that K1 dtsi are listed in source tree root MAINTAINERS,
which is probably needing to be changed separately and follow the
example of per-board like you are doing here for K3. We are missing
something in per-board MAINTAINERS here for
doc/board/spacemit/spacemit-pico-itx.rst and it could be added here or
not, it is matching anyways by the source tree root MAINTAINERS on
'spacemit' search.
Other modified files (with required dependency patches applied) for our
reference:
not applicable arch/riscv/Kconfig
drivers/clk/spacemit/Kconfig
drivers/clk/spacemit/Makefile
drivers/clk/spacemit/clk-k3.c
drivers/clk/spacemit/clk_common.h
drivers/clk/spacemit/clk_mix.c
drivers/clk/spacemit/clk_mix.h
drivers/clk/spacemit/clk_pll.c
drivers/clk/spacemit/clk_pll.h
drivers/gpio/Kconfig
drivers/gpio/spacemit_gpio.c
not applicable drivers/reset/Kconfig
not applicable drivers/reset/Makefile
drivers/reset/spacemit/Kconfig
drivers/reset/spacemit/Makefile
drivers/reset/spacemit/reset-spacemit-common.c
drivers/reset/spacemit/reset-spacemit-common.h
drivers/reset/spacemit/reset-spacemit-k1.c
drivers/reset/spacemit/reset-spacemit-k3.c
include/soc/spacemit/k3-reset.h
include/soc/spacemit/k3-syscon.h
With the expectation that those drivers' patches are to be merged
in-order before this K3 Pico-ITX series, I think this all makes good
sense, and all dependency series will be covered by source tree root
MAINTAINERS on 'spacemit' search.
> diff --git a/include/configs/spacemit-k3.h b/include/configs/spacemit-k3.h
> new file mode 100644
> index 00000000000..9dd545e2a3b
> --- /dev/null
> +++ b/include/configs/spacemit-k3.h
> @@ -0,0 +1,13 @@
> +/* SPDX-License-Identifier: GPL-2.0-or-later */
> +/*
> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> + */
> +
> +#ifndef __SPACEMIT_K3_H
> +#define __SPACEMIT_K3_H
> +
> +#define CFG_SYS_NS16550_IER 0x40
> +
> +#define RISCV_SMODE_TIMER_FREQ 24000000
> +
> +#endif /* __SPACEMIT_K3_H */
>
Reviewed-by: E Shattow <e@freeshell.de>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
` (3 preceding siblings ...)
2026-10-07 5:11 ` [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board Yixun Lan
@ 2026-10-07 11:51 ` E Shattow
2026-10-09 7:27 ` Yixun Lan
5 siblings, 0 replies; 14+ messages in thread
From: E Shattow @ 2026-10-07 11:51 UTC (permalink / raw)
To: Yixun Lan, u-boot
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
On 10/6/26 22:11, Yixun Lan wrote:
> Add initial support for SpacemiT K3 Pico-ITX board, the config file
> will enable all basic components which make it able to run into U-Boot
> serial console.
>
> The series actually depend on previous sent patches, I'm not adding
> dependency to this series, but list it here for reference.
>
> Pinctrl:
> https://patch.msgid.link/20260923-01-k3-pinctrl-support-v2-0-e76a917ee252@kernel.org
>
> GPIO:
> https://patch.msgid.link/20260822-01-gpio-pinctrl-support-v1-1-6be2f4c71c5d@kernel.org
>
> clock and reset:
> https://patch.msgid.link/20260923-01-k3-clock-reset-support-v2-0-6ec0abb1c7b5@kernel.org
>
> Signed-off-by: Yixun Lan <dlan@kernel.org>
> ---
> Changes in v4:
> - update doc
> - add separate binman.dtsi file
> - Link to v3: https://patch.msgid.link/20261003-00-basic-spacemit-k3-v3-0-dea68cd1bd7d@kernel.org
>
> Changes in v3:
> - rename header and dtsi file with vendor prefix
> - Link to v2: https://patch.msgid.link/20261002-00-basic-spacemit-k3-v2-0-fd6779a0317c@kernel.org
>
> Changes in v2:
> - drop board_get_usable_ram_top()
> - drop empty source file
> - Link to v1: https://patch.msgid.link/20260923-00-basic-spacemit-k3-v1-0-fa1015f2cd1b@kernel.org
>
> ---
> Yixun Lan (4):
> board: spacemit: add SpacemiT K3 Pico-ITX
> riscv: dts: spacemit: k3: add binman node
> configs: spacemit: Add K3 default configuration
> doc: spacemit: k3: Add Pico-ITX board
>
> arch/riscv/Kconfig | 5 +
> arch/riscv/cpu/k3/Kconfig | 18 +++
> arch/riscv/cpu/k3/Makefile | 5 +
> arch/riscv/cpu/k3/dram.c | 21 ++++
> arch/riscv/dts/spacemit-k3-binman.dtsi | 6 +
> arch/riscv/dts/spacemit-k3-u-boot.dtsi | 6 +
> board/spacemit/k3/Kconfig | 30 +++++
> board/spacemit/k3/MAINTAINERS | 8 ++
> configs/spacemit_k3_defconfig | 51 ++++++++
> doc/board/spacemit/index.rst | 1 +
> doc/board/spacemit/spacemit-pico-itx.rst | 200 +++++++++++++++++++++++++++++++
> include/configs/spacemit-k3.h | 13 ++
> 12 files changed, 364 insertions(+)
> ---
> base-commit: cf615aafae36fc49f55e3e6a3648d29201b26d51
> change-id: 20260921-00-basic-spacemit-k3-838119645d39
>
> Best regards,
> --
> Yixun Lan <dlan@kernel.org>
>
Looking forward to this series being merged :)
FYI after the merge I will coordinate to adopt any devicetree-rebasing
cherry-pick and -u-boot.dtsi overrides that are needed. When there will
be an SPI NOR driver and "sf" SPI flash command then we have all
components for using mainline u-boot 'u-boot.itb' as a board recovery
tool with uart and network download methods. The devicetree nodes for
this should be easy to adopt. I can write some documentation about
compiling and flashing the vendor board support package firmware using
mainline u-boot 'u-boot.itb', and eventually mainline SPL too when that
may be possible.
Cheers,
-E
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX
2026-10-07 10:51 ` E Shattow
@ 2026-10-09 6:26 ` Yixun Lan
2026-10-09 9:08 ` E Shattow
0 siblings, 1 reply; 14+ messages in thread
From: Yixun Lan @ 2026-10-09 6:26 UTC (permalink / raw)
To: E Shattow
Cc: u-boot, Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
Hi E Shattow,
On 03:51 Wed 07 Oct , E Shattow wrote:
> Hi Yixun, we should refresh MAINTAINERS such as file rename and added
> changes requested are now settled. Keep R-by tag from me on the refresh
> if there's no v5 before merge, thanks!
>
Ok, I will no send a new version, since it's really minor changes
> On 10/6/26 22:11, Yixun Lan wrote:
> > Add initial support for K3 Pico-ITX board, in this version, the DRAM
> > information is parsed from DTS "/memory" node. And with UART enabled,
> > the U-Boot serial console works fine now.
> >
> > Reviewed-by: E Shattow <e@freeshell.de>
> > Signed-off-by: Yixun Lan <dlan@kernel.org>
> > ---
> > arch/riscv/Kconfig | 5 +++++
> > arch/riscv/cpu/k3/Kconfig | 18 ++++++++++++++++++
> > arch/riscv/cpu/k3/Makefile | 5 +++++
> > arch/riscv/cpu/k3/dram.c | 21 +++++++++++++++++++++
> > board/spacemit/k3/Kconfig | 30 ++++++++++++++++++++++++++++++
> > board/spacemit/k3/MAINTAINERS | 8 ++++++++
> > include/configs/spacemit-k3.h | 13 +++++++++++++
> > 7 files changed, 100 insertions(+)
> >
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index c1b2890f1f3..386241efd4a 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -53,6 +53,9 @@ config TARGET_SIPEED_MAIX
> > config TARGET_SPACEMIT_K1
> > bool "Support Spacemit K1 SoC"
> >
> > +config TARGET_SPACEMIT_K3
> > + bool "Support SpacemiT K3 SoC"
> > +
> > config TARGET_STARFIVE_VISIONFIVE2
> > bool "Support StarFive VisionFive2 Board"
> > select BOARD_LATE_INIT
> > @@ -124,6 +127,7 @@ source "board/sophgo/milkv_duo/Kconfig"
> > source "board/sophgo/milkv_duo_256m/Kconfig"
> > source "board/sophgo/licheerv_nano/Kconfig"
> > source "board/spacemit/k1/Kconfig"
> > +source "board/spacemit/k3/Kconfig"
> > source "board/starfive/visionfive2/Kconfig"
> > source "board/thead/th1520_lpi4a/Kconfig"
> > source "board/xilinx/mbv/Kconfig"
> > @@ -138,6 +142,7 @@ source "arch/riscv/cpu/mpfs/Kconfig"
> > source "arch/riscv/cpu/generic/Kconfig"
> > source "arch/riscv/cpu/jh7110/Kconfig"
> > source "arch/riscv/cpu/k1/Kconfig"
> > +source "arch/riscv/cpu/k3/Kconfig"
> > source "arch/riscv/cpu/k230/Kconfig"
> > source "arch/riscv/cpu/th1520/Kconfig"
> >
> > diff --git a/arch/riscv/cpu/k3/Kconfig b/arch/riscv/cpu/k3/Kconfig
> > new file mode 100644
> > index 00000000000..5474ac11243
> > --- /dev/null
> > +++ b/arch/riscv/cpu/k3/Kconfig
> > @@ -0,0 +1,18 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +#
> > +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> > +
> > +if TARGET_SPACEMIT_K3
> > +
> > +config SPACEMIT_K3
> > + bool
> > + select BINMAN
> > + select ARCH_EARLY_INIT_R
> > + select SYS_CACHE_SHIFT_6
> > + imply CPU
> > + imply CPU_RISCV
> > + imply RISCV_TIMER if RISCV_SMODE
> > + imply CMD_CPU
> > + imply OF_UPSTREAM
> > +
> > +endif
> > diff --git a/arch/riscv/cpu/k3/Makefile b/arch/riscv/cpu/k3/Makefile
> > new file mode 100644
> > index 00000000000..fba4e4b0a3f
> > --- /dev/null
> > +++ b/arch/riscv/cpu/k3/Makefile
> > @@ -0,0 +1,5 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +#
> > +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> > +
> > +obj-y += dram.o
> > diff --git a/arch/riscv/cpu/k3/dram.c b/arch/riscv/cpu/k3/dram.c
> > new file mode 100644
> > index 00000000000..e20d35dc1bf
> > --- /dev/null
> > +++ b/arch/riscv/cpu/k3/dram.c
> > @@ -0,0 +1,21 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> > +/*
> > + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> > + */
> > +
> > +#include <fdtdec.h>
> > +#include <init.h>
> > +#include <linux/sizes.h>
> > +#include <asm/global_data.h>
> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> > +int dram_init(void)
> > +{
> > + return fdtdec_setup_mem_size_base();
> > +}
> > +
> > +int dram_init_banksize(void)
> > +{
> > + return fdtdec_setup_memory_banksize();
> > +}
> > diff --git a/board/spacemit/k3/Kconfig b/board/spacemit/k3/Kconfig
> > new file mode 100644
> > index 00000000000..1a63c73b6bb
> > --- /dev/null
> > +++ b/board/spacemit/k3/Kconfig
> > @@ -0,0 +1,30 @@
> > +# SPDX-License-Identifier: GPL-2.0-or-later
> > +#
> > +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> > +
> > +if TARGET_SPACEMIT_K3
> > +
> > +config SYS_BOARD
> > + default "k3"
> > +
> > +config SYS_VENDOR
> > + default "spacemit"
> > +
> > +config SYS_CPU
> > + default "k3"
> > +
> > +config SYS_CONFIG_NAME
> > + default "spacemit-k3"
> > +
> > +config TEXT_BASE
> > + default 0x102000000
> > +
> > +config SPL_OPENSBI_LOAD_ADDR
> > + hex
> > + default 0x100000000
> > +
> > +config BOARD_SPECIFIC_OPTIONS
> > + def_bool y
> > + select SPACEMIT_K3
> > +
> > +endif
> > diff --git a/board/spacemit/k3/MAINTAINERS b/board/spacemit/k3/MAINTAINERS
> > new file mode 100644
> > index 00000000000..34cf1ed4453
> > --- /dev/null
> > +++ b/board/spacemit/k3/MAINTAINERS
> > @@ -0,0 +1,8 @@
> > +SPACEMIT K3
> > +M: Yixun Lan <dlan@kernel.org>
> > +S: Maintained
> > +F: arch/riscv/cpu/k3/
> > +F: board/spacemit/k3/
> > +F: configs/spacemit_k3_defconfig
> > +F: include/configs/k3.h
>
> -F: include/configs/k3.h
> +F: include/configs/spacemit-k3.h
>
> > +F: arch/riscv/dts/k3-u-boot.dtsi
>
> -F: arch/riscv/dts/k3-u-boot.dtsi
> +F: arch/riscv/dts/spacemit-k3-binman.dtsi
> +F: arch/riscv/dts/spacemit-k3-u-boot.dtsi
>
> Note aside that K1 dtsi are listed in source tree root MAINTAINERS,
> which is probably needing to be changed separately and follow the
> example of per-board like you are doing here for K3. We are missing
> something in per-board MAINTAINERS here for
> doc/board/spacemit/spacemit-pico-itx.rst and it could be added here or
> not, it is matching anyways by the source tree root MAINTAINERS on
> 'spacemit' search.
>
> Other modified files (with required dependency patches applied) for our
> reference:
>
> not applicable arch/riscv/Kconfig
> drivers/clk/spacemit/Kconfig
> drivers/clk/spacemit/Makefile
> drivers/clk/spacemit/clk-k3.c
> drivers/clk/spacemit/clk_common.h
> drivers/clk/spacemit/clk_mix.c
> drivers/clk/spacemit/clk_mix.h
> drivers/clk/spacemit/clk_pll.c
> drivers/clk/spacemit/clk_pll.h
> drivers/gpio/Kconfig
> drivers/gpio/spacemit_gpio.c
> not applicable drivers/reset/Kconfig
> not applicable drivers/reset/Makefile
> drivers/reset/spacemit/Kconfig
> drivers/reset/spacemit/Makefile
> drivers/reset/spacemit/reset-spacemit-common.c
> drivers/reset/spacemit/reset-spacemit-common.h
> drivers/reset/spacemit/reset-spacemit-k1.c
> drivers/reset/spacemit/reset-spacemit-k3.c
> include/soc/spacemit/k3-reset.h
> include/soc/spacemit/k3-syscon.h
>
> With the expectation that those drivers' patches are to be merged
> in-order before this K3 Pico-ITX series, I think this all makes good
> sense, and all dependency series will be covered by source tree root
> MAINTAINERS on 'spacemit' search.
>
Ok, I will do some adjustment for the file name, maybe only keep
the K3 specific files..
But, I'd rather not bother to add all the files which already covered by
'spacemit' keyword imply with the top MAINTAINERS file, it would simplify
the file list a bit..
> > diff --git a/include/configs/spacemit-k3.h b/include/configs/spacemit-k3.h
> > new file mode 100644
> > index 00000000000..9dd545e2a3b
> > --- /dev/null
> > +++ b/include/configs/spacemit-k3.h
> > @@ -0,0 +1,13 @@
> > +/* SPDX-License-Identifier: GPL-2.0-or-later */
> > +/*
> > + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
> > + */
> > +
> > +#ifndef __SPACEMIT_K3_H
> > +#define __SPACEMIT_K3_H
> > +
> > +#define CFG_SYS_NS16550_IER 0x40
> > +
> > +#define RISCV_SMODE_TIMER_FREQ 24000000
> > +
> > +#endif /* __SPACEMIT_K3_H */
> >
>
> Reviewed-by: E Shattow <e@freeshell.de>
Thanks for the review
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 3/4] configs: spacemit: Add K3 default configuration
2026-10-07 9:51 ` E Shattow
@ 2026-10-09 6:28 ` Yixun Lan
0 siblings, 0 replies; 14+ messages in thread
From: Yixun Lan @ 2026-10-09 6:28 UTC (permalink / raw)
To: E Shattow
Cc: u-boot, Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
Hi E Shatto,
On 02:51 Wed 07 Oct , E Shattow wrote:
> On 10/6/26 22:11, Yixun Lan wrote:
> > Add the default configuration for SpacemiT K3 boards, using the
> > Pico-ITX device tree as the default.
> >
> > Configure U-Boot to run in RISC-V supervisor mode and enable the
> > platform clock, reset, GPIO, pinctrl, I2C, PMIC and regulator drivers.
> > Also configure the memory layout, debug UART and basic filesystem
> > commands required to boot on the platform.
> >
> > Reviewed-by: E Shattow <e@freeshell.de>
> > Signed-off-by: Yixun Lan <dlan@kernel.org>
> > ---
> > configs/spacemit_k3_defconfig | 51 +++++++++++++++++++++++++++++++++++++++++++
> > 1 file changed, 51 insertions(+)
> >
...
>
> On condition of patch dependencies applied as outlined in the cover
> letter to provide PINCTRL_SPACEMIT_K1 SPACEMIT_GPIO (implied
> RESET_SPACEMIT_K3) CLK_SPACEMIT_K3 ; With that,
>
Yes, I've checked, it's all correct, no worry
> Reviewed-by: E Shattow <e@freeshell.de>
--
Yixun Lan (dlan)
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
` (4 preceding siblings ...)
2026-10-07 11:51 ` [PATCH v4 0/4] riscv: spacemit: Add support for K3 " E Shattow
@ 2026-10-09 7:27 ` Yixun Lan
5 siblings, 0 replies; 14+ messages in thread
From: Yixun Lan @ 2026-10-09 7:27 UTC (permalink / raw)
To: u-boot, Yixun Lan
Cc: Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu, E Shattow
On Wed, 07 Oct 2026 05:11:30 +0000, Yixun Lan wrote:
> Add initial support for SpacemiT K3 Pico-ITX board, the config file
> will enable all basic components which make it able to run into U-Boot
> serial console.
>
> The series actually depend on previous sent patches, I'm not adding
> dependency to this series, but list it here for reference.
>
> [...]
Applied, thanks!
[1/4] board: spacemit: add SpacemiT K3 Pico-ITX
https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/31d3bdb0e37d568e951f6b861999c8e9e7132b40
[2/4] riscv: dts: spacemit: k3: add binman node
https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/262a0267b6635eab951c0070229976ba75aedf2d
[3/4] configs: spacemit: Add K3 default configuration
https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/d56972c3f331de89e19a4c6d21ea2a53416f84db
[4/4] doc: spacemit: k3: Add Pico-ITX board
https://git.u-boot-project.org/u-boot/custodians/u-boot-spacemit/-/commit/ee7bd2529853076ca717a5cf61ec232992fdfa58
Best regards,
--
Yixun Lan <dlan@kernel.org>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX
2026-10-09 6:26 ` Yixun Lan
@ 2026-10-09 9:08 ` E Shattow
0 siblings, 0 replies; 14+ messages in thread
From: E Shattow @ 2026-10-09 9:08 UTC (permalink / raw)
To: Yixun Lan
Cc: u-boot, Yao Zi, Tim Ouyang, Leo Liang, Tom Rini, Michal Simek,
Raymond Mao, Hiago De Franco, Junhui Liu
Hi Yixun,
On 10/8/26 23:26, Yixun Lan wrote:
> Hi E Shattow,
>
> On 03:51 Wed 07 Oct , E Shattow wrote:
>> Hi Yixun, we should refresh MAINTAINERS such as file rename and added
>> changes requested are now settled. Keep R-by tag from me on the refresh
>> if there's no v5 before merge, thanks!
>>
> Ok, I will no send a new version, since it's really minor changes
>
>> On 10/6/26 22:11, Yixun Lan wrote:
>>> Add initial support for K3 Pico-ITX board, in this version, the DRAM
>>> information is parsed from DTS "/memory" node. And with UART enabled,
>>> the U-Boot serial console works fine now.
>>>
>>> Reviewed-by: E Shattow <e@freeshell.de>
>>> Signed-off-by: Yixun Lan <dlan@kernel.org>
>>> ---
>>> arch/riscv/Kconfig | 5 +++++
>>> arch/riscv/cpu/k3/Kconfig | 18 ++++++++++++++++++
>>> arch/riscv/cpu/k3/Makefile | 5 +++++
>>> arch/riscv/cpu/k3/dram.c | 21 +++++++++++++++++++++
>>> board/spacemit/k3/Kconfig | 30 ++++++++++++++++++++++++++++++
>>> board/spacemit/k3/MAINTAINERS | 8 ++++++++
>>> include/configs/spacemit-k3.h | 13 +++++++++++++
>>> 7 files changed, 100 insertions(+)
>>>
>>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>>> index c1b2890f1f3..386241efd4a 100644
>>> --- a/arch/riscv/Kconfig
>>> +++ b/arch/riscv/Kconfig
>>> @@ -53,6 +53,9 @@ config TARGET_SIPEED_MAIX
>>> config TARGET_SPACEMIT_K1
>>> bool "Support Spacemit K1 SoC"
>>>
>>> +config TARGET_SPACEMIT_K3
>>> + bool "Support SpacemiT K3 SoC"
>>> +
>>> config TARGET_STARFIVE_VISIONFIVE2
>>> bool "Support StarFive VisionFive2 Board"
>>> select BOARD_LATE_INIT
>>> @@ -124,6 +127,7 @@ source "board/sophgo/milkv_duo/Kconfig"
>>> source "board/sophgo/milkv_duo_256m/Kconfig"
>>> source "board/sophgo/licheerv_nano/Kconfig"
>>> source "board/spacemit/k1/Kconfig"
>>> +source "board/spacemit/k3/Kconfig"
>>> source "board/starfive/visionfive2/Kconfig"
>>> source "board/thead/th1520_lpi4a/Kconfig"
>>> source "board/xilinx/mbv/Kconfig"
>>> @@ -138,6 +142,7 @@ source "arch/riscv/cpu/mpfs/Kconfig"
>>> source "arch/riscv/cpu/generic/Kconfig"
>>> source "arch/riscv/cpu/jh7110/Kconfig"
>>> source "arch/riscv/cpu/k1/Kconfig"
>>> +source "arch/riscv/cpu/k3/Kconfig"
>>> source "arch/riscv/cpu/k230/Kconfig"
>>> source "arch/riscv/cpu/th1520/Kconfig"
>>>
>>> diff --git a/arch/riscv/cpu/k3/Kconfig b/arch/riscv/cpu/k3/Kconfig
>>> new file mode 100644
>>> index 00000000000..5474ac11243
>>> --- /dev/null
>>> +++ b/arch/riscv/cpu/k3/Kconfig
>>> @@ -0,0 +1,18 @@
>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>> +#
>>> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
>>> +
>>> +if TARGET_SPACEMIT_K3
>>> +
>>> +config SPACEMIT_K3
>>> + bool
>>> + select BINMAN
>>> + select ARCH_EARLY_INIT_R
>>> + select SYS_CACHE_SHIFT_6
>>> + imply CPU
>>> + imply CPU_RISCV
>>> + imply RISCV_TIMER if RISCV_SMODE
>>> + imply CMD_CPU
>>> + imply OF_UPSTREAM
>>> +
>>> +endif
>>> diff --git a/arch/riscv/cpu/k3/Makefile b/arch/riscv/cpu/k3/Makefile
>>> new file mode 100644
>>> index 00000000000..fba4e4b0a3f
>>> --- /dev/null
>>> +++ b/arch/riscv/cpu/k3/Makefile
>>> @@ -0,0 +1,5 @@
>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>> +#
>>> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
>>> +
>>> +obj-y += dram.o
>>> diff --git a/arch/riscv/cpu/k3/dram.c b/arch/riscv/cpu/k3/dram.c
>>> new file mode 100644
>>> index 00000000000..e20d35dc1bf
>>> --- /dev/null
>>> +++ b/arch/riscv/cpu/k3/dram.c
>>> @@ -0,0 +1,21 @@
>>> +// SPDX-License-Identifier: GPL-2.0-or-later
>>> +/*
>>> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
>>> + */
>>> +
>>> +#include <fdtdec.h>
>>> +#include <init.h>
>>> +#include <linux/sizes.h>
>>> +#include <asm/global_data.h>
>>> +
>>> +DECLARE_GLOBAL_DATA_PTR;
>>> +
>>> +int dram_init(void)
>>> +{
>>> + return fdtdec_setup_mem_size_base();
>>> +}
>>> +
>>> +int dram_init_banksize(void)
>>> +{
>>> + return fdtdec_setup_memory_banksize();
>>> +}
>>> diff --git a/board/spacemit/k3/Kconfig b/board/spacemit/k3/Kconfig
>>> new file mode 100644
>>> index 00000000000..1a63c73b6bb
>>> --- /dev/null
>>> +++ b/board/spacemit/k3/Kconfig
>>> @@ -0,0 +1,30 @@
>>> +# SPDX-License-Identifier: GPL-2.0-or-later
>>> +#
>>> +# Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
>>> +
>>> +if TARGET_SPACEMIT_K3
>>> +
>>> +config SYS_BOARD
>>> + default "k3"
>>> +
>>> +config SYS_VENDOR
>>> + default "spacemit"
>>> +
>>> +config SYS_CPU
>>> + default "k3"
>>> +
>>> +config SYS_CONFIG_NAME
>>> + default "spacemit-k3"
>>> +
>>> +config TEXT_BASE
>>> + default 0x102000000
>>> +
>>> +config SPL_OPENSBI_LOAD_ADDR
>>> + hex
>>> + default 0x100000000
>>> +
>>> +config BOARD_SPECIFIC_OPTIONS
>>> + def_bool y
>>> + select SPACEMIT_K3
>>> +
>>> +endif
>>> diff --git a/board/spacemit/k3/MAINTAINERS b/board/spacemit/k3/MAINTAINERS
>>> new file mode 100644
>>> index 00000000000..34cf1ed4453
>>> --- /dev/null
>>> +++ b/board/spacemit/k3/MAINTAINERS
>>> @@ -0,0 +1,8 @@
>>> +SPACEMIT K3
>>> +M: Yixun Lan <dlan@kernel.org>
>>> +S: Maintained
>>> +F: arch/riscv/cpu/k3/
>>> +F: board/spacemit/k3/
>>> +F: configs/spacemit_k3_defconfig
>>> +F: include/configs/k3.h
>>
>> -F: include/configs/k3.h
>> +F: include/configs/spacemit-k3.h
>>
>>> +F: arch/riscv/dts/k3-u-boot.dtsi
>>
>> -F: arch/riscv/dts/k3-u-boot.dtsi
>> +F: arch/riscv/dts/spacemit-k3-binman.dtsi
>> +F: arch/riscv/dts/spacemit-k3-u-boot.dtsi
>>
>> Note aside that K1 dtsi are listed in source tree root MAINTAINERS,
>> which is probably needing to be changed separately and follow the
>> example of per-board like you are doing here for K3. We are missing
>> something in per-board MAINTAINERS here for
>> doc/board/spacemit/spacemit-pico-itx.rst and it could be added here or
>> not, it is matching anyways by the source tree root MAINTAINERS on
>> 'spacemit' search.
>>
>> Other modified files (with required dependency patches applied) for our
>> reference:
>>
>> not applicable arch/riscv/Kconfig
>> drivers/clk/spacemit/Kconfig
>> drivers/clk/spacemit/Makefile
>> drivers/clk/spacemit/clk-k3.c
>> drivers/clk/spacemit/clk_common.h
>> drivers/clk/spacemit/clk_mix.c
>> drivers/clk/spacemit/clk_mix.h
>> drivers/clk/spacemit/clk_pll.c
>> drivers/clk/spacemit/clk_pll.h
>> drivers/gpio/Kconfig
>> drivers/gpio/spacemit_gpio.c
>> not applicable drivers/reset/Kconfig
>> not applicable drivers/reset/Makefile
>> drivers/reset/spacemit/Kconfig
>> drivers/reset/spacemit/Makefile
>> drivers/reset/spacemit/reset-spacemit-common.c
>> drivers/reset/spacemit/reset-spacemit-common.h
>> drivers/reset/spacemit/reset-spacemit-k1.c
>> drivers/reset/spacemit/reset-spacemit-k3.c
>> include/soc/spacemit/k3-reset.h
>> include/soc/spacemit/k3-syscon.h
>>
>> With the expectation that those drivers' patches are to be merged
>> in-order before this K3 Pico-ITX series, I think this all makes good
>> sense, and all dependency series will be covered by source tree root
>> MAINTAINERS on 'spacemit' search.
>>
> Ok, I will do some adjustment for the file name, maybe only keep
> the K3 specific files..
>
> But, I'd rather not bother to add all the files which already covered by
> 'spacemit' keyword imply with the top MAINTAINERS file, it would simplify
> the file list a bit..
>
Acknowledged, I agree, and thanks. -E
>>> diff --git a/include/configs/spacemit-k3.h b/include/configs/spacemit-k3.h
>>> new file mode 100644
>>> index 00000000000..9dd545e2a3b
>>> --- /dev/null
>>> +++ b/include/configs/spacemit-k3.h
>>> @@ -0,0 +1,13 @@
>>> +/* SPDX-License-Identifier: GPL-2.0-or-later */
>>> +/*
>>> + * Copyright (C) 2026 Yixun Lan <dlan@kernel.org>
>>> + */
>>> +
>>> +#ifndef __SPACEMIT_K3_H
>>> +#define __SPACEMIT_K3_H
>>> +
>>> +#define CFG_SYS_NS16550_IER 0x40
>>> +
>>> +#define RISCV_SMODE_TIMER_FREQ 24000000
>>> +
>>> +#endif /* __SPACEMIT_K3_H */
>>>
>>
>> Reviewed-by: E Shattow <e@freeshell.de>
> Thanks for the review
>
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2026-10-09 9:09 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-07 5:11 [PATCH v4 0/4] riscv: spacemit: Add support for K3 Pico-ITX board Yixun Lan
2026-10-07 5:11 ` [PATCH v4 1/4] board: spacemit: add SpacemiT K3 Pico-ITX Yixun Lan
2026-10-07 10:51 ` E Shattow
2026-10-09 6:26 ` Yixun Lan
2026-10-09 9:08 ` E Shattow
2026-10-07 5:11 ` [PATCH v4 2/4] riscv: dts: spacemit: k3: add binman node Yixun Lan
2026-10-07 9:59 ` E Shattow
2026-10-07 5:11 ` [PATCH v4 3/4] configs: spacemit: Add K3 default configuration Yixun Lan
2026-10-07 9:51 ` E Shattow
2026-10-09 6:28 ` Yixun Lan
2026-10-07 5:11 ` [PATCH v4 4/4] doc: spacemit: k3: Add Pico-ITX board Yixun Lan
2026-10-07 7:40 ` E Shattow
2026-10-07 11:51 ` [PATCH v4 0/4] riscv: spacemit: Add support for K3 " E Shattow
2026-10-09 7:27 ` Yixun Lan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.