]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 months agoCI: Add a dependency file for patman
Simon Glass [Tue, 29 Apr 2025 13:22:12 +0000 (07:22 -0600)] 
CI: Add a dependency file for patman

Now that patman has an unusual dependency, add a requirements.txt file
and use it in CI

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Move code for sending into its own module
Simon Glass [Tue, 29 Apr 2025 13:22:11 +0000 (07:22 -0600)] 
patman: Move code for sending into its own module

The control module includes much of the implementation of patman's
'send' feature. As a first step to separating this out, move the sending
code into its own file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Support extra test features
Simon Glass [Tue, 29 Apr 2025 13:22:10 +0000 (07:22 -0600)] 
patman: Support extra test features

Provide support for the -X flag, which preserves the working directory
used by tests. Also support -N which shows captured output for tests.

Finally, allow selection of a particular test to run.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Tidy up the start-up code
Simon Glass [Tue, 29 Apr 2025 13:22:09 +0000 (07:22 -0600)] 
patman: Tidy up the start-up code

Much of this was written before the other Python tools and they have
evolved. Make a few updates:

- Rather than calling sys.exit(), return the exit code from the control
  module and use it in __main__
- Set up tout as it is used in some places
- We now have quite a few tests, so update the comment about that

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Rename test_basic() in test_checkpatch
Simon Glass [Tue, 29 Apr 2025 13:22:08 +0000 (07:22 -0600)] 
patman: Rename test_basic() in test_checkpatch

This currently has the same name as a test in func_test.py so it isn't
possible to select one or the other with 'patman test test_basic': both
are executed.

Rename this one to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Correct a stray quote
Simon Glass [Tue, 29 Apr 2025 13:22:07 +0000 (07:22 -0600)] 
patman: Correct a stray quote

A quote character was added a few years ago, but was not intended. Drop
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agotools: Plumb in capture control
Simon Glass [Tue, 29 Apr 2025 13:22:06 +0000 (07:22 -0600)] 
tools: Plumb in capture control

Add control of capturing output into u_boot_pylib and the tools which
use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agou_boot_pylib: Allow disabling colour output
Simon Glass [Tue, 29 Apr 2025 13:22:05 +0000 (07:22 -0600)] 
u_boot_pylib: Allow disabling colour output

When running tests there is no situation in which we want ANSI output as
it makes it much harder to see what is going on in logs, tests, etc.

Provide a way to disable this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agou_boot_pylib: Avoid concurrent execution of only one test
Simon Glass [Tue, 29 Apr 2025 13:22:04 +0000 (07:22 -0600)] 
u_boot_pylib: Avoid concurrent execution of only one test

There is no point in spinning up multiple processes if there is only one
test to execute. Add a check for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agou_boot_pylib: Add a pager
Simon Glass [Tue, 29 Apr 2025 13:22:03 +0000 (07:22 -0600)] 
u_boot_pylib: Add a pager

It is useful to have a pager when outputting a lot of text. Add support
for this in the terminal library, making use of a context manager.

Also add a function to indicate whether the output device is a terminal
or not, while we are here, to avoid duplicating this code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agou_boot_pylib: Improve ANSI-colour output with backgrounds
Simon Glass [Tue, 29 Apr 2025 13:22:02 +0000 (07:22 -0600)] 
u_boot_pylib: Improve ANSI-colour output with backgrounds

The current implementation does not handle background colours very well:

- It outputs an incorrect code in some cases, leading to wrong colours
- Some functions lack a control for the background

Tidy this up so that background colours can be used in more places.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agou_boot_pylib: Allow control of capturing
Simon Glass [Tue, 29 Apr 2025 13:22:01 +0000 (07:22 -0600)] 
u_boot_pylib: Allow control of capturing

Tests often capture output so they can check it. This means that if the
test fails it is not easy to see what the output actually was.

Add a -N flag which writes out the output after it has been captured.
This is not a perfect solution but it is simple and seems to work well
in practice.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Correct a typo in the toolpath comment
Simon Glass [Tue, 29 Apr 2025 13:22:00 +0000 (07:22 -0600)] 
binman: Correct a typo in the toolpath comment

Fix the 'ist' typo in the comment for TestFunctional

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Move capture_sys_output() into terminal and rename
Simon Glass [Tue, 29 Apr 2025 13:21:59 +0000 (07:21 -0600)] 
patman: Move capture_sys_output() into terminal and rename

This function is sometimes useful outside tests. Also it can affect how
terminal output is done, e.g. whether ANSI characters should be emitted
or not.

Move it out of the test_util package and into terminal.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agopatman: Move all non-test logic into control module
Simon Glass [Tue, 29 Apr 2025 13:21:58 +0000 (07:21 -0600)] 
patman: Move all non-test logic into control module

It is easier for tests if the top-level control logic is all in one
module. Create a new do_patman() function to handle this. Move the
existing code into it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: x86: Write skip-at-start when end-at-4gb is used
Simon Glass [Sun, 16 Feb 2025 02:02:37 +0000 (19:02 -0700)] 
binman: x86: Write skip-at-start when end-at-4gb is used

The end-at-4gb property implies a value for skip-at-start so add it into
the output FDT so that U-Boot can read it.

Now that skip-at-start is implemented, we can drop the workarounds used
in the x86 code to obtain the correct image-pos value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Read the skip-at-start value on startup
Simon Glass [Sun, 16 Feb 2025 02:02:36 +0000 (19:02 -0700)] 
binman: Read the skip-at-start value on startup

This value provides an offset for all image-pos values in the image.
Read it on startup so that we can take account of it when calculating
positions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobuildman: Add a way to build a particular target
Simon Glass [Tue, 17 Dec 2024 13:26:16 +0000 (06:26 -0700)] 
buildman: Add a way to build a particular target

