This series adds pinctrl, GPIO, and SPI NOR flash support for the SpacemiT K1. Drivers are usable in both SPL and U-Boot proper. In SPL, the QSPI controller and SPI NOR flash are probed during early init, and the SPL boot device is changed from memory-mapped NOR to SPI so the common loader reads the next-stage image from NOR. It sits on top of the K1 SPL bring-up series [1], which depends on the K1 clock/reset/dts migration series [4].
>From v2 I am taking over this submission from Raymond Mao, and have re-authored some of the patches. v1 is at [2]. To apply on origin/master, two prerequisite series on lore must be applied first, in this order: 1. K1 clock/reset/dts migration [4] (8 patches) 2. K1 SPL bring-up v4 [1] (14 patches) 3. This series (9 patches) For each series: b4 am <cover-msgid> git am ./*.mbx The full stack (already in apply order) is at [3]. BR, Guodong Xu Link: https://lore.kernel.org/u-boot/[email protected]/ [1] Link: https://lore.kernel.org/u-boot/[email protected]/ [2] Link: https://github.com/docularxu/u-boot/tree/b4/k1-spl-pinctrl-spinor-v2 [3] Link: https://lore.kernel.org/u-boot/20260510-b4-k1-clk-reset-upstream-dts-v1-0-db0b0503e...@riscstar.com/ [4] Dropped or absorbed from v1, seven v1 patches are not in v2: Five touched the local arch/riscv/dts/k1*.dts that [1] removed in the OF_UPSTREAM move. The upstream K1 dts already provides the pinctrl includes and the qspi@d420c000 node: - v1 3/16 "dts: k1: fix gpio ranges" - v1 4/16 "dts: k1: import pinctrl dts file from upstream folder" - v1 5/16 "dts: k1: remove embedded subnode in pin configs" - v1 10/16 "dts: k1: add QSPI controller support" - v1 16/16 "spacemit: k1: rename device tree prefix from k1- to k1_" Absorbed into SPL series v4 [1]: - v1 13/16 "spacemit: k1: append RISCV_MMODE_TIMERBASE" - v1 15/16 "spacemit: k1: Add support for mmc regulator initialization" No new patches in v2. Changes in v2 (vs v1): - Drop the seven patches above. - Patch 4/9, "spl: k1: enable SPI NOR flash detection and boot" (v1 11/16): - Adds QSPI controller and flash node to k1-musepi-pro-u-boot.dtsi with bootph-pre-ram markers, - switches default DT to k1-musepi-pro, and calls nor_early_init() from SPL. - Patch 6/9 "spacemit: k1: Add multiple device tree support" (v1 14/16): - Reworked to use binman --fit-multi-config so u-boot.itb packs - multiple board DTs. - Patch 8/9 "gpio: add gpio driver for Spacemit K1 SoC" (v1 1/16): - Add .request/.rfree ops delegating to pinctrl; - xlate() uses gpio_flags_xlate(). - Patch 9/9 "configs: k1: enable pinctrl and gpio" (v1 6/16): - Also enable CONFIG_CLK and CONFIG_CLK_CCF for U-Boot proper. Link to v1: https://lore.kernel.org/u-boot/[email protected]/ Signed-off-by: Guodong Xu <[email protected]> --- Guodong Xu (3): spl: k1: enable SPI NOR flash detection and boot spacemit: k1: Add multiple device tree support configs: k1: enable pinctrl and gpio Raymond Mao (6): mtd: spi: select SPL_SPI_FLASH_TINY in SPL stage mtd: spi: enable spi_nor_remove() in soft reset config spi: fsl: add support for Spacemit K1 SoC riscv: binman: Always set default configuration in FIT image pinctrl: add pinctrl driver for Spacemit K1 SoC gpio: add gpio driver for Spacemit K1 SoC arch/riscv/dts/binman.dtsi | 2 - arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 273 +++++++++++++++ board/spacemit/k1/MAINTAINERS | 3 + board/spacemit/k1/spl.c | 56 +++- configs/spacemit_k1_defconfig | 35 +- drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/spacemit_gpio.c | 253 ++++++++++++++ drivers/mtd/spi/Makefile | 5 +- drivers/mtd/spi/sf_probe.c | 8 +- drivers/pinctrl/Kconfig | 1 + drivers/pinctrl/Makefile | 1 + drivers/pinctrl/spacemit/Kconfig | 9 + drivers/pinctrl/spacemit/Makefile | 2 + drivers/pinctrl/spacemit/pinctrl-k1.c | 550 +++++++++++++++++++++++++++++++ drivers/spi/fsl_qspi.c | 9 + 16 files changed, 1201 insertions(+), 15 deletions(-) --- base-commit: ba87dd05ec82c06673e98ea50d84cf062798af6e change-id: 20260519-b4-k1-spl-pinctrl-spinor-c66649702a95 Best regards, -- Guodong Xu <[email protected]>

