Commit Graph
106581 Commits
Author SHA1 Message Date
David Lechner ad5b38f036 clk: mediaTek: mt8512: add clock tree type flags
Add clock tree type flags to the mt8512 clock tree structures. These
will be used later for parent lookup.

Clock trees had to be split now that each tree has a different type
flag.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-15-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 6795ecfb0a clk: mediaTek: mt8365: add clock tree type flags
Add clock tree type flags to the mt8365 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-14-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 5c15fdc8e0 clk: mediaTek: mt8195: add clock tree type flags
Add clock tree type flags to the mt8195 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-13-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 9ad117b8fc clk: mediaTek: mt8189: add clock tree type flags
Add clock tree type flags to the mt8189 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-12-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 8ae02df8a3 clk: mediaTek: mt8188: add clock tree type flags
Add clock tree type flags to the mt8188 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-11-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 7fb926c3cf clk: mediaTek: mt8183: add clock tree type flags
Add clock tree type flags to the mt8183 clock tree structures. These
will be used later for parent lookup.

Clock trees had to be split now that each tree has a different type
flag.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-10-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner eaeeab40b1 clk: mediaTek: mt7988: add clock tree type flags
Add clock tree type flags to the mt7988 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-9-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 3bb8ad2397 clk: mediaTek: mt7987: add clock tree type flags
Add clock tree type flags to the mt7987 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-8-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner de2cffba44 clk: mediaTek: mt7986: add clock tree type flags
Add clock tree type flags to the mt7986 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-7-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner b1c0fb40d6 clk: mediaTek: mt7981: add clock tree type flags
Add clock tree type flags to the mt7981 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-6-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 72983e2553 clk: mediaTek: mt7629: add clock tree type flags
Add clock tree type flags to the mt7629 clock tree structures. These
will be used later for parent lookup.

Clock trees had to be split now that each tree has a different type
flag.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-5-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner f28ea3a26a clk: mediaTek: mt7623: add clock tree type flags
Add clock tree type flags to the mt7623 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-4-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 269ba05881 clk: mediaTek: mt7622: add clock tree type flags
Add clock tree type flags to the mt7622 clock tree structures. These
will be used later for parent lookup.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-3-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 5d631beb2c clk: mediatek: add registration function for clock tree types
Add a new enum, field and function for registering clock tree types.
These types will be later used when looking up parent clocks. This
will replace fragile code that depends on lookup up devices by driver
names or ops.

We also need a way to ensure that any parent clock trees are probed
before trying to use a clock tree that depends on them. Since the
devicetree does not provide these relationships and there are only
a small number of clock parent providers (2 or 3 per SoC) vs. a large
number of clock trees that depend on them, it will simpler to just
always probe the parent clock trees on bind rather than trying to
add device info to all of the clocks to describe their parent
relations. For this, a mtk_common_clk_parent_bind() is added that the
drivers will use to set DM_FLAG_PROBE_AFTER_BIND.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-2-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner 2c8577318a clk: mediatek: mt7622: set parent flag for GATE_APMIXED()
Set the parent flag for GATE_APMIXED() clocks.

By having parent flags on all clocks we can simplify the parent lookup
process. This is the only mediatek clock still without this flag.

Link: https://patch.msgid.link/20260710-mtk-clk-parent-lookup-improvements-v2-1-f3f3a4a28dca@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 12:01:17 -05:00
David Lechner a29d3dd85b arm: dts: mt7623: remove duplicate topckgen override
Remove a duplicate topckgen override setting `bootph-all;`. The same
code was written twice in a row (probably copy/paste leftover).

Link: https://patch.msgid.link/20260708-mtk-mt7623-remove-dup-dt-override-v1-1-efffd4b6c12a@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:58:58 -05:00
David Lechner dfde529a78 clk: mediatek: mt8189: fix VLP_CK wrong parents
Fix a couple of places where we used the wrong macro to set the parent
flag for vlpcfg_ao_clks.