At present buildman only supports building the default target. Generally
this is what is wanted, but in some cases boards erroneously have a
different target for product extra files.

Add a --target option to help. Also add a comment indicating which
letters are free for new options.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoMerge tag 'v2025.07-rc3' into next
Tom Rini [Mon, 26 May 2025 22:07:19 +0000 (16:07 -0600)] 
Merge tag 'v2025.07-rc3' into next

Prepare v2025.07-rc3

2 months agoPrepare v2025.07-rc3 v2025.07-rc3
Tom Rini [Mon, 26 May 2025 22:02:19 +0000 (16:02 -0600)] 
Prepare v2025.07-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge branch 'master' of git://source.denx.de/u-boot-usb
Tom Rini [Mon, 26 May 2025 00:01:54 +0000 (18:01 -0600)] 
Merge branch 'master' of git://source.denx.de/u-boot-usb

2 months agoMerge tag 'efi-2025-07-rc3-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 25 May 2025 15:14:07 +0000 (09:14 -0600)] 
Merge tag 'efi-2025-07-rc3-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-07-rc3-3

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/26313

UEFI:

* run dhcp if an http boot option is selected
* separate device path into its own header and add it to the API docs
* rename END to EFI_DP_END
* make x86 SMBIOS tables usable in the EFI context

2 months agousb: ulpi: Clean up how we enable support
Tom Rini [Sat, 15 Mar 2025 01:27:36 +0000 (19:27 -0600)] 
usb: ulpi: Clean up how we enable support

The way we enable ULPI support today isn't something that should work.
The "optional" keyword in a choice statement is not a documented
feature. To make this work in a supported way, make USB_ULPI something
we ask about if USB_HOST is set. Next, we move the choice of what
viewer to use to be after the framework portion and to depend on that.
We then borrow a few words from the top-level README to make the help
text here clearer. Finally we make the Qualcomm driver select ULPI as
it's required and we make the tegra driver not duplicate a check that
Kconfig now handles for us.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agousb: ulpi: Remove unused omap-ulpi-viewport driver
Tom Rini [Sat, 15 Mar 2025 01:27:35 +0000 (19:27 -0600)] 
usb: ulpi: Remove unused omap-ulpi-viewport driver

The last platform to enable this driver was removed in 2019. Remove this
unused code and documentation now.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agousb: dwc3: core: Fix timeout check
Varadarajan Narayanan [Wed, 15 Jan 2025 06:20:44 +0000 (11:50 +0530)] 
usb: dwc3: core: Fix timeout check

dwc3_core_init loops 'timeout' times to check if the IP block is out
of reset using 'while (timeout--)'. If there is some issue and
the block doesn't come out of reset, the loop will run till
'timeout' becomes zero and the post decrement operator would set
timeout to 0xffffffff. Though the IP block is not out reset, the
subsequent if check 'if !timeout' would fail as timeout is not
equal to zero and the function proceeds with the initialization.

Use poll API instead to resolve this.

Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoefi_loader: Run dhcp if an http boot option is selected
Ilias Apalodimas [Fri, 23 May 2025 13:04:04 +0000 (16:04 +0300)] 
efi_loader: Run dhcp if an http boot option is selected

The EFI boot manager relies on having an IP address before trying to
boot an EFI HTTP(s) boot entry. However, defining it as a boot or
pre-boot command is not always the right answer since it will
unconditionally add delay to the board boot, even if we don't boot
over the network.

So let's do a DHCP request from the boot manager, if 'ipaddr' is
empty and fail early if we don't have an address.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
2 months agox86: efi_loader: Ensure the SMBIOS tables are sent via EFI
Simon Glass [Fri, 23 May 2025 16:55:04 +0000 (17:55 +0100)] 
x86: efi_loader: Ensure the SMBIOS tables are sent via EFI

The EFI-loader code has not been fully converted to use bloblist, so
relies on the SMBIOS-table address being set in global_data.

Set this up in write_tables() so that the SMBIOS tables are actually
available.

Enable the command for x86 QEMU so that the SMBIOS tests actually run.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 83ce35d6ebb ("emulation: Use bloblist to hold tables")
Reported-by: Niklas Sombert <niklas.sombert@uni-duesseldorf.de>
Tested-by: Niklas Sombert <niklas.sombert@uni-duesseldorf.de>
Tested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi: Rename END to EFI_DP_END
Simon Glass [Sat, 24 May 2025 17:28:23 +0000 (11:28 -0600)] 
efi: Rename END to EFI_DP_END

This exported symbol has a very generic name. Rename it to indicate that
it relates to EFI and device-paths.

Fix checkpatch warnings related to use of multiple assignments.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi: Include device-path functions in the EFI API docs
Simon Glass [Sat, 24 May 2025 17:28:22 +0000 (11:28 -0600)] 
efi: Include device-path functions in the EFI API docs

Include these function so they can be browsed in the API docs. Exclude
END since it causes a warning, which becomes an error:

   ./include/efi_device_path.h:22: warning: cannot understand function
      prototype: 'const struct efi_device_path END; '

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_loader: Separate device path into its own header
Simon Glass [Sat, 24 May 2025 17:28:21 +0000 (11:28 -0600)] 
efi_loader: Separate device path into its own header

These functions are useful for the EFI app. As a first step towards
making these available outside lib/efi_loader, create a separate header
file and include it where needed. Add proper comments to the functions,
since many are missing at present.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agonet: phy: Do not do CL22 phy reset before ethernet phy driver probe
SkyLake.Huang [Mon, 14 Oct 2024 07:06:11 +0000 (15:06 +0800)] 
net: phy: Do not do CL22 phy reset before ethernet phy driver probe

Remove unnecessary CL22 phy reset before ethernet phy driver
probe. Lots of ethernet phys requires driver to load firmware.
Before that, CL22 phy reset may lead to malfunction.

