Commit Graph
106559 Commits
Author SHA1 Message Date
Tom Rini 72d780b5cc Merge patch series "some string cleanup, and a tweak of the "config" command"
Rasmus Villemoes <rv@rasmusvillemoes.dk> says:

This started by me wanting something like what patch 8 does. That
wasn't too hard, except we had no strcasestr(), and also our regex
engine (which I didn't really want to pull into the mix anyway)
doesn't have a flag that requests case-insensitive matching. So I
wanted to add strcasestr(), but then I stumbled on a bunch of stuff
that should be cleaned up in str-land.

Link: https://lore.kernel.org/r/20260708203711.849489-1-rv@rasmusvillemoes.dk
2026-07-21 13:52:00 -06:00
Rasmus VillemoesandTom Rini d408eb2bc5 test: add test of 'config' command
Add some test cases for the 'config' command, including the ability to
filter the output.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini a2daa32913 doc: document 'config' command
Add a little documentation for the config command and its new ability
to filter the output.

Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini 304e18c943 cmd: config: allow simple filtering of output
When doing development, it can be quite useful to enable
CONFIG_CMD_CONFIG, so that one can always check whether a config knob
one has just enabled has actually made it to target.

Because sometimes, one doesn't flash the right binary, or maybe one
has just done CONFIG_FOO=y in some config fragment, but that had no
effect because one would also have to do CONFIG_BAR=y.

However, 2400+ lines of text are rather hard to read through. One
probably uses a terminal emulator with capturing enabled, but
searching back through the capture file is a little tedious, and one
easily ends up finding something that doesn't pertain to the most
recent 'config' command invocation.

So make it possible to limit the output to those lines containing a
given string. Like the search functionality in menuconfig, make it
case insensitive, because it is much more convenient to type "config
pinctrl" than "config PINCTRL".

Since enabling CONFIG_CMD_CONFIG by itself adds over 10K of data, and
that increases with every U-Boot release even if one doesn't add any
new features to one's own defconfig (because the .config grows lots of
"is not set"), I don't see any point in guarding this by some
CONFIG_CMD_CONFIG_GREP.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini d589aa4417 test: string: add test of new strcasestr() function
Change the existing strstr() test a little so that the substring not
found is "bits", i.e. one that is actually found when doing case
insensitive search.

Then copy all of lib_strstr(), adapt the expectation for the
strcasestr(s1, s3) result, and add another "not found" case.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini 13822d7f42 string: add strcasestr()
While this is not likely needed by any "real" driver code, a later
convenience addition to the "config" command will need this. As usual,
the linker will throw it away if nothing actually uses it, so it
should have no size impact when not used.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini 07fcb18623 string: remove more pointless __HAVE_ARCH_STR*
None of these six macros are defined by any architecture. Moreover,
the ifndef guard only exists in either string.h or string.c, making them
completely pointless.