Fixes: 04b3a834c6 ("clk: mediatek: mt8189: add some VLP clocks")
Link: https://patch.msgid.link/20260706-mtk-clk-mt8189-fix-vlp-parent-v1-1-aedc2f8cc69d@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:55:23 -05:00
Carlo CaioneandDavid Lechner f309d23e3a configs: mediatek: do not autostart the watchdog on the Genio EVKs
U-Boot autostarts the SoC watchdog (CONFIG_WATCHDOG_AUTOSTART default
y) and services it from its main loop, but nothing services it after
ExitBootServices()/bootm: an EFI-booted OS that does not take over the
watchdog in time is reset mid-boot at a wall-clock-dependent point.

The MediaTek toprgu can count at most ~16 seconds, once firmware stops
servicing it at the handoff, the OS has whatever is left of those 16
seconds.

On the Genio 700 EVK the generic Ubuntu 26.04 arm64 image is hard-reset
before its first boot reaches the login prompt: the mtk-wdt driver is
a module loaded from the rootfs and cannot win that race. Nothing tells
a generic OS that the watchdog is armed, so the failure is silent and,
from the user's side, indistinguishable from broken firmware.

Disable WATCHDOG_AUTOSTART for the Genio EVK boards (mt8365_evk
directly, mt8188.config for the Genio 510/700).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Link: https://patch.msgid.link/20260706133322.68010-1-ccaione@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:51:19 -05:00
Julien StephanandDavid Lechner 729eadd987 clk: mediatek: mt8188: add missing clock in pericfg_ao
Add CLK_PERI_AO_PCIE_P0_FMEM clock in pericfg_ao.

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Link: https://patch.msgid.link/20260701-mt8188-clk-add-missing-clock-in-pericfg-ao-v1-1-13109b199248@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:47:38 -05:00
Julien StephanandDavid Lechner 3e9fa1d62e arm: dts: mediatek: add U-Boot dtsi overrides for Genio 510 and Genio 700
U-Boot applies DTS overrides by searching for files in the following
priority order [1]:

  <orig_filename>-u-boot.dtsi
  <CONFIG_SYS_SOC>-u-boot.dtsi
  <CONFIG_SYS_CPU>-u-boot.dtsi
  <CONFIG_SYS_VENDOR>-u-boot.dtsi
  u-boot.dtsi

For Genio 510 and Genio 700, the common mt8188-u-boot.dtsi override is
never applied because none of the lookup paths resolve to it
(CONFIG_SYS_SOC="mediatek", CONFIG_SYS_CPU="armv8",
CONFIG_SYS_VENDOR="mediatek").

Add board-specific overrides for mt8370-genio-510-evk and
mt8390-genio-700-evk that include mt8188-u-boot.dtsi.

While at it, also add mt8188-u-boot.dtsi into
board/mediatek/MAINTAINERS.

[1]: https://docs.u-boot.org/en/stable/develop/devicetree/control.html#adding-tweaks-for-u-boot

Signed-off-by: Julien Stephan <jstephan@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Link: https://patch.msgid.link/20260701-fix-genio-510-genio-700-dts-override-v1-1-cb571f8c9296@baylibre.com
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:47:37 -05:00
Marek VasutandDavid Lechner e7b59552d8 MAINTAINERS: Replace Mediatek with N:
Use N: to match on all mediatek/mtk files, drop the large list of
entries which represent the same set of relevant files and miss a
few in the process.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20260617024105.152655-1-marek.vasut+renesas@mailbox.org
Signed-off-by: David Lechner <dlechner@baylibre.com>
2026-07-22 11:47:37 -05:00
Naveen Kumar ChaudharyandTom Rini 1b8283bd32 cmd: read: fix unsigned overflow bypassing range check
The bounds check in do_rw() was written as:

    if (cnt + blk > limit)

with cnt and blk declared as uint (unsigned int) and limit as ulong.
C's usual arithmetic conversions are applied per binary operator, so
"cnt + blk" is evaluated entirely in unsigned int and wraps modulo
2^32 before the result is widened for the comparison against limit.
With cnt = 0xFFFFFFFF and blk = 1 the sum wraps to 0 and the guard
passes, allowing blk_dread()/blk_dwrite() to be issued with a 4 GiB
transfer count that runs past the partition (or, when no partition
is selected, the entire device).

Rewrite the check as two comparisons that do not overflow:

    if (blk > limit || cnt > limit - blk)

The subtraction is performed in ulong (limit's type), so no truncation
occurs, and the two sub-conditions cover both "start block past end"
and "count would push us past end" failure modes.

Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-21 13:52:50 -06:00
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