Signed-off-by: SkyLake.Huang <skylake.huang@mediatek.com>
2 months agonet: tftp: don't call stop callback from UDP handler
Alexander Sverdlin [Mon, 13 May 2024 06:26:35 +0000 (08:26 +0200)] 
net: tftp: don't call stop callback from UDP handler

Contrary to doc/develop/driver-model/ethernet.rst contract, eth_ops
.free_pkt can be called after .stop, there are several error paths in TFTP,
for instance:

eth_halt() <= tftp_handler() <= net_process_received_packet() <= eth_rx()
...
am65_cpsw_free_pkt() <= eth_rx()

Which results in (deliberately "tftpboot"ing non-existing file):

TFTP error: 'File not found' (1)
Not retrying...
am65_cpsw_nuss_port ethernet@8000000port@1: RX dma free_pkt failed -22

Avoid the DMA error message (and follow the documentation) by deferring
eth_halt() until net_loop() calls net_start_again() and only do
eth_halt_state_only() instead.

Fixes: aafda38fb266 ("Add error codes/handling for TFTP-server")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
2 months agoMerge patch series "BOOTP/DHCPv4 enhancements"
Tom Rini [Fri, 23 May 2025 17:29:55 +0000 (11:29 -0600)] 
Merge patch series "BOOTP/DHCPv4 enhancements"

Sean Edmond <seanedmond@microsoft.com> says:

In our datacenter application, a single DHCP server is servicing 36000+ clients.
Improvements are required to the DHCPv4 retransmission behavior to align with
RFC and ensure less pressure is exerted on the server:
- retransmission backoff interval maximum is configurable
  (environment variable bootpretransmitperiodmax)
- initial retransmission backoff interval is configurable
  (environment variable bootpretransmitperiodinit)
- transaction ID is kept the same for each BOOTP/DHCPv4 request
  (not recreated on each retry)

For our application we'll use:
- bootpretransmitperiodmax=16000
- bootpretransmitperiodinit=2000

A new configuration BOOTP_RANDOM_XID has been added to enable a randomized
BOOTP/DHCPv4 transaction ID.

Enhance DHCPv4 sending/parsing option 209 (PXE config file).  A previous
patch was accepted.  A new patch fixes a possible double free() and
addresses latest review comments.

Link: https://lore.kernel.org/r/20240509023918.2504185-1-seanedmond@microsoft.com
2 months agonet: bootp: add config option BOOTP_RANDOM_XID
Sean Edmond [Thu, 9 May 2024 02:39:03 +0000 (19:39 -0700)] 
net: bootp: add config option BOOTP_RANDOM_XID

The new config option BOOTP_RANDOM_XID will randomize the transaction ID
for each new BOOT/DHCPv4 exchange.

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agonet: bootp: BOOTP/DHCPv4 retransmission improvements
Sean Edmond [Thu, 9 May 2024 02:39:02 +0000 (19:39 -0700)] 
net: bootp: BOOTP/DHCPv4 retransmission improvements

This patch introduces 3 improvements to align with RFC 951:
- retransmission backoff interval maximum is configurable
- initial retranmission backoff interval is configurable
- transaction ID is kept the same for each BOOTP/DHCPv4 request

In applications where thousands of nodes are serviced by a single DHCP
server, maximizing the retransmission backoff interval at 2 seconds (the
current u-boot default) exerts high pressure on the DHCP server and
network layer.

RFC 951 “7.2. Client Retransmission Strategy” states that the
retransmission backoff interval should be limited to 60 seconds.  This
patch allows the interval to be configurable using the environment
variable "bootpretransmitperiodmax"

The initial retranmission backoff period defaults to 250ms, which is
also too small for these scenarios with many clients.  This patch makes
the initial retransmission interval to be configurable using the
environment variable "bootpretransmitperiodinit".

Also, on a retransmission it is not expected for the transaction ID to
change (only the 'secs' field should be updated). Let's save the
transaction ID and use the same transaction ID for each BOOTP/DHCPv4
exchange.

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
2 months agonet: Enhancements for dhcp option 209
Sean Edmond [Thu, 9 May 2024 02:39:01 +0000 (19:39 -0700)] 
net: Enhancements for dhcp option 209

- Enable option 209 by default
- Set pxelinux_configfile to NULL to avoid potential double free
- change hardcoded 209 to a define

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
2 months agoext4fs: Fix: Read outside partition error
Tony Dinh [Fri, 23 May 2025 05:02:01 +0000 (22:02 -0700)] 
ext4fs: Fix: Read outside partition error

Use lbaint_t for blknr to avoid overflow in ext4fs_read_file().

Background:

blknr (block number) used in ext4fs_read_file() could be increased to a
very large value and causes a wrap around at 32 bit signed integer max,
thus becomes negative. This results in an out-of-normal range for sector
number (during the assignment delayed_start = blknr) where delayed_start
sector is typed uint64 lbaint_t. This causes the "Read outside partition"
error.

This patch was tested on the Synology DS116 (Armada 385) board, and a
4TB Seagate HDD.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2 months agofs: fs_devread should log error when read outside partition
Tony Dinh [Tue, 20 May 2025 23:49:24 +0000 (16:49 -0700)] 
fs: fs_devread should log error when read outside partition

Log the error if fs_devread() fails when trying to reading outside
partition. This will make bug reporting easier.

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
2 months agoboard: total_Compute: enable bloblist for SPL handoff
Jayanth Dodderi Chidanand [Thu, 8 May 2025 10:55:55 +0000 (11:55 +0100)] 
board: total_Compute: enable bloblist for SPL handoff

Add bloblist support to total_comput platform for passing data
from TF-A using the firmware handoff framework.

Signed-off-by: Jayanth Dodderi Chidanand <jayanthdodderi.chidanand@arm.com>
2 months agoEXT4: add CRC16 dependency
Marius Dinu [Thu, 8 May 2025 12:05:19 +0000 (12:05 +0000)] 
EXT4: add CRC16 dependency