I'm not sure whether we have an explicit coding style discouraging the
"extern" qualifier on function declarations, and string.h has a random
mix of everything, but I can't leave it on strncasecmp() now that it
will be immediately after strcasecmp() which doesn't have it.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini a31d9375df string: remove unused strswab() function
The last use of this function with rather peculiar semantics[*] vanished
in 2021 with 0a527fda78 ("Fix IDE commands issued, fix endian issues,
fix non MMIO"). It has no tests, and should a need for something
similar ever appear, it is better done with some proper
utf16le/utf16be/utf16 abstractions rather than cluttering code with
'#ifdef __LITTLE_ENDIAN'.

[*] The byte-swapping itself is weird enough. But why is an input string
of odd length ok, while the empty string is not allowed?

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:07 -06:00
Rasmus VillemoesandTom Rini 6b58f877bd string: correct documentation for strstr and strnstr
The len parameter for strnstr() concerns the maximum size of the
haystack to consider, not the length of the needle being searched for.

strstr() obviously has no len parameter, so remove the copy-pasta.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:06 -06:00
Rasmus VillemoesandTom Rini 210fedfcfc string: correct prototype of strchrnul()
Both glibc's (where this originated as a GNU extension) and the
kernel's versions of strchrnul() return "char *", not "const
char *". That also makes it consistent with the standard strchr()
function.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:06 -06:00
Rasmus VillemoesandTom Rini dabdb36163 sh: clean up asm/string.h
First, remove the !__KERNEL__ block, since U-Boot is always compiled
with -D__KERNEL__.

Second, remove the mention of the non-existing file
arch/sh/lib/strcasecmp.c and the redundant declaration of strcasecmp()
If sh did have a strcasecmp.c file, presumably the header would have
had to #define __HAVE_ARCH_STRCASECMP.

Third, remove the explicit #undefs of various __HAVE_ARCH_* and
redundant declarations of standard functions, which are anyway
declared in linux/string.h. In the linux source tree, those are all
#defines, and indeed linux does have asm implementations of those functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
2026-07-21 13:51:06 -06:00
Aristo ChenandTom Rini 85667122fb test: spl: check load_simple_fit() rejects an oversized data-size
Add a regression test that builds a FIT with external data, inflates
the data-size property far beyond the image and any plausible load
region, and confirms that spl_load_simple_fit() returns -EFBIG instead
of reading the declared size off the device. Without the bounds check
in load_simple_fit() this test overruns memory and crashes; with it the
load is rejected cleanly.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-21 13:50:54 -06:00
Aristo ChenandTom Rini 8f71d7170f spl: fit: bound the external data size before reading it
load_simple_fit() loads an image stored as external data by reading
it from the boot device with a transfer sized from the FIT data-size
property. That property is listed in exc_prop[] in image-fit-sig.c,
so it is excluded from the configuration signature and stays under
the control of anyone able to modify the boot medium even when
CONFIG_SPL_FIT_SIGNATURE is enabled. The read happens before
fit_image_verify_with_data() checks the image hash, so an inflated
data-size overruns the destination before the corruption can be
detected. The device-tree overlay path is the sharpest case, because
there the destination is a fixed CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ
heap buffer.

Pass the size of the destination into load_simple_fit() and reject
an image whose data does not fit before the read is issued. The
check is done in two places: an early bail on len > max_size, then a
bail on the block-aligned size > max_size. The size check is the
mathematically binding one because size is len rounded up to the
device block length. The early bail exists so that
get_aligned_image_size() never runs on a hostile len, where its int
arithmetic would invoke signed-integer overflow.

For the overlay path the bound is exact: the caller passes the size
of its temporary buffer. For the firmware, loadables, FDT and FPGA
call sites the destination is wherever the load_addr field points,
with no defined upper limit at the call site. Those callers pass
CONFIG_SYS_BOOTM_LEN as a conservative ceiling, matching the same
limit spl_parse_legacy_validate() already applies to legacy images.
It is not a tight bound on the actual capacity at the destination,
just a cap that rejects implausibly-sized data.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-21 13:50:54 -06:00
Tom Rini f5f06b10e1 Merge tag 'riscv-for-v2026.10-rc1' of https://git.u-boot-project.org/u-boot/custodians/u-boot-riscv
CI: https://git.u-boot-project.org/u-boot/custodians/u-boot-riscv/-/pipelines/676

- Adds support for the SpacemiT K1 and
- Updates the MAINTAINERS.
2026-07-21 09:06:07 -06:00
Tim Ouyang 0926356edd MAINTAINERS: update RISC-V maintainers
Rick and Leo are no longer with Andes. Remove Rick from the RISC-V
maintainer list. Leo will continue maintaining RISC-V, but update his
email address. Add myself to the maintainer list as Rick's replacement.

Signed-off-by: Leo Yu-Chi Liang <leo.liang@sifive.com>
Signed-off-by: Tim Ouyang <tim609@andestech.com>
2026-07-21 17:47:52 +08:00
Guodong XuandTim Ouyang b648d3e6d4 configs: k1: enable pinctrl and gpio
Enable pinctrl and gpio configurations for Spacemit K1 SoC.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:42:44 +08:00
Raymond MaoandTim Ouyang 0204d57851 gpio: add gpio driver for Spacemit K1 SoC
Enable gpio driver for Spacemit K1 SoC.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:42:44 +08:00
Raymond MaoandTim Ouyang 0b753e4021 pinctrl: add pinctrl driver for Spacemit K1 SoC
Add pinctrl driver for Spacemit K1 SoC.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:42:43 +08:00
Guodong XuandTim Ouyang a823fbf0cf spacemit: k1: Add multiple device tree support
Enable multiple DTB support in the FIT image for the Spacemit K1 SoC,
allowing a single U-Boot binary to support different board variants.

The SPL reads the board type from EEPROM and selects the corresponding
device tree at runtime via board_fit_config_name_match(), ensuring the
correct hardware description is passed to U-Boot proper.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:16:02 +08:00
Raymond MaoandTim Ouyang eb7de3ccf1 riscv: binman: Always set default configuration in FIT image
When CONFIG_MULTI_DTB_FIT is enabled, the FIT image contains multiple
device tree configurations for different boards. The default
configuration must be explicitly set to ensure the FIT framework
traverses all available configurations instead of falling back to
CONFIG_DEFAULT_DEVICE_TREE.

Without this default property, fit_find_config_node() will use
CONFIG_DEFAULT_DEVICE_TREE as the configuration name to match.
This prevents the SPL from correctly selecting the appropriate
DTB based on runtime board detection (e.g., from EEPROM).

Remove the conditional guard so that "default = conf-1" is always
present in the FIT image, regardless of CONFIG_MULTI_DTB_FIT.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:16:02 +08:00
Guodong XuandTim Ouyang e63500cab0 spl: k1: enable SPI NOR flash detection and boot
Add nor_early_init() to probe the QSPI controller and SPI NOR flash
in SPL.  Switch spl_boot_device() to BOOT_DEVICE_SPI so the board
boots from SPI flash.

Change the default device tree to k1-musepi-pro, whose u-boot
overlay already defines the QSPI controller and flash node with
bootph-pre-ram markers.  Enable the required SPI driver model and
flash config options.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:16:01 +08:00
Raymond MaoandTim Ouyang fed0b43917 spi: fsl: add support for Spacemit K1 SoC
Make FSL QSPI driver supporting Spacemit K1 SoC.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:16:01 +08:00
Raymond MaoandTim Ouyang f7599384d9 mtd: spi: enable spi_nor_remove() in soft reset config
spi_nor_remove() is only implemented in spi-nor-core.o, not spi-nor-tiny.o.

So make spi_nor_remove() only valid for CONFIG_SPI_FLASH_SOFT_RESET.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 17:16:01 +08:00
Raymond MaoandTim Ouyang 9a3e59a351 mtd: spi: select SPL_SPI_FLASH_TINY in SPL stage
Fix to select CONFIG_SPL_SPI_FLASH_TINY in SPL_BUILD stage.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Acked-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
2026-07-21 17:16:01 +08:00
Guodong XuandTim Ouyang ff5eb02d7d doc: spacemit: add K1 SPL build and test guide
The K1 SPL patchset requires DDR firmware integration and FSBL signing
steps that are not covered by existing documentation. Add a SoC-level
guide so reviewers and developers can build and test on hardware.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 17:12:53 +08:00
Raymond MaoandTim Ouyang 80aa3d3160 board: k1: enable pmic in spl
Add Spacemit P1 SoC support in SPL. And set the default voltage
for BUCKs and LDOs.

Also update MAINTAINERS: add Guodong Xu as co-maintainer, list the
u-boot-spacemit mailing list, register the new K1 driver files (i2c,
PMIC, regulator), and fix a pre-existing '@@' typo in Huan Zhou's
email.

Fixes: 1cd239f444 ("riscv: spacemit: bananapi_f3: initial support added")
Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 17:12:53 +08:00
Raymond MaoandTim Ouyang 8d691df1cf power: regulator: add support for Spacemit P1 SoC
Support voltage regulator for Spacemit P1 SoC. It contains 6 BUCKs
and 11 LDOs.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 17:12:53 +08:00
Raymond MaoandTim Ouyang c5307aae0d power: pmic: add support for Spacemit P1 PMIC
Spacemit's PMIC is used by Spacemit K1 SoC. It contains voltage
regulators, GPIOs and Watchdog.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:14 +08:00
Raymond MaoandTim Ouyang 83026cf8f9 spacemit: k1: Add DDR firmware support to SPL
Include DDR initialization firmware in the SPL image. The firmware
path can be specified via the DDR_FW_FILE environment variable. If
the firmware is not found, an empty placeholder file is created to
allow the build to proceed without DDR initialization support.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:14 +08:00
Raymond MaoandTim Ouyang b3ec88a7f3 spacemit: k1: add TLV EEPROM support in SPL
And support for required components including clock, I2C controller,
and I2C EEPROM.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang 271546fb8e i2c: k1: add I2C driver support
Add I2C driver support on Spacemit K1 SoC using driver model.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Reviewed-by: Heiko Schocher <hs@nabladev.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang cc4f363cc7 board: k1: initialize clock and serial devices in SPL
Initialize clock and serial devices in SPL. Otherwise, the device
driver won't be loaded in SPL.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang 70cee8ab03 dts: k1: enable clocks in SPL
Make the K1 clock controllers visible to SPL by tagging the four root
fixed clocks (osc_32k, vctcxo_{1,3,24}m) and the four syscon nodes
(mpmu, pll, apmu, apbc) with bootph-pre-ram in the BPI-F3 U-Boot
overlay.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang 8a8a640d2a configs: k1: add default option for clock driver in SPL
Add default option for enabling clock driver in SPL.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Guodong XuandTim Ouyang 853fdea1fe clk: spacemit: k1: prune SPL clock tree
K1 SPL runs from on-chip SRAM with a small pre-relocation malloc heap.
Registering the full K1 clock tree would not fit, so split the tree on
CONFIG_SPL_BUILD: the SPL build registers only the subset SPL needs
(currently UART, SDHCI, I2C (TWSI), and their PLL/MPMU/APMU/APBC
ancestors); the non-SPL build keeps the full tree.

Where surviving SPL CCU definitions reference parent clocks outside
that subset, use "clock-dummy", so framework parent lookups still resolve.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang 6db85c4aef configs: k1: enable early timer support
Enable CONFIG_TIMER_EARLY to allow udelay() calls during
early initialization phases. This is required for proper
timing operations before the full timer driver is available.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang ae94d8af7f spacemit: k1: enable SPL with debug UART
Add SPL support featuring debug UART output for early boot
diagnostics on K1 SoC.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Raymond MaoandTim Ouyang d577665526 spacemit: k1: support multi-board infrastructure
Restructure K1 SoC support to handle multiple boards through a single
configuration:

1. Rename bananapi-f3_defconfig to spacemit_k1_defconfig.
2. Move all K1 board files to board/spacemit/k1/.
3. Replace TARGET_BANANAPI_F3 with TARGET_SPACEMIT_K1 and rename the
   board's <board>.h header to k1.h.

Eliminates the need for board-specific defconfigs while maintaining
hardware compatibility.

Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Link: https://patch.msgid.link/20260519-b4-k1-spl-bring-up-v4-0-3915a2a904c1@riscstar.com
Tested-by: Songsong Zhang <sszhang@vsit.ai>
2026-07-21 16:57:13 +08:00
Guodong XuandTim Ouyang c43512ebb5 dt-bindings: reset: drop spacemit-k1-reset.h
After the K1 build switched to dts/upstream/, all reset IDs come from
the kernel's per-syscon namespace in
<dt-bindings/clock/spacemit,k1-syscon.h>. Remove the legacy U-Boot-only
reset binding header.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang 312728cec2 reset: spacemit: k1: drop legacy spacemit,k1-reset driver
After the K1 build switched to dts/upstream/src/riscv/spacemit/ and the
local arch/riscv/dts/k1.dtsi was deleted, the legacy
reset-controller@d4050000 DT node no longer exists. The of_match driver
in drivers/reset/reset-spacemit-k1.c (compatible "spacemit,k1-reset")
matches nothing and only sits in the binary as dead code.

Remove the legacy driver file, its Makefile entry, the RESET_SPACEMIT_K1
Kconfig symbol, and its bananapi-f3_defconfig selection. The new
syscon-bound reset driver under drivers/reset/spacemit/ has no
DT of_match of its own and is spawned by the K1 clock drivers, so gate
the subdirectory on CONFIG_CLK_SPACEMIT_K1 instead.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang 82e21b9322 dts: k1: drop legacy local DT files
The K1 build now consumes the kernel device tree via OF_UPSTREAM. The
local copies under arch/riscv/dts/ (k1.dtsi, k1-pinctrl.dtsi,
k1-bananapi-f3.dts) are unreachable; remove them.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang 77aac72a59 dts: k1: switch BPI-F3 build to upstream DT
Adopt the kernel device tree directly from
dts/upstream/src/riscv/spacemit/k1-bananapi-f3.dts instead of carrying
a forked copy under arch/riscv/dts/.

The U-Boot-only overlay k1-bananapi-f3-u-boot.dtsi carries the binman
description and a memory@0 node, since the upstream kernel DT has no
memory node (RAM is filled in by the bootloader).

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang 9994e61231 configs: bananapi-f3: enable Spacemit K1 clock driver
Enable CLK_SPACEMIT and CLK_SPACEMIT_K1 to compile in the K1
per-syscon clock drivers.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang 5b3959e2d6 clk: spacemit: k1: spawn reset device from per-syscon clock drivers
The K1 reset driver in drivers/reset/spacemit/ binds by name (no DT
of_match), so the per-syscon clock drivers must spawn it.

Add a .bind hook to k1_mpmu_clk, k1_apbc_clk and k1_apmu_clk that
calls spacemit_k1_reset_bind() to instantiate a UCLASS_RESET sibling
on the same ofnode.

Also introduce k1_apbc2_clk here. Its kernel DT node has #reset-cells
but no #clock-cells, so the driver exists only as the binding hook
for the apbc2 reset spawn.

With this in place, references such as
  resets = <&syscon_apbc RESET_TWSI0>;
in the kernel-mainline DT resolve correctly.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Guodong XuandTim Ouyang daa9b916a6 reset: spacemit: k1: introduce syscon-bound reset driver
The existing K1 reset driver (drivers/reset/reset-spacemit-k1.c) binds
via DT of_match against a top-level reset-controller node, but kernel
mainline DT for K1 has no such node: the mpmu, apbc, apmu and apbc2
syscons each spawn their own reset device as an auxiliary of the
clock controller. The legacy driver therefore cannot consume it.

Add a new reset driver at drivers/reset/spacemit/reset-spacemit-k1.c
bound by name from each per-syscon clock driver via
device_bind_driver_to_node(), without DT of_match, mirroring the
kernel's auxiliary-device pattern.

To keep the series bisectable, this driver coexists link-cleanly with
the legacy spacemit,k1-reset driver during the transition. A
follow-up patch that switches the K1 build to
dts/upstream/src/riscv/spacemit/ will drop the legacy driver.

Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Junhui LiuandTim Ouyang 3aa2882a3e clk: spacemit: Add support for K1 SoC
The K1 SoC exposes four clock providers in the kernel mainline DT: one
PLL controller ("spacemit,k1-pll") and three syscon clock nodes
("spacemit,k1-syscon-{mpmu,apbc,apmu}"). Register a separate
U_BOOT_DRIVER for each.

The controllers register clocks into a single CCF namespace, and a clock
in one controller may parent off a clock owned by another, so a
controller must register only after the controllers that own its parents
have probed. Each probe forces its parent controllers up by driver:

    MPMU <- PLL
    APMU <- PLL, MPMU
    APBC <- PLL, MPMU, APMU

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
Signed-off-by: Guodong Xu <guodong@riscstar.com>
2026-07-21 16:31:10 +08:00
Boon Khai NgandTom Rini 5a83cae32d spi: dw: Allow bits_per_word to be configured by device drivers
The DesignWare SPI controller supports configurable bits_per_word
(typically 4-32 bits), but this was previously hardcoded to 8 bits
in the driver initialization.

This patch enables bits_per_word to be set dynamically by upper-level
device drivers, matching the approach used in Linux. The controller
reads the bits_per_word value from the spi_slave structure during
each transfer, allowing different SPI devices on the same bus to use
different word sizes.

Implementation details:
 - Read slave->bits_per_word in dw_spi_xfer() before each transfer
 - Validate requested value against controller capabilities (4 to max_xfer)
 - Default to 8 bits if not set (maintains backward compatibility)

This follows the Linux model where spi_device drivers set bits_per_word,
and the controller driver reads it in the transfer function. Device
drivers can now set slave->bits_per_word before calling spi_xfer().

Example usage in device driver:
 slave->bits_per_word = 16;
 spi_xfer(slave, ...);

Backward compatible: Existing drivers that don't set bits_per_word
will continue to work with the default 8-bit transfers.

Signed-off-by: Boon Khai Ng <boon.khai.ng@altera.com>
2026-07-20 13:16:10 -06:00
Tom Rini 042e45e026 global: Switch from source.denx.de to git.u-boot-project.org
As part of moving our git forge to a new location, update all references
in tree to point to git.u-boot-project.org now.

Signed-off-by: Tom Rini <trini@konsulko.com>
2026-07-20 11:13:21 -06:00
Tom Rini a312adbcf5 Merge patch series "treewide: migrate to the new mailing-list domain"
Neil Armstrong <neil.armstrong@linaro.org> says:

We are migrating to the new U-Boot mailing-list server hosted by
OSU-OSL on the new lists.u-boot-project.org domain.

This changes all references of lists.denx.de in code, comments,
documentation and MAINTAINERS/README files.

Please review closely to ensure the transition goes smoothly.

The exact migration date is expected to be on July 20 2026, see [1].

[1] https://lore.kernel.org/all/20260715173119.GL749385@bill-the-cat/
Link: https://lore.kernel.org/r/20260720-osuosl-ml-switch-v4-0-20ec1c334dd2@linaro.org
2026-07-20 11:13:12 -06:00
Neil ArmstrongandTom Rini 910385cacb MAINTAINERS/README: Migrate mailing-list to lists.u-boot-project.org
The U-Boot Mailing-list is moving to the lists.u-boot-project.org
domain, so update all references of list.denx.de to the new
domain in the main README and MAINTAINERS files.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
2026-07-20 11:12:57 -06:00