CRC16 is used in ext4_common.c. Build fails without it.

PS:
This is my first patch sent to a mailing list.
If there is anything wrong with it (email format, whitespace, etc.)
please let me know.

Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
2 months agoenv: mtd: fix usability with NAND flashes
Weijie Gao [Tue, 6 May 2025 07:15:01 +0000 (15:15 +0800)] 
env: mtd: fix usability with NAND flashes

1. As this is for MTD-based devices, the Kconfig dependency should be MTD
   instead of only spi-nor flashes
2. Initialize saved_buf to avoid crash on free()
3. Remaining size should be set correctly to write_size

Fixes: 03fb08d4aef (env: Introduce support for MTD)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Reviewed-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agocmd: ximg: handle Z_BUF_ERROR explicitly in GZIP decompression
Aristo Chen [Thu, 8 May 2025 19:37:24 +0000 (19:37 +0000)] 
cmd: ximg: handle Z_BUF_ERROR explicitly in GZIP decompression

When decompressing GZIP-compressed image parts via the `imxtract` command,
explicitly handle the `Z_BUF_ERROR` return value from `gunzip()` to provide
a clearer diagnostic. This error typically indicates that the destination
buffer is too small to hold the uncompressed data.

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
[trini: Rework to indent the whole case with { } due to not using the
C23 extension]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agocommon: add config for board_init() call
Ben Dooks [Wed, 7 May 2025 12:23:42 +0000 (13:23 +0100)] 
common: add config for board_init() call

Add CONFIG_BOARD_INIT to specifu if the board_init() needs calling
during initcall phase, and default it to 'y' for the relevant
architectures which probably need it.

This allows anyone with a board that doesn't need it to just remove
it from the initcall list w/o an empty code block in the board init
file.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoclk: mediatek: add dummy clk enable/disable ops for apmixedsys clocks
Weijie Gao [Tue, 6 May 2025 08:12:20 +0000 (16:12 +0800)] 
clk: mediatek: add dummy clk enable/disable ops for apmixedsys clocks

Starting from commit ac30d90f336 (clk: Ensure the parent clocks are enabled
while reparenting), MediaTek filogic platforms will crash on booting when
initializing mmc devices.

The root cause is that to simplify the code, we reused the topckgen ops for
apmixedsys clocks as they share the get_rate with topckgen clocks while the
clk enable/disable ops are not available for apmixedsys clocks.

Now that a clock will be enabled first before reparenting, we have to add
dummy enable/disable ops for apmixedsys to avoid unexpected behavior when
apmixedsys clocks are the parent clock of the to-be-reparenting clocks.

Fixes: 40746bf429d (clk: mediatek: add clock driver support for MediaTek MT7981 SoC)
Fixes: 37d5a9a29dc (clk: mediatek: add clock driver support for MediaTek MT7986 SoC)
Fixes: ece4e5804f5 (clk: mediatek: add clock driver support for MediaTek MT7987 SoC)
Fixes: 421436981a2 (clk: mediatek: add clock driver support for MediaTek MT7988 SoC)
Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 months agoarm: dts: k3: require mandatory firmware in binman
Bryan Brattlof [Tue, 6 May 2025 13:11:45 +0000 (08:11 -0500)] 
arm: dts: k3: require mandatory firmware in binman

TI's Foundational Security (TIFS), Device Management (DM) and Device
Management and Security Control (DMSC) firmware are required for a
successful boot. Remove the 'optional' flag so binman will emit an error
if these firmware components are not found

Signed-off-by: Bryan Brattlof <bb@ti.com>
Acked-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: verdin-am62: Drop unused or redundant config options
Emanuele Ghidoli [Tue, 6 May 2025 07:08:59 +0000 (09:08 +0200)] 
configs: verdin-am62: Drop unused or redundant config options

Several Kconfig options are enabled but unused or unnecessary for our
use case. These include features such as SPL FAT support, YMODEM, and
USB keyboard. Some R5-specific configurations are not used at all,
as U-Boot proper is not executed on that core.

Cleaning them up helps reduce build size and simplifies maintenance.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2 months agoconfigs: phycore_am6xx_a53_defconfig: Enable BOOTDEV_SPI_FLASH
Wadim Egorov [Thu, 8 May 2025 15:15:48 +0000 (17:15 +0200)] 
configs: phycore_am6xx_a53_defconfig: Enable BOOTDEV_SPI_FLASH

Enable standard boot with SPI Flash & sync after savedefconfig.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: common: k3: Factor out mac address setup
Wadim Egorov [Thu, 8 May 2025 15:15:47 +0000 (17:15 +0200)] 
board: phytec: common: k3: Factor out mac address setup

Factor out the mac address setup into setup_mac_from_eeprom().

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: common: k3: Update boot_targets at runtime
Wadim Egorov [Thu, 8 May 2025 15:15:46 +0000 (17:15 +0200)] 
board: phytec: common: k3: Update boot_targets at runtime

Factor out boot device detection from board_late_init() into a new
boot_targets_setup() helper.

Adjust the boot_targets environment variable to favor the device we
just booted from. If boot_targets is still at its default value,
prepend the current boot device to the list; otherwise leave any
user-customized order untouched.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: phycore_am6xx: Default BOOTCOMMAND to standard boot
Wadim Egorov [Thu, 8 May 2025 15:15:45 +0000 (17:15 +0200)] 
configs: phycore_am6xx: Default BOOTCOMMAND to standard boot

Make the "bootflow scan -lb" command execute first and
fallback to the legacy BSP boot scripts.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: phycore_am6xx: Set bootmeths & boot_targets environment
Wadim Egorov [Thu, 8 May 2025 15:15:44 +0000 (17:15 +0200)] 
board: phytec: phycore_am6xx: Set bootmeths & boot_targets environment

As part of our migration to the standard boot process, configure the
default values for the bootmeths and boot_targets environment variables.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: phycore_am64x: Update environment for fitboot
Nathan Morrisson [Thu, 8 May 2025 15:15:43 +0000 (17:15 +0200)] 
board: phytec: phycore_am64x: Update environment for fitboot

Add fit_addr_r to the environment to allow us to boot from a FIT image.

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: phycore_am62x: Update environment for fitboot
Nathan Morrisson [Thu, 8 May 2025 15:15:42 +0000 (17:15 +0200)] 
board: phytec: phycore_am62x: Update environment for fitboot

Add fit_addr_r to the environment to allow us to boot from a FIT image.

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agotiny-printf: Handle formatting of %p with an extra Kconfig
Christoph Niedermaier [Thu, 8 May 2025 11:57:25 +0000 (13:57 +0200)] 
tiny-printf: Handle formatting of %p with an extra Kconfig

The formatting with %pa / %pap behaves like %x, which results in an
incorrect value being output. To improve this, a new fine-tuning
Kconfig SPL_USE_TINY_PRINTF_POINTER_SUPPORT for pointer formatting
has been added. If it is enabled, the output of %pa / %pap should
be correct, and if it is disabled, the pointer formatting is
completely unsupported. In addition to indicate unsupported formatting,
'?' will be output. This allows enabling pointer formatting only
when needed. For SPL_NET it is selected by default. Then it also
supports the formatting with %pm, %pM and %pI4.

In summery this level of %p support for tiny printf is possible now:

1) The standard tiny printf won't have support for pointer formatting.
   So it doesn't print misleading values for %pa, instead '?' will be
   output:
   %p   => ?
   %pa  => ?a
   %pap => ?ap

2) If SPL_USE_TINY_PRINTF_POINTER_SUPPORT is enabled or DEBUG is defined
   tiny printf supports formatting %p and %pa / %pap.

3) If SPL_NET is enabled the support of pointers is extended
   for %pm, %pM and %pI4.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
2 months agoarm: cpu: armv7m: add ENTRY/ENDPROC macros
Johannes Krottmayer [Thu, 8 May 2025 19:00:28 +0000 (19:00 +0000)] 
arm: cpu: armv7m: add ENTRY/ENDPROC macros

Since GNU binutils version 2.44, assembly functions must include
the assembler directive .type name, %function. If not a call to
these functions fails with the error message 'Unknown destination
type (ARM/Thumb)' and the error message 'dangerous relocation:
unsupported relocation' at linking.

The macros ENTRY/ENDPROC includes this directive and should be
used for all assembly functions.

Signed-off-by: Johannes Krottmayer <johannes@krotti42.com>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agoMerge tag 'u-boot-imx-master-20250522' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 22 May 2025 14:41:25 +0000 (08:41 -0600)] 
Merge tag 'u-boot-imx-master-20250522' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/26275

- Fix boot regression on imx8mn_bsh_smm_s2/s2pro.
- Fix reset on imx6ulz_smm_m2.
- Adjust DDR initialization on imx6ulz_smm_m2.
- Fix CAAM startup error.

2 months agocaam: Fix CAAM error on startup
Olaf Baehring [Wed, 21 May 2025 11:03:40 +0000 (08:03 -0300)] 
caam: Fix CAAM error on startup

In rare cases U-Boot returns an error message when intantiating the RNG
of the CAAM device:
“SEC0:  RNG4 SH0 instantiation failed with error 0xffffffff”
This  means, that even when the CAAM device reports a finished
descriptor, none is found in the output ring.
This might be caused by a missing cache invalidation before
reading the memory of the output ring
This patch moves the cache invalidation of the output ring from start of
the job to immediately after the notification from hardware where the
output ring will be read.

Signed-off-by: Olaf Baehring <olaf.baehring@draeger.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
2 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv 750/head
Tom Rini [Wed, 21 May 2025 14:59:10 +0000 (08:59 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/26259

- Initial SPL support for T-Head TH1520 SoC
- Improve usability of TH1520 with mainline SPL
- Support building RV32 & RV64 images
- riscv: Improve jh7110 support

2 months agoMerge tag 'net-20250520' of https://source.denx.de/u-boot/custodians/u-boot-net
Tom Rini [Wed, 21 May 2025 14:58:51 +0000 (08:58 -0600)] 
Merge tag 'net-20250520' of https://source.denx.de/u-boot/custodians/u-boot-net

Pull request net-20250520.

CI: https://source.denx.de/u-boot/custodians/u-boot-net/-/pipelines/26247

net, net-lwip:
- Remove wget console output when called by EFI

net-lwip:
- Add 10 s timeout to TFTP
- Add LMB buffer checks

2 months agoboard: bsh: imx6ulz_smm_m2: Add delay between DRAM read access
Michael Bode [Wed, 21 May 2025 09:47:32 +0000 (11:47 +0200)] 
board: bsh: imx6ulz_smm_m2: Add delay between DRAM read access

A small delay between DRAM read access with wrong parameters and
reconfiguration is necessary.
Without a delay between DRAM read access and a following reconfiguration
this reconfiguration fails for certain DRAM chips (Nanya).

Signed-off-by: Michael Bode <michael.bode@bshg.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoboard: bsh: imx6ulz_smm_m2: Add support for 512 MiB DRAM
Michael Bode [Wed, 21 May 2025 09:47:31 +0000 (11:47 +0200)] 
board: bsh: imx6ulz_smm_m2: Add support for 512 MiB DRAM

Calibration values were calculated using the NXP tool
I.MX6ULL_DDR3_Script_Aid_V0.01.xlsx

Signed-off-by: Michael Bode <michael.bode@bshg.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoboard: bsh: imx6ulz_smm_m2: Add support for 256 MiB DRAM
Simon Holesch [Wed, 21 May 2025 09:47:30 +0000 (11:47 +0200)] 
board: bsh: imx6ulz_smm_m2: Add support for 256 MiB DRAM

Calibration values were calculated using the NXP tool
I.MX6ULL_DDR3_Script_Aid_V0.01.xlsx

Signed-off-by: Wolfgang Birkner <wolfgang.birkner@bshg.com>
Signed-off-by: Simon Holesch <simon.holesch@bshg.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoboard: bsh: imx6ulz_smm_m2: Match SPL DDR settings to DCD table
Michael Trimarchi [Wed, 21 May 2025 09:47:29 +0000 (11:47 +0200)] 
board: bsh: imx6ulz_smm_m2: Match SPL DDR settings to DCD table

When using SPL on i.mx6 we frequently notice some DDR initialization
mismatches between the SPL code and the non-SPL code.

As the non-SPL code have been tested for long time and proves to be
reliable, let's configure the DDR in the exact same way as the non-SPL
case.

The idea is simple: just use the DCD table and write directly to the DDR
registers.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoboard: freescale: imx8mn_evk: let clock system enable UART clock
Michael Trimarchi [Tue, 20 May 2025 09:02:15 +0000 (11:02 +0200)] 
board: freescale: imx8mn_evk: let clock system enable UART clock

Now that the UART driver can enable the required clocks, remove
the hard-coded clock enable.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
2 months agoboard: bsh: imx8mn_bsh_smm_s2/s2pro: let clock system enable UART clock
Dario Binacchi [Tue, 20 May 2025 08:54:20 +0000 (10:54 +0200)] 
board: bsh: imx8mn_bsh_smm_s2/s2pro: let clock system enable UART clock

Now that the UART driver can enable the required clocks, remove
the hard-coded clock enable.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoboard: bsh: imx8mn_bsh_smm_s2/s2pro: enlarge CONFIG_SPL_SYS_MALLOC_F_LEN
Dario Binacchi [Tue, 20 May 2025 08:54:19 +0000 (10:54 +0200)] 
board: bsh: imx8mn_bsh_smm_s2/s2pro: enlarge CONFIG_SPL_SYS_MALLOC_F_LEN

The commit dda454e933c6 ("serial: mxc: Support bulk enabling clocks")
breaks the booting of the BSH SMM S2 board. The analysis of the issue
revealed memory allocation failures during the registration of UART4
clocks as well as other peripherals. Increasing SYS_MALLOC_F_LEN to
0x10000 fixed the issue.

Dropping this option allows it to be set to the default value of
CONFIG_SYS_MALLOC_F_LEN, which is set by default to 0x10000 on
i.MX8M platforms.

Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 months agoconfigs: imx8mn_bsh_smm_s2: load U-Boot from raw NAND
Dario Binacchi [Tue, 20 May 2025 08:54:18 +0000 (10:54 +0200)] 
configs: imx8mn_bsh_smm_s2: load U-Boot from raw NAND

Commit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks
the boot of the BSH SMM S2 board. Add options to load U-Boot from raw NAND
sector.

Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoimx: spl_imx_romapi: support raw NAND sector
Dario Binacchi [Tue, 20 May 2025 08:54:17 +0000 (10:54 +0200)] 
imx: spl_imx_romapi: support raw NAND sector

Commit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks
the boot of the BSH SMM S2 board. As stated in the dropped comment, "Some
boards use this value even though MMC is not enabled in SPL, for example
imx8mn_bsh_smm_s2".

Support load of the U-Boot image from raw NAND sector.

Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agospl: Kconfig: support U-Boot load from raw NAND
Dario Binacchi [Tue, 20 May 2025 08:54:16 +0000 (10:54 +0200)] 
spl: Kconfig: support U-Boot load from raw NAND

Commit 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options") breaks
the boot of the BSH SMM S2 board. As stated in the commit itself, "Some
boards use this value even though MMC is not enabled in SPL, for example
imx8mn_bsh_smm_s2".

Support load of the U-Boot image from raw NAND sector. This is equivalent
to load from MMC raw sector.

Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2 months agoARM: dts: imx93-phycore: Migrate to OF_UPSTREAM
Primoz Fiser [Fri, 16 May 2025 10:46:02 +0000 (12:46 +0200)] 
ARM: dts: imx93-phycore: Migrate to OF_UPSTREAM

Migrate to OF_UPSTREAM for phyCORE-i.MX93 since board can use upstream
Linux kernel device-tree for phyBOARD-Segin-i.MX93.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarm: dts: imx6ulz-bsh-smm-m2: Fix reset using wdt-reboot driver
Michael Trimarchi [Fri, 16 May 2025 08:17:21 +0000 (10:17 +0200)] 
arm: dts: imx6ulz-bsh-smm-m2: Fix reset using wdt-reboot driver

commit 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()")
introduced a regression that 'reset' command unable to reset
imx6ulz based BSH module's modules in the u-boot.

BSH module's imx6, imx6ulz-bsh-smm-m2.dts

Fixes: 68dcbdd594d4 ("ARM: imx: Add weak default reset_cpu()")
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 months agoconfigs: imx6ulz_smm_m2: Add board watchdog reset configuration
Michael Trimarchi [Fri, 16 May 2025 08:17:20 +0000 (10:17 +0200)] 
configs: imx6ulz_smm_m2: Add board watchdog reset configuration

Add the configuration that allow to reset the board from reset
cmd

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 months agoarm: dts: imx6ulz-bsh-smm-m2-u-boot: Drop soc node
Michael Trimarchi [Fri, 16 May 2025 08:17:19 +0000 (10:17 +0200)] 
arm: dts: imx6ulz-bsh-smm-m2-u-boot: Drop soc node

The node is specified on the parent architecture u-boot.dtsi
file

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2 months agoarm: imx: imx8m: soc: replace ifdef by IS_ENABLED()
Dario Binacchi [Thu, 15 May 2025 15:09:52 +0000 (17:09 +0200)] 
arm: imx: imx8m: soc: replace ifdef by IS_ENABLED()

Standardize on using the IS_ENABLED macro.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agoarm: imx: imx8m: soc: fix the macro name
Michael Trimarchi [Thu, 15 May 2025 15:09:51 +0000 (17:09 +0200)] 
arm: imx: imx8m: soc: fix the macro name

The function arch_spl_mmc_get_uboot_raw_sector() was never compiled,
even when the option CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION was
enabled. So rename the macro SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION to
CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION.

Fixes: 2a00d73d081a ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agoriscv: dts: th1520: Complete clock tree
Yao Zi [Fri, 16 May 2025 03:05:25 +0000 (03:05 +0000)] 
riscv: dts: th1520: Complete clock tree

Describe the newly-supported clock controller of TH1520 in SoC
devicetree, replace dummy clocks with the controller-supplied ones and
add correct clocks for GPIO controllers.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: cpu: th1520: Select clock driver
Yao Zi [Fri, 16 May 2025 03:05:24 +0000 (03:05 +0000)] 
riscv: cpu: th1520: Select clock driver

The clock driver is essential for TH1520 SoCs to operate. Select the
driver in SoC Kconfig entry.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoclk: thead: Port clock controller driver of TH1520 SoC
Yao Zi [Fri, 16 May 2025 03:05:23 +0000 (03:05 +0000)] 
clk: thead: Port clock controller driver of TH1520 SoC

The driver is adapted from Linux kernel's version of clk-th1520-ap.c,
with only output clocks for external sensors, which are barely useful in
bootloaders, removed.

Same as the mainline driver, it currently lacks of ability to enable and
reconfigure PLLs, which could be implemented later.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: cpu: th1520: Initialize IOPMPs in SPL
Yao Zi [Fri, 16 May 2025 03:05:22 +0000 (03:05 +0000)] 
riscv: cpu: th1520: Initialize IOPMPs in SPL

TH1520 SoC ships several IOPMPs protecting various on-chip peripherals.
They must be configured before accessing the peripherals. Let's
initialize them in SPL harts_early_init().

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agodoc: thead: lpi4a: Update documentation
Yao Zi [Tue, 13 May 2025 09:05:03 +0000 (09:05 +0000)] 
doc: thead: lpi4a: Update documentation

Support for eMMC, SD card, GPIO and SPL have been available in LPi4A
port. Update the documentation of support status and build
instructions.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoboard: thead: licheepi4a: Enable SPL support
Yao Zi [Tue, 13 May 2025 09:05:02 +0000 (09:05 +0000)] 
board: thead: licheepi4a: Enable SPL support

Adjust Kconfig and defconfig and add SPL initialization code for
Lichee Pi 4A. Then enable SPL support which we've added for TH1520 SoC
earlier. The board devicetree is changed to use TH1520 binman
configuration to generate bootable images.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: th1520: Add binman configuration
Yao Zi [Tue, 13 May 2025 09:05:01 +0000 (09:05 +0000)] 
riscv: dts: th1520: Add binman configuration

Add binman configuration for TH1520 SoC, whose BROM loads the image
combined into SRAM and directly jumps to it. The configuration creates
u-boot-with-spl.bin where the SPL code locates at the start and the DDR
firmware is shipped.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: th1520: Add DRAM controller
Yao Zi [Tue, 13 May 2025 09:05:00 +0000 (09:05 +0000)] 
riscv: dts: th1520: Add DRAM controller

Describe DRAM controller integrated in TH1520 SoC and preserve it in SPL
devicetree blob.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: lichee-module-4a: Preserve memory node for SPL
Yao Zi [Tue, 13 May 2025 09:04:59 +0000 (09:04 +0000)] 
riscv: dts: lichee-module-4a: Preserve memory node for SPL

Memory node is necessary for TH1520 SPL to configure size and base
address of DRAM. Let's preserve it in SPL devicetree blob.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: th1520: Preserve necessary devices for SPL
Yao Zi [Tue, 13 May 2025 09:04:58 +0000 (09:04 +0000)] 
riscv: dts: th1520: Preserve necessary devices for SPL

SPL for TH1520 requires CPU and boot UART nodes to function. Preserve
them in SPL devicetree blob with bootph-pre-ram property.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoram: thead: Add initial DDR controller support for TH1520
Yao Zi [Tue, 13 May 2025 09:04:57 +0000 (09:04 +0000)] 
ram: thead: Add initial DDR controller support for TH1520

This patch cleans the vendor code of DDR initialization up, converts the
driver to fit in DM framework and use a firmware[1] packaged by binman to
ship PHY configuration.

Currently the driver is only capable of initializing the controller to
work with dual-rank 3733MHz LPDDR4, which is shipped by 16GiB variants
of LicheePi 4A boards and I could test with. Support for other
configurations could be easily added later.

Link: https://github.com/ziyao233/th1520-firmware
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: cpu: Add TH1520 CPU support
Yao Zi [Tue, 13 May 2025 09:04:56 +0000 (09:04 +0000)] 
riscv: cpu: Add TH1520 CPU support

Introduce the SoC-specific code and corresponding Kconfig entries for
TH1520 SoC. Following features are implemented for TH1520,

- Cache enable/disable through customized CSR
- Invalidation of customized PMP entries
- DRAM driver probing for SPL

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoconfigs: th1520_lpi4a: Add UART clock frequency
Yao Zi [Tue, 13 May 2025 09:04:55 +0000 (09:04 +0000)] 
configs: th1520_lpi4a: Add UART clock frequency

The BROM of TH1520 always initializes UART0's parent clock and
configures the baudrate to 115200. Describe the clock frequency to make
UART function correctly in SPL without introducing CCF.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: lib: Split out support for T-Head cache management operations
Yao Zi [Tue, 13 May 2025 09:04:54 +0000 (09:04 +0000)] 
riscv: lib: Split out support for T-Head cache management operations

Designed before a standard set of cache management operations defined in
RISC-V, earlier T-Head cores like C906 and C910 provide CMO through the
customized extension XTheadCMO, which has been used in the CV1800B port
of U-Boot.

This patch splits XTheadCMO-related code into a generic module, allowing
SoCs shipping T-Head cores to share the code.

Link: https://github.com/XUANTIE-RV/thead-extension-spec
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: jh7110: override syscrg assigned clock rates with defaults
E Shattow [Sat, 10 May 2025 18:42:27 +0000 (11:42 -0700)] 
riscv: dts: jh7110: override syscrg assigned clock rates with defaults

JH7110 drivers are missing support for CPU frequency scaling, so override
upstream device-tree to use default clock rates for syscrg. This override
duplicates a portion of jh7110-common-u-boot.dtsi file planned for removal.

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Liang <ycliang@andestech.com>
2 months agoriscv: dts: jh7110: remove redundant parent nodes
E Shattow [Sat, 3 May 2025 21:25:54 +0000 (14:25 -0700)] 
riscv: dts: jh7110: remove redundant parent nodes

- use upstream alias name for cpu and timer nodes
- remove bootph-pre-ram hint from parent nodes
- drop S7 cpu core "okay" status

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: starfive: jh7110: move uart0 clock frequency to config header
E Shattow [Sat, 3 May 2025 11:52:52 +0000 (04:52 -0700)] 
riscv: starfive: jh7110: move uart0 clock frequency to config header

Move unnecessary clock frequency assignment out of device-tree and into the
board config header so that the ns16550 serial driver can successfully init
during SPL after failing to resolve the parent clock from upstream dts. The
serial driver will then resolve clock frequency from device-tree node parent
clock at init during Main app as it is expected by upstream.

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: insn-def.h: Fix header guard
Mayuresh Chitale [Mon, 28 Apr 2025 04:48:45 +0000 (04:48 +0000)] 
riscv: insn-def.h: Fix header guard

Fix the erroneous header guard for insn-def.h to reflect the correct
header name.

Fixes: bfc8ca3f7f6 ("riscv: Add support for defining instructions")
Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: Access gd with inline assembly when building with LTO or Clang
Yao Zi [Sun, 27 Apr 2025 14:50:11 +0000 (14:50 +0000)] 
riscv: Access gd with inline assembly when building with LTO or Clang

Similar to AArch64's case, Clang may wrongly fold accesses to gd pointer
which is defined with register qualifier into constants, breaking
various components.

This patch defines gd as a macro when building with Clang or LTO, which
expands to get_gd() that accesses gp pointer in assembly, making RISC-V
ports function properly and preparing for introduction of LTO in the
future. Board initialization code is also adapted for non-assignable gd.

Reported-by: Nathaniel Hourt <I@nathaniel.land>
Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: binman.dtsi: Drop filename property for proper U-Boot
Yao Zi [Sat, 26 Apr 2025 17:26:02 +0000 (17:26 +0000)] 
riscv: dts: binman.dtsi: Drop filename property for proper U-Boot

Drop filename property for proper U-Boot entry since binman takes
"u-boot-nodtb.bin" as the default filename for u-boot-nodtb entries.

This follows efe9c12322b ("riscv: dts: binman.dtsi: Switch to
u-boot-nodtb entry for proper U-Boot") to clean binman.dtsi up.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agobooti/bootm: riscv: Verify image arch type
Mayuresh Chitale [Fri, 4 Apr 2025 14:48:57 +0000 (14:48 +0000)] 
booti/bootm: riscv: Verify image arch type

Unlike ARM and X86, booting 32-bit images on 64-bit CPUs is currently
not supported for Risc-V. Hence, for bootm, disallow booting a FIT
or a legacy image that was built for an arch type which is different
than the current arch and for booti, set the arch type to be the
same as the current arch.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 months agoriscv: Select appropriate image type
Mayuresh Chitale [Fri, 4 Apr 2025 14:48:56 +0000 (14:48 +0000)] 
riscv: Select appropriate image type

Select between the 32-bit or 64-bit arch type for the image headers
depending on how the build is configured.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: image: Add new image type for RV64
Mayuresh Chitale [Fri, 4 Apr 2025 14:48:55 +0000 (14:48 +0000)] 
riscv: image: Add new image type for RV64

Similar to ARM and X86, introduce a new image type which allows u-boot
to distinguish between images built for 32-bit vs 64-bit Risc-V CPUs.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Maxim Moskalets <maximmosk4@gmail.com>
2 months agoMerge tag 'mmc-2025-05-20' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Tue, 20 May 2025 14:35:31 +0000 (08:35 -0600)] 
Merge tag 'mmc-2025-05-20' of https://source.denx.de/u-boot/custodians/u-boot-mmc

CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/26241

- Fix mmc cv1800b build without MMC_SUPPORTS_TUNING

2 months agommc: cv1800b: Fix build without MMC_SUPPORTS_TUNING
Alexander Sverdlin [Sun, 27 Apr 2025 21:46:19 +0000 (23:46 +0200)] 
mmc: cv1800b: Fix build without MMC_SUPPORTS_TUNING

That's how it looks like without CONFIG_MMC_SUPPORTS_TUNING before the
patch:

aarch64-buildroot-linux-gnu-ld.bfd: drivers/mmc/cv1800b_sdhci.o: in function `cv1800b_execute_tuning':
drivers/mmc/cv1800b_sdhci.c:47:(.text.cv1800b_execute_tuning+0x50): undefined reference to `mmc_send_tuning'

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>