]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
13 months agoarm: dts: k3-am62a-phycore-som-binman: Provide capsule nodes
Wadim Egorov [Wed, 5 Mar 2025 04:58:26 +0000 (05:58 +0100)] 
arm: dts: k3-am62a-phycore-som-binman: Provide capsule nodes

Fill in phycore-am62ax capsule GUID properties of the base
binman capsule nodes.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
13 months agovepxress64: add guide for running FVP with TF-A
Harrison Mutai [Tue, 4 Mar 2025 16:52:02 +0000 (16:52 +0000)] 
vepxress64: add guide for running FVP with TF-A

Add documentation on how to run FVP with U-Boot and TF-A. This helps
users configure and run U-Boot correctly on Arm models.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
13 months agovepxress64: disable CRC32 by default to prevent aborts
Harrison Mutai [Tue, 4 Mar 2025 16:52:01 +0000 (16:52 +0000)] 
vepxress64: disable CRC32 by default to prevent aborts

On fast models, the CRC32 feature is disabled by default. When enabled
in U-Boot, it leads to synchronous aborts due to unrecognized
instructions. This change ensures CRC32 is disabled by default to
maintain compatibility.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
13 months agosandbox_vpl: Enable missing TPL_DM_I2C symbol
Tom Rini [Tue, 4 Mar 2025 20:32:35 +0000 (14:32 -0600)] 
sandbox_vpl: Enable missing TPL_DM_I2C symbol

Currently this platform implicity builds CONFIG_TPL_DM_I2C support
without setting the symbol. Add it for clarity.

Signed-off-by: Tom Rini <trini@konsulko.com>
13 months agoserial: Add missing TPL_SYS_NS16550_SERIAL symbol
Tom Rini [Tue, 4 Mar 2025 20:24:36 +0000 (14:24 -0600)] 
serial: Add missing TPL_SYS_NS16550_SERIAL symbol

On PowerPC platforms with TPL enabled and SPL_SYS_NS16550_SERIAL
enabled, today this builds under TPL as well due to how $(XPL_) is
defined. Add the TPL_SYS_NS16550_SERIAL itself for consistency and
clarity.

Signed-off-by: Tom Rini <trini@konsulko.com>
13 months agoboard: beagle: Add support for BeagleY-AI
Robert Nelson [Mon, 3 Mar 2025 19:15:15 +0000 (13:15 -0600)] 
board: beagle: Add support for BeagleY-AI

Basic board support for BeagleY-AI. Information on this
board can be found at https://beagleboard.org/beagley-ai

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrew Davis <afd@ti.com>
13 months agomach-snapdragon: always select SYSRESET_PSCI for ARCH_SNAPDRAGON
Caleb Connolly [Tue, 18 Mar 2025 11:55:14 +0000 (11:55 +0000)] 
mach-snapdragon: always select SYSRESET_PSCI for ARCH_SNAPDRAGON

Since removing reset_cpu() in mach-snapdragon, all Qualcomm platforms
now depend on CONFIG_SYSRESET and will fail to build without it.

Move the dependency from qcom_defconfig to kconfig so that we use
SYSRESET for all platforms.

Fixes: 61a1a1b8ca73 ("mach-snapdragon: use PSCI sysreset driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoMerge patch series "lmb: miscellaneous fixes and improvements"
Tom Rini [Tue, 18 Mar 2025 01:39:36 +0000 (19:39 -0600)] 
Merge patch series "lmb: miscellaneous fixes and improvements"

Sughosh Ganu <sughosh.ganu@linaro.org> says:

The patch series contains some fixes and improvements in the lmb
code, along with addition of corresponding test cases for the changes
made.

The lmb_reserve() function currently does not check if the requested
reservation would overlap with existing reserved regions. While some
scenarios are being handled, some corner cases still exist. These are
being handled by patch 1, along with adding test cases for these
scenarios.

Patch 2 is handling the case of reserving a new region of memory, but
that region overlaps with an existing region. The current code only
handles one particular scenario, but prints a message for the other
scenario of an encompassing overlap and returns back. The patch
handles the encompassing overlap.

Patch 3 is an improvement whereby we allow coalescing a newly reserved
region with an existing region. The current code exits this check
prematurely.

Patch 4 is removing a now superfluous check for overlapping regions
with flag other than LMB_NONE. This now gets handled at an earlier
point in lmb_reserve().

Patch 5 is clubbing the functionality to check if two regions are
adjacent, or overlap, allowing some code re-use.

Patch 6 is optimising the lmb_alloc() function by having it call
_lmb_alloc_base() directly.

Link: https://lore.kernel.org/r/20250303133231.405279-1-sughosh.ganu@linaro.org
13 months agolmb: optimise the lmb allocation functions
Sughosh Ganu [Mon, 3 Mar 2025 13:32:31 +0000 (19:02 +0530)] 
lmb: optimise the lmb allocation functions

The actual logic to allocate a region of memory is in the
_lmb_alloc_base() function. The lmb_alloc() API function calls
lmb_alloc_base(), which then calls _lmb_alloc_base() to do the
allocation. Instead, call the _lmb_alloc_base() directly from both the
allocation API's, and move the error message to the _lmb_alloc_base().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agolmb: use a common function to check if regions overlap or are adjacent
Sughosh Ganu [Mon, 3 Mar 2025 13:32:30 +0000 (19:02 +0530)] 
lmb: use a common function to check if regions overlap or are adjacent

The functions to check if the two said regions are adjacent or overlap
are pretty similar in nature. Club the functionality into a single
function lmb_regions_check() and return the appropriate return value
to signify this aspect.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agolmb: remove superfluous address overlap check from lmb_add_region_flags()
Sughosh Ganu [Mon, 3 Mar 2025 13:32:29 +0000 (19:02 +0530)] 
lmb: remove superfluous address overlap check from lmb_add_region_flags()

U-Boot allows re-use of already reserved memory through the
lmb_reserve() and lmb_alloc_addr() API's. This memory re-use is
allowed only when the flag of the existing reserved region and that of
the requested region is LMB_NONE. A check was put in the
lmb_add_region_flags() in commit 8b8b35a4f5e to handle the scenario
where an already reserved region was re-requested with region flag
other than LMB_NONE -- the function then returns -EEXIST in such a
scenario.

The lmb_reserve() function now does a check for a reservation request
with existing reserved regions, and returns -EEXIST in case of an
overlap but when the flag check fails. Remove this now redundant check
from lmb_add_region_flags().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
13 months agolmb: check for a region's coalescing with all existing regions
Sughosh Ganu [Mon, 3 Mar 2025 13:32:28 +0000 (19:02 +0530)] 
lmb: check for a region's coalescing with all existing regions

The lmb_add_region_flags() first checks if the new region to be added
can be coalesced with existing regions. The check stops if the two
regions are adjecent but their flags do not match. However, it is
possible that the newly added region might be adjacent with the next
existing region and with matching flags. Check for this possibility by
not breaking out of the loop.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agolmb: handle scenario of encompassing overlap
Sughosh Ganu [Mon, 3 Mar 2025 13:32:27 +0000 (19:02 +0530)] 
lmb: handle scenario of encompassing overlap

The lmb_fix_over_lap_regions() function is called if the added region
overlaps with an existing region. The function then fixes the overlap
and removes the redundant region. However, it makes certain
assumptions. One assumption is that the overlap would not encompass
the existing region. Another assumption is that the overlap only
occurs between two regions -- the scenario of the added region
overlapping multiple existing regions is not being handled. Handle
these cases by instead calling lmb_resize_regions(). Also remove the
now superfluous lmb_fix_over_lap_regions().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agolmb: check if a region can be reserved by lmb_reserve()
Sughosh Ganu [Mon, 3 Mar 2025 13:32:26 +0000 (19:02 +0530)] 
lmb: check if a region can be reserved by lmb_reserve()

The logic used in lmb_alloc() takes into consideration the existing
reserved regions, and ensures that the allocated region does not
overlap with any existing allocated regions. The lmb_reserve()
function is not doing any such checks -- the requested region might
overlap with an existing region. This also shows up with
lmb_alloc_addr() as this function ends up calling lmb_reserve().

Add a function which checks if the region requested is overlapping
with an existing reserved region, and allow for the reservation to
happen only if both the regions have LMB_NONE flag, which allows
re-requesting of the region. In any other scenario of an overlap, have
lmb_reserve() return -EEXIST, implying that the requested region is
already reserved.

Add corresponding test cases which check for overlapping reservation
requests made through lmb_reserve() and lmb_alloc_addr(). And while
here, fix some of the comments in the test function being touched.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agoMerge branch 'next' of git://source.denx.de/u-boot-usb into next
Tom Rini [Mon, 17 Mar 2025 16:18:59 +0000 (10:18 -0600)] 
Merge branch 'next' of git://source.denx.de/u-boot-usb into next

- Add USB support on Starfive JH7110

13 months agoMerge branch 'nand-next' of https://source.denx.de/u-boot/custodians/u-boot-nand...
Tom Rini [Mon, 17 Mar 2025 16:18:18 +0000 (10:18 -0600)] 
Merge branch 'nand-next' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash into next

CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/25178

This merge request add support for cadence raw nand driver for agilex
board and add a fix to meson driver.

13 months agoclk/stub: add sc7280-rpmh clock
Caleb Connolly [Mon, 17 Mar 2025 15:54:36 +0000 (15:54 +0000)] 
clk/stub: add sc7280-rpmh clock

Stub the RPMh clock controller on SC7280

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agopinctrl/qcom: fix kconfig option names
Caleb Connolly [Mon, 17 Mar 2025 13:25:14 +0000 (13:25 +0000)] 
pinctrl/qcom: fix kconfig option names

A copy-paste error is starting to get out of hand... Fix all these so
they don't look like clock drivers in menuconfig.

Link: https://lore.kernel.org/r/20250317132519.46080-1-caleb.connolly@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: sc7280: add GENI, PCIe, and more USB clocks
Caleb Connolly [Fri, 14 Mar 2025 15:31:21 +0000 (15:31 +0000)] 
clk/qcom: sc7280: add GENI, PCIe, and more USB clocks

Add support for a bunch of new clocks, including PCIe, GENI (for all
peripherals used on the RB3 Gen 2), and some missing USB clocks.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250314-sc7280-more-clocks-v1-3-ead54487c38e@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: sc7280: add some debug data
Caleb Connolly [Fri, 14 Mar 2025 15:31:20 +0000 (15:31 +0000)] 
clk/qcom: sc7280: add some debug data

Dump a few PCIe and USB clocks

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250314-sc7280-more-clocks-v1-2-ead54487c38e@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: bubble up qcom_gate_clk_en() errors
Caleb Connolly [Fri, 14 Mar 2025 15:31:19 +0000 (15:31 +0000)] 
clk/qcom: bubble up qcom_gate_clk_en() errors

If we try to enable a gate clock that doesn't exist, we used to just
fail silently. This may make sense for early bringup of some core
peripherals that we know are already enabled, but it only makes
debugging missing clocks more difficult.

Bubble up errors now that qcom_gate_clk_en() can return an error code to
catch any still-missing clocks and make it easier to find missing ones
as more complicated peripherals are enabled.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250314-sc7280-more-clocks-v1-1-ead54487c38e@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agocmd: version: Get information about GCC and LD back
Michal Simek [Thu, 6 Mar 2025 10:12:30 +0000 (11:12 +0100)] 
cmd: version: Get information about GCC and LD back

U-Boot version command is no longer showing information about GCC and LD.
The reason is that version.h has been removed that's why CC_VERSION_STRING
and LD_VERSION_STRING are not pass.
Values are generated to generated/version_autogenerated.h which is sourced
in version.h.

Fixes: 54ecce2cbf90 ("version: Separate our version string from the version command")
Signed-off-by: Michal Simek <michal.simek@amd.com>
13 months agoMerge tag 'efi-2025-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Mon, 17 Mar 2025 14:00:40 +0000 (08:00 -0600)] 
Merge tag 'efi-2025-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-04-rc5

CI:

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

UEFI:

* Export _start symbol from crt0_*_efi stubs
* Move .dynamic out of .text in EFI
* scripts/Makefile.lib: Preserve the .dynstr section as well

Documentation:

* net: miiphybb: Convert documentation to rst

13 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 17 Mar 2025 13:59:39 +0000 (07:59 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

These are mainly DBSC5 DRAM controller specific fixes and updates for
current release. There is the long overdue BL31 start V4H board code as
well, that should be in the current release to make the V4H White Hawk
board usable with SPL, and a fallback U-Boot PSCI implementation
enablement to make sure the board always boots. And finally, there are
two comment fixes.

13 months agoqcom_defconfig: enable SYSRESET_QCOM_PSHOLD
Sam Day [Sat, 25 Jan 2025 19:59:27 +0000 (19:59 +0000)] 
qcom_defconfig: enable SYSRESET_QCOM_PSHOLD

MSM8916 devices use this instead of PSCI.

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250125-msm8916-sysreset-v1-3-62073932ff0e@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agosysreset: qcom-pshold: remove ARCH_IPQ40XX dependency
Sam Day [Sat, 25 Jan 2025 19:59:20 +0000 (19:59 +0000)] 
sysreset: qcom-pshold: remove ARCH_IPQ40XX dependency

Depending on ARCH_IPQ40XX is too restrictive, as this architecture is
explicitly armv7. This driver is also used on msm8916 devices, which
have cortex-a53 armv8 cores.

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250125-msm8916-sysreset-v1-2-62073932ff0e@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agomach-snapdragon: use PSCI sysreset driver
Sam Day [Sat, 25 Jan 2025 19:59:15 +0000 (19:59 +0000)] 
mach-snapdragon: use PSCI sysreset driver

Drop the `board_reset` function from mach-snapdragon board code, and
instead use the standard PSCI sysreset driver.

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250125-msm8916-sysreset-v1-1-62073932ff0e@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoqcom_defconfig: enable PINCTRL_QCOM_SC7280
Caleb Connolly [Wed, 22 Jan 2025 15:02:52 +0000 (16:02 +0100)] 
qcom_defconfig: enable PINCTRL_QCOM_SC7280

Acked-by: Christopher Obbard <christopher.obbard@linaro.org>
Link: https://lore.kernel.org/r/20250122-pinctrl-sc7280-v1-2-8bdba72e6366@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agopinctrl: qcom: add sc7280 pinctrl driver
Caleb Connolly [Wed, 22 Jan 2025 15:02:51 +0000 (16:02 +0100)] 
pinctrl: qcom: add sc7280 pinctrl driver

Introduce a pinctrl driver for SC7280/QCM6490, this is used by the RB3
Gen 2, FairPhone 5 and other devices.

Tested-by: Christopher Obbard <christopher.obbard@linaro.org>
Link: https://lore.kernel.org/r/20250122-pinctrl-sc7280-v1-1-8bdba72e6366@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agomach-snapdragon: handle platforms without PSCI support
Sam Day [Mon, 27 Jan 2025 14:48:55 +0000 (14:48 +0000)] 
mach-snapdragon: handle platforms without PSCI support

Most MSM8916 devices shipped without PSCI support. The history is quite
nuanced (a good overview can be found in [1]), but the end result is
that the upstream DTs for this SoC pretend that PSCI exists, and it's
expected that the bootloader handles the case where it doesn't. This is
codified by the de-facto bootloader for MSM8916 devices, lk2nd [2].

So we handle it here by deleting the /psci node if we detect the absence
of PSCI. We need to do this early to ensure sysreset works correctly,
since the PSCI firmware driver is PRE_RELOC and binds the PSCI sysreset
driver.

Additionally, show_psci_version is updated to check that PSCI exists.
Currently this banner outputs "PSCI: 65535.65535" on devices without
PSCI support, which isn't very useful :)

[1]: https://github.com/msm8916-mainline/linux/issues/388
[2]: https://github.com/msm8916-mainline/lk2nd/blob/8183ea2/lk2nd/smp/spin-table/spin-table.c#L237

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250127-qcom-handle-absent-psci-v1-1-e762f2db938c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agomach-snapdragon: support parsing memory info from external FDT
Sam Day [Thu, 23 Jan 2025 12:12:14 +0000 (12:12 +0000)] 
mach-snapdragon: support parsing memory info from external FDT

qcom_parse_memory is updated to return a -ENODATA error if the passed
FDT does not contain a /memory node, or that node is incomplete (size=0)

board_fdt_blob_setup first tries to call qcom_parse_memory with the
internal FDT (if present+valid). If that fails, it tries again with the
external FDT (again, if present+valid).

When booting with an internal FDT from upstream, it's likely that this
change results in a slight performance hit, since virtually all upstream
qcom DTs lack a fully specified memory node. The impact should be
negligible, though.

qcom_parse_memory was given a detailed docstring adapted from Caleb's
original commit message that introduced the function.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250123-qcom-parse-memory-updates-v3-1-c5332b81ea9f@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agorng: msm: keep core clock disabled when PRNG not in use
Sam Day [Wed, 12 Feb 2025 07:01:55 +0000 (07:01 +0000)] 
rng: msm: keep core clock disabled when PRNG not in use

This is how the kernel does it. APQ8016E TRM also states that this clock
can be turned off when no random numbers are needed.

Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250212-msm-rng-fixes-v2-5-645cf8d3fd3c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: apq8016: improve clk_enable logging
Sam Day [Wed, 12 Feb 2025 07:01:47 +0000 (07:01 +0000)] 
clk/qcom: apq8016: improve clk_enable logging

Properly warn when an unknown clock is enabled.

Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250212-msm-rng-fixes-v2-4-645cf8d3fd3c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agorng: msm: don't enable PRNG if it's already enabled
Sam Day [Wed, 12 Feb 2025 07:01:39 +0000 (07:01 +0000)] 
rng: msm: don't enable PRNG if it's already enabled

msm_rng_enable is supposed to skip writing to LFSR_CFG + CONFIG
registers in the PRNG_ block if PRNG_CONFIG_HW_ENABLE is already set.
The logic to test for this was inverted.

Without this fix, the driver was causing SError aborts on my MSM8916
device. Stephan Gerhold suggested this was probably because TZ has
marked this as a protected register, since it would also be using it for
RNG.

Fixes: 033ec636fcb ("rng: Add Qualcomm MSM PRNG driver")
Suggested-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250212-msm-rng-fixes-v2-3-645cf8d3fd3c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: apq8016: add PRNG_AHB_CLK
Sam Day [Wed, 12 Feb 2025 07:01:33 +0000 (07:01 +0000)] 
clk/qcom: apq8016: add PRNG_AHB_CLK

This clock needs to be enabled for the msm-rng driver to work on
MSM8916, otherwise accessing the PRNG register block causes a data
abort.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250212-msm-rng-fixes-v2-2-645cf8d3fd3c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: apq8016: use BIT macro for clk en_vals
Sam Day [Wed, 12 Feb 2025 07:01:27 +0000 (07:01 +0000)] 
clk/qcom: apq8016: use BIT macro for clk en_vals

This reads a little bit nicer (IMO), and is consistent with the kernel.

Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250212-msm-rng-fixes-v2-1-645cf8d3fd3c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoconfigs: add qcom_ipq9574_mmc_defconfig
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:05 +0000 (12:15 +0530)] 
configs: add qcom_ipq9574_mmc_defconfig

Introduce a defconfig for the Qualcomm IPQ9574 SoC based RDPs.
Presently supports eMMC.

Per the flash memory layout, U-Boot size cannot exceed 756KB. With this
defconfig, u-boot.mbn size is ~480KB.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-8-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agommc: msm_sdhci: Reset clocks before reconfiguration
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:04 +0000 (12:15 +0530)] 
mmc: msm_sdhci: Reset clocks before reconfiguration

U-Boot has to reconfigure the clocks that were set in the boot
loaders. However, in IPQ9574, the clocks have to be reset before
they can be reconfigured. Hence add code to do the relevant
resets.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-7-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agopinctrl: qcom: Add ipq9574 pinctrl driver
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:03 +0000 (12:15 +0530)] 
pinctrl: qcom: Add ipq9574 pinctrl driver

Add pinctrl driver for the TLMM block found in the ipq9574 SoC.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-6-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agopinctrl: qcom: Handle get_function_mux failure
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:02 +0000 (12:15 +0530)] 
pinctrl: qcom: Handle get_function_mux failure

Presently, get_function_mux returns an unsigned int and cannot
differentiate between failure and correct function value. Change its
return type to int and check for failure in the caller.

Additionally, updated drivers/pinctrl/qcom/pinctrl-*.c to accommodate the
above return type change. Only compile test done.

Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-5-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoclk/qcom: add initial clock driver for ipq9574
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:01 +0000 (12:15 +0530)] 
clk/qcom: add initial clock driver for ipq9574

Add initial set of clocks and resets for enabling U-Boot on ipq9574
based RDP platforms.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-4-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agodts: ipq9574-rdp433-u-boot: add override dtsi
Varadarajan Narayanan [Wed, 26 Feb 2025 06:45:00 +0000 (12:15 +0530)] 
dts: ipq9574-rdp433-u-boot: add override dtsi

Add initial support for the IPQ9574 MMC based RDP platforms.
Define memory layout statically.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-3-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agodoc: board/qualcomm: document RDP building/flashing
Varadarajan Narayanan [Wed, 26 Feb 2025 06:44:59 +0000 (12:14 +0530)] 
doc: board/qualcomm: document RDP building/flashing

Introducing basic support for Qualcomm IPQxxx based RDPs.
Document the build and flashing steps.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-2-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
13 months agoscripts/Makefile.lib: efi: Preserve the .dynstr section as well
Sam Edwards [Sat, 15 Mar 2025 22:18:11 +0000 (15:18 -0700)] 
scripts/Makefile.lib: efi: Preserve the .dynstr section as well

This section is required by .dynamic and llvm-objcopy will exit with a
fatal error if it is not also preserved in the output.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
13 months agoefi_loader: Move .dynamic out of .text in EFI
Sam Edwards [Sat, 15 Mar 2025 22:18:10 +0000 (15:18 -0700)] 
efi_loader: Move .dynamic out of .text in EFI

EFI applications need to be relocatable. Ordinarily, this is achieved
through a PE-format .reloc section, but since that requires toolchain
tricks to achieve, U-Boot's EFI applications instead embed ELF-flavored
relocation information and use it for self-relocation; thus, the
.dynamic section needs to be preserved.

Before this patch, it was tacked on to the end of .text, but this was
not proper: A .text section is SHT_PROGBITS, while the .dynamic section
is SHT_DYNAMIC. Attempting to combine them like this creates a section
type mismatch. While GNU ld doesn't seem to complain, LLVM's lld
considers this a fatal linking error.

This patch moves .dynamic out to its own section, so that the output ELF
has the correct types. (They're all mashed together when converting to
binary anyway, so this patch causes no change in the final .efi output.)

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agoarm: riscv: efi: Export _start symbol from crt0_*_efi stubs
Sam Edwards [Sat, 15 Mar 2025 22:18:09 +0000 (15:18 -0700)] 
arm: riscv: efi: Export _start symbol from crt0_*_efi stubs

While the _start label is only intended for use locally to populate the
(hand-written) PE header, the linker script includes ENTRY(_start) which
designates it as the entry point in the output ELF, resulting in linker
warnings under some linkers (e.g. LLVM's lld) due to _start not being a
globally-visible symbol. Since  ELF is only an intermediary build
format, and the aforementioned PE header correctly points to _start, the
ENTRY(_start) directive could easily be removed to silence this warning.

However, since some developers who are debugging EFI by analyzing the
intermediary ELF may appreciate having correct entry-point information,
this patch instead promotes the _start labels to global symbols,
silencing the linker warning and making the intermediary ELF reflect the
true entry point.

This patch doesn't affect the final output binaries in any way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
13 months agonet: miiphybb: Convert documentation to rst
Marek Vasut [Sat, 8 Mar 2025 20:49:42 +0000 (21:49 +0100)] 
net: miiphybb: Convert documentation to rst

Convert the current miiphybb documentation to rst. Rename
the README.bitbangMII to bitbangmii.rst in the process.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
13 months agoconfigs: starfive: Add visionfive2 cadence USB configuration
Minda Chen [Thu, 6 Mar 2025 06:20:31 +0000 (14:20 +0800)] 
configs: starfive: Add visionfive2 cadence USB configuration

Add cadence USB confiuration.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
13 months agospl: starfive: visionfive2: Disable USB overcurrent pin by default.
Minda Chen [Thu, 6 Mar 2025 06:20:30 +0000 (14:20 +0800)] 
spl: starfive: visionfive2: Disable USB overcurrent pin by default.

For some JH7110 boards, USB host overcurent pin is not reserved,
To make USB host work, overcurrent pin must be disabled. So set the
pin default disabled in spl stage.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
13 months agousb: cdns: starfive: Add cdns USB driver
Minda Chen [Thu, 6 Mar 2025 06:20:29 +0000 (14:20 +0800)] 
usb: cdns: starfive: Add cdns USB driver

Add Starfive cdns USB3 wrapper driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: E Shattow <lucent@gmail.com>
13 months agousb: cdns: starfive: Get dr mode from wrapper device dts node
Minda Chen [Thu, 6 Mar 2025 06:20:28 +0000 (14:20 +0800)] 
usb: cdns: starfive: Get dr mode from wrapper device dts node

Cdns core driver also get dr mode from wrapper devcie dts node
to make it is same with Starfive cdns USB Linux kernel driver,
Starfive 7110 OF_UPSTREAM is enabled

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
13 months agophy: starfive: Add Starfive JH7110 PCIe 2.0 PHY driver
Minda Chen [Thu, 6 Mar 2025 06:20:27 +0000 (14:20 +0800)] 
phy: starfive: Add Starfive JH7110 PCIe 2.0 PHY driver

Add Starfive JH7110 PCIe 2.0 PHY driver, which is generic
PHY driver and can be used as USB 3.0 driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
13 months agophy: starfive: Add Starfive JH7110 USB 2.0 PHY driver
Minda Chen [Thu, 6 Mar 2025 06:20:26 +0000 (14:20 +0800)] 
phy: starfive: Add Starfive JH7110 USB 2.0 PHY driver

Add Starfive JH7110 USB 2.0 PHY driver, which is generic
PHY driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Tested-by: E Shattow <lucent@gmail.com>
13 months agousb: cdns3: Set USB PHY mode in cdns3_drd_update_mode()
Minda Chen [Thu, 6 Mar 2025 06:20:25 +0000 (14:20 +0800)] 
usb: cdns3: Set USB PHY mode in cdns3_drd_update_mode()

USB PHY maybe need to set PHY mode in different USB
dr mode. So translate USB PHY mode to generic PHY mode
and call generic_phy_set_mode().

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
13 months agoram: renesas: dbsc5: Make struct renesas_dbsc5_board_config public
Marek Vasut [Sun, 16 Mar 2025 13:51:44 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Make struct renesas_dbsc5_board_config public

Make struct renesas_dbsc5_board_config {} definition public via
include/dbsc5.h, so this structure can be defined in board files
and passed into the DBSC5 DRAM driver by overriding weak function
dbsc5_get_board_data() on board level.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoram: renesas: dbsc5: Add V4H-3/V4H-5/V4H-7 OTP based detection
Marek Vasut [Sun, 16 Mar 2025 13:51:43 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Add V4H-3/V4H-5/V4H-7 OTP based detection

Add auto-detection and handling of Renesas R-Car V4H-3 and V4H-5
in addition to V4H-7 SoC variants based on OTP fuse programming.
The V4H-3 and V4H-5 variants have reduced DRAM frequency options.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoram: renesas: dbsc5: Synchronize initialization code to rev.1.10
Marek Vasut [Sun, 16 Mar 2025 13:51:42 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Synchronize initialization code to rev.1.10

Update the DRAM initialization code to match DBSC5 initialization code
rev.1.10 , which is currently the latest version available. This makes
DRAM initialization operational on Renesas R-Car V4H R8A779G0 rev.3.0.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoram: renesas: dbsc5: Fix DBTR11 calculation
Marek Vasut [Sun, 16 Mar 2025 13:51:41 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Fix DBTR11 calculation

Reinstate missing increment by two in DBTR11 calculation based
on the original DBSC5 initialization code rev.0.80. The original
code did ... ODTLon - (js2[JS2_tODTon_min] - 1) + 1 , which was
incorrectly converted into ODTLon - js2[JS2_tODTon_min], but
should have been converted to ODTLon - js2[JS2_tODTon_min] + 2.
Add the missing +2 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoram: renesas: dbsc5: Fix JS1 index calculation
Marek Vasut [Sun, 16 Mar 2025 13:51:40 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Fix JS1 index calculation

The JS1 index is calculated correctly, but the limiter cannot
be the max() function because the index should be lower than
JS1_USABLEC_SPEC_HI and the max() function would unconditionally
override the JS1 index to JS1_USABLEC_SPEC_HI. Use clamp() to
limit the JS1 index instead.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoram: renesas: dbsc5: Fix bitrate MD pin parsing
Marek Vasut [Sun, 16 Mar 2025 13:51:39 +0000 (14:51 +0100)] 
ram: renesas: dbsc5: Fix bitrate MD pin parsing

Fix copy paste error in MD pin handling for 5500 Mbps and 4800 Mbps case,
each should be handled by MD[19,17] == 2 and MD[19,17] == 3 respectively.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoarm64: dts: renesas: Make OTP available in SPL on R8A779G0 V4H
Marek Vasut [Sun, 16 Mar 2025 13:51:38 +0000 (14:51 +0100)] 
arm64: dts: renesas: Make OTP available in SPL on R8A779G0 V4H

The DBSC5 DRAM controller driver needs access to OTP fuses to discern
Renesas R-Car V4H-3, V4H-5 and V4H-7 SoC variants based on OTP fuse
programming. Make OTP block DT node available in U-Boot SPL DT so the
DBSC5 driver can determine its base address and read out the OTP fuses.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoarm64: renesas: Drop stale R-Car V4H SPL implementation description
Marek Vasut [Sun, 16 Mar 2025 13:51:09 +0000 (14:51 +0100)] 
arm64: renesas: Drop stale R-Car V4H SPL implementation description

The R-Car V4H SPL implementation was originally running on the Cortex-R52
core, but this is no longer the case. Majority of the SPL now runs on the
Cortex-A76 core. Drop the stale description.

Fixes: ec53fdee5bec ("arm64: renesas: Add Renesas R-Car V4H SPL implementation")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoARM: renesas: Drop stale common Makefile description
Marek Vasut [Sun, 16 Mar 2025 13:50:41 +0000 (14:50 +0100)] 
ARM: renesas: Drop stale common Makefile description

Remove stale Makefile description, this used to be valid for the
original Makefile from which the common Makefile was made generic,
but is no longer applicable to the common Makefile.

Fixes: c7d2d7f90a91 ("ARM: renesas: Simplify board Makefiles")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoarm64: renesas: Enable fallback PSCI on Renesas R-Car R8A779G0 V4H White Hawk
Marek Vasut [Sun, 2 Mar 2025 22:30:02 +0000 (23:30 +0100)] 
arm64: renesas: Enable fallback PSCI on Renesas R-Car R8A779G0 V4H White Hawk

Enable fallback PSCI provider on Renesas R-Car R8A779G0 V4H White Hawk board.

This fallback PSCI provider provides basic PSCI interface which can be used
by the Linux kernel, but does not provide support for bringing up additional
CPU cores or any other functionality, except for SoC level reset.

This fallback PSCI provider is intended as a fallback in case a proper PSCI
provider is not started before the Linux kernel is started. Linux kernel on
ARMv8a will fail to boot in case a PSCI provider is not available, and this
basic fallback PSCI provider assures such a boot failure cannot occur, even
if that means the system will boot in degraded mode with only one CPU core
available, that is still sufficient to perform recovery.

In the common case, a proper PSCI provider should be started as part of
the Linux kernel fitImage, as the BL31 loadable, and replace this basic
fallback PSCI provider before the Linux kernel is started.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agoarm64: renesas: Add TFA BL31 handoff support on Renesas R-Car Gen4
Marek Vasut [Sun, 2 Mar 2025 20:59:11 +0000 (21:59 +0100)] 
arm64: renesas: Add TFA BL31 handoff support on Renesas R-Car Gen4

Implement custom U_BOOT_FIT_LOADABLE_HANDLER and armv8_switch_to_el2_prep()
handling in case the TFA was loaded. The loadables handler sets up custom
handoff structure used by Renesas TFA fork in fixed location in DRAM and
indicates the TFA has been loaded.

The custom armv8_switch_to_el2_prep() handling tests whether the TFA BL31
was previously loaded and the custom handoff structure was set up, and if
so, jumps to TFA BL31 which switches from EL3 to EL2 and then returns to
U-Boot just past bl in armv8_switch_to_el2() to finish starting the Linux
kernel.

The jump to Linux through TFA works in such a way that the custom
armv8_switch_to_el2_prep() handler configures the custom handoff structure
such that the target jump address of the TFA BL31 on exit is set to the
armv8_switch_to_el2() + 4, which is just past the bl, and just before the
U-Boot code which implements the Linux kernel boot from either EL. The
registers passed through the TFA BL31 are all the registers passed into
armv8_switch_to_el2_prep() to assure maximum compatibility with all the
boot modes. The armv8_switch_to_el2_prep() handler jumps to the TFA BL31,
which does its setup, drops EL from EL3 to EL2 and finally jumps to the
armv8_switch_to_el2() + 4 entry point, which then allows U-Boot to boot
the Linux kernel the usual way.

In order to build suitable kernel fitImage, build TFA first, upstream
is currently under review:
https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/35799
Or if necessary, downstream repository:
remote: https://github.com/renesas-rcar/arm-trusted-firmware.git
branch: rcar_gen4_v2.7_v4x

```
$ git clean -fqdx
$ MBEDTLS_DIR=/path/to/mbedtls/ make -j$(nproc) bl31 \
PLAT=rcar_gen4 ARCH=aarch64 LSI=V4H SPD=none \
CTX_INCLUDE_AARCH32_REGS=0 MBEDTLS_COMMON_MK=1 \
PTP_NONSECURE_ACCESS=1 LOG_LEVEL=20 DEBUG=0 \
ENABLE_ASSERTIONS=0 E=0
```

Build Linux kernel Image and device tree from current mainline Linux
kernel repository, obtain 'Image' and 'r8a779g0-white-hawk.dtb' .

Bundle the files together using provided fit-image.its fitImage description:
```
$ mkimage -f fit-image.its fitImage
```

To start the kernel fiImage generated in previous step, load fitImage
to DRAM and use the 'bootm' command to start it:
=> load 0x58000000 ... fitImage && bootm 0x58000000

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
13 months agomtd: rawnand: meson: always use OOB bytes during write
Arseniy Krasnov [Sun, 22 Dec 2024 21:23:29 +0000 (00:23 +0300)] 
mtd: rawnand: meson: always use OOB bytes during write

If 'oob_required' is not set by the caller (for example 'oobbuf' is NULL),
then driver doesn't copy OOB data from 'oob_poi' to special controller
structures, so zeroes will be written as OOB. But, generic raw NAND logic
in 'nand_base.c' already handles case when OOB is not required to write by
filling 'oob_poi' with 0xFF's. So let's remove 'oob_required' check to
always read 'oob_poi' data for OOB.

Kernel driver (drivers/mtd/nand/raw/meson_nand.c) works in the same way,
so need to keep same behaviour here.

Fixes: c2e8c4d09a7a ("mtd: rawnand: Meson NAND controller support")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
13 months agoMerge tag 'dm-pull-15mar25' of git://git.denx.de/u-boot-dm into next
Tom Rini [Sat, 15 Mar 2025 14:19:31 +0000 (08:19 -0600)] 
Merge tag 'dm-pull-15mar25' of git://git.denx.de/u-boot-dm into next

Sync up on test renames

13 months agotest: Make net tests depend on CONFIG_CMD_NET
Simon Glass [Sun, 9 Feb 2025 16:07:19 +0000 (09:07 -0700)] 
test: Make net tests depend on CONFIG_CMD_NET

This fails on samus_tpl as there is no 'net' command.

   => net list
   Unknown command 'net' - try 'help' !

Fix it by adding a condition for the test.

Add a blank line to keep pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agotest/py: Show info about module-loading
Simon Glass [Sun, 9 Feb 2025 16:07:18 +0000 (09:07 -0700)] 
test/py: Show info about module-loading

It is sometimes tricky to figure out what modules test.py is loading
when it starts up. The result can be a silent failure with no clue as to
what when wrong.

Add a section which lists the modules loaded as well as those not
found.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agotest/py: Drop assigning ubman to cons
Simon Glass [Sun, 9 Feb 2025 16:07:17 +0000 (09:07 -0700)] 
test/py: Drop assigning ubman to cons

Now that we have a shorter name, we don't need this sort of thing. Just
use ubman instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
13 months agotest/py: Drop importing utils as util
Simon Glass [Sun, 9 Feb 2025 16:07:16 +0000 (09:07 -0700)] 
test/py: Drop importing utils as util

Now that we have a shorter name, we don't need this sort of thing.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android
13 months agotest/py: Drop u_boot_ prefix on test files
Simon Glass [Sun, 9 Feb 2025 16:07:15 +0000 (09:07 -0700)] 
test/py: Drop u_boot_ prefix on test files

We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
13 months agotest/py: Shorten u_boot_console
Simon Glass [Sun, 9 Feb 2025 16:07:14 +0000 (09:07 -0700)] 
test/py: Shorten u_boot_console

This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.

But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.

It would be too confusing to use con as it would be confused with
config and it is probably too short.

So shorten it to 'ubman'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
13 months agoconfigs: nand2_defconfig: Enable configs for nand boot
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:27 +0000 (00:18 +0800)] 
configs: nand2_defconfig: Enable configs for nand boot

Enable configs for nand boot.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: Kconfig: Add SYS_NAND_PAGE_SIZE dependency
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:32 +0000 (00:18 +0800)] 
drivers: mtd: nand: Kconfig: Add SYS_NAND_PAGE_SIZE dependency

Add SYS_NAND_PAGE_SIZE dependency for cadence NAND.
This config is needed as the SPL driver will use this parameter
to read uboot-proper image in NAND during booting.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: Enabled Kconfig and Makefile for Cadence-SPL
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:30 +0000 (00:18 +0800)] 
drivers: mtd: nand: Enabled Kconfig and Makefile for Cadence-SPL

Enable the Kconfig and Makefile for the Cadence-Nand
SPL support in agilex5 family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: spl: Add support for nand SPL load image
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:29 +0000 (00:18 +0800)] 
drivers: mtd: nand: spl: Add support for nand SPL load image

Add support for spl nand to load binary image from NAND
to RAM. Leverage the existing nand_spl_load_image from nand_spl_loaders.c

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: base: Add support for Hardware ECC for check bad block
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:28 +0000 (00:18 +0800)] 
drivers: mtd: nand: base: Add support for Hardware ECC for check bad block

Leverage linux code to support hardware ECC interface
to verify nand bad block.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: nand: Enabled Kconfig and Makefile for cdns-nand
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:26 +0000 (00:18 +0800)] 
drivers: nand: Enabled Kconfig and Makefile for cdns-nand

Enable the Kconfig and Makefile for the
Cadence NAND driver for the agilex5 family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Use bounce buffer
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:25 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Use bounce buffer

Enable nand to use bounce buffer. In bounce buffer,
read/write buf will use cadence->buf which has been allocated
using malloc. This will align the memory and avoid memory to be
allocated in different addresses.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Poll for desc complete status
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:24 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Poll for desc complete status

Poll for thread complete status to ensure the
descriptor processing is complete. If complete then can ensure
controller already update the descriptor status.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Flush & invalidate dma descriptor
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:23 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Flush & invalidate dma descriptor

Ensure ddr memory is updated with the data from dcache.
This would help to ensure cdma always reading the latest dma descriptor
from ddr memory.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Support cmd SET_FEATURES & GET_FEATURES
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:22 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Support cmd SET_FEATURES & GET_FEATURES

Support NAND_CMD_SET_FEATURES & NAND_CMD_GET_FEATURES.
These commands is one of the basic commands of NAND. The parameters get
from these commands will be used to set timing mode
of NAND data interface.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Add support for NAND_CMD_RESET
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:21 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Add support for NAND_CMD_RESET

Support nand reset command for Cadence Nand Driver.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Add support for NAND_CMD_PARAM
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:20 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Add support for NAND_CMD_PARAM

Add support for reading param page of NAND device.
These paramaters are unique and used for identification purpose.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Add support for readid command
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:19 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Add support for readid command

Add support for readid command in Cadence NAND driver.
The id is unique and used for flash identification.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: cadence: Add support for read status command
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:18 +0000 (00:18 +0800)] 
drivers: mtd: nand: cadence: Add support for read status command

Add support for read status command
in Cadence NAND driver. This status bit is important to check
whether the flash is write-protected.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodrivers: mtd: nand: Add driver for Cadence Nand
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:17 +0000 (00:18 +0800)] 
drivers: mtd: nand: Add driver for Cadence Nand

Enable driver for Cadence NAND for the family
device agilex5. This driver is leveraged from the path
/drivers/mtd/nand/raw/cadence-nand-controller.c from the
stable version 6.11.2.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agoarm: dts: agilex5: Enabled cdns-nand dts setting
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:16 +0000 (00:18 +0800)] 
arm: dts: agilex5: Enabled cdns-nand dts setting

Enable cdns-nand dts setting for the socfpga_agilex5
family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agodt: nand: add cadence nand dt-bindings
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:15 +0000 (00:18 +0800)] 
dt: nand: add cadence nand dt-bindings

The Cadence NAND is a configurable mtd raw block which
supports multiple options for chipsets, clocking and reset structure, and
feature list.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
13 months agoMerge patch series "Enable USB MSC Boot for AM62, AM62A and AM62P"
Tom Rini [Fri, 14 Mar 2025 18:28:13 +0000 (12:28 -0600)] 
Merge patch series "Enable USB MSC Boot for AM62, AM62A and AM62P"

Siddharth Vadapalli <s-vadapalli@ti.com> says:

This series adds config fragment for enabling USB MSC boot and USB
Storage devices which are applicable to AM62, AM62A and AM62P SoCs.

Series has been tested on AM62A7-SK, AM625-SK and AM62P5-SK for USB MSC
boot where the bootloaders were generated in the following manner:
1. AM62A7-SK (AM62A SoC):
- tiboot3.bin
=> am62ax_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62ax_evm_a53_defconfig + am62x_a53_usbmsc.config
2. AM625-SK (AM62 SoC):
- tiboot3.bin
=> am62x_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62x_evm_a53_defconfig + am62x_a53_usbmsc.config
3. AM62P5-SK (AM62P SoC):
- tiboot3.bin
=> am62px_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62px_evm_a53_defconfig + am62x_a53_usbmsc.config

The images were flashed to a USB Flash Drive and were connected to the
Type-C interface on each of the boards which supports USB MSC Boot.

Logs corresponding to this series:
1. AM62A7-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/3518cba3edc57bf52d06a7df932928ca
2. AM625-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/098568be7b482436d27fdc8adae15ce4
3. AM62P5-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/50e29073033668e7d904a785bfbc9c0b

The following device-tree changes were made across all of the boards:
https://gist.github.com/Siddharth-Vadapalli-at-TI/2afb913838c1d4005bc059910c09ab4b

Link: https://lore.kernel.org/r/20250301080049.965438-1-s-vadapalli@ti.com
13 months agoconfigs: am62x_a53: introduce fragment for USB MSC boot
Siddharth Vadapalli [Sat, 1 Mar 2025 08:00:49 +0000 (13:30 +0530)] 
configs: am62x_a53: introduce fragment for USB MSC boot

Introduce the config fragment for enabling USB MSC boot. USB MSC boot
involves fetching the next stage of the bootloader from a USB Mass Storage
device such as a USB Flash Drive with the USB controller on the SoC acting
as the USB Host.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
13 months agoconfigs: am62x_r5: introduce fragment for USB MSC boot
Siddharth Vadapalli [Sat, 1 Mar 2025 08:00:48 +0000 (13:30 +0530)] 
configs: am62x_r5: introduce fragment for USB MSC boot

Introduce the config fragment for enabling USB MSC boot. USB MSC boot
involves fetching the next stage of the bootloader from a USB Mass Storage
device such as a USB Flash Drive with the USB controller on the SoC acting
as the USB Host.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
13 months agocommon: console: Delete obsolete VIDCONSOLE_AS_{LCD, NAME} options
Dragan Simic [Sun, 2 Mar 2025 14:52:57 +0000 (15:52 +0100)] 
common: console: Delete obsolete VIDCONSOLE_AS_{LCD, NAME} options

The configuration options CONFIG_VIDCONSOLE_AS_LCD and CONFIG_VIDCONSOLE_AS_
NAME have been marked as obsolete and scheduled for deletion in late 2020.

That's already long overdue and the last remaining consumers of these options
have already migrated to using "vidconsole" in their "stdout" and "stderr"
environment variables, so let's delete these two configuration options.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Acked-by: Soeren Moch <smoch@web.de> # tbs2910
13 months agoarm: dts: npcm7xx: correct the timer node
Jim Liu [Tue, 25 Feb 2025 01:45:05 +0000 (09:45 +0800)] 
arm: dts: npcm7xx: correct the timer node

Correct the timer node of dts

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
13 months agoMerge tag 'mmu-next-14032025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 14 Mar 2025 15:31:36 +0000 (09:31 -0600)] 
Merge tag 'mmu-next-14032025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

Up to now we configure the entire memory space for U-Boot as RWX.
For modern architectures and security requirements, it's better to
map the memory properly.
This pull request adds basics support for mapping the U-Boot binary with
proper (RO, RW, RW^X) memory permissions on aarch64 right after we
relocate U-Boot in the top of DRAM.
It's worrth noting that the linker script annotations are only added for
the aarch64 architecture. We can, in the future, try to unify the linker --
at least for the architectures that have enough in common and expand this

13 months agoarm64: Enable RW, RX and RO mappings for the relocated binary
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:43 +0000 (15:54 +0200)] 
arm64: Enable RW, RX and RO mappings for the relocated binary

Now that we have everything in place switch the page permissions for
.rodata, .text and .data just after we relocate everything in top of the
RAM.

Unfortunately we can't enable this by default, since we have examples of
U-Boot crashing due to invalid access. This usually happens because code
defines const variables that it later writes. So hide it behind a Kconfig
option until we sort it out.

It's worth noting that EFI runtime services are not covered by this
patch on purpose. Since the OS can call SetVirtualAddressMap which can
relocate runtime services, we need to set them to RX initially but remap
them as RWX right before ExitBootServices.

Link: https://lore.kernel.org/u-boot/20250129-rockchip-pinctrl-const-v1-0-450ccdadfa7e@cherry.de/
Link: https://lore.kernel.org/u-boot/20250130133646.2177194-1-andre.przywara@arm.com/
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agotreewide: Add a function to change page permissions
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:42 +0000 (15:54 +0200)] 
treewide: Add a function to change page permissions

For armv8 we are adding proper page permissions for the relocated U-Boot
binary. Add a weak function that can be used across architectures to change
the page permissions

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905X-CC
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agoarm64: mmu_change_region_attr() add an option not to break PTEs
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:41 +0000 (15:54 +0200)] 
arm64: mmu_change_region_attr() add an option not to break PTEs

The ARM ARM (Rev L.a) on section 8.17.1 describes the cases where
break-before-make is required when changing live page tables.
Since we can use a function to tweak block and page permissions,
where BBM is not required split the existing mmu_change_region_attr()
into two functions and create one that doesn't require BBM. Subsequent
patches will use the new function to map the U-Boot binary with proper
page permissions.
While at it add function descriptions in their header files.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 months agoarm: Prepare linker scripts for memory permissions
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:40 +0000 (15:54 +0200)] 
arm: Prepare linker scripts for memory permissions

Upcoming patches are switching the memory mappings to RW, RO, RX
after the U-Boot binary and its data are relocated. Add
annotations in the linker scripts to and mark text, data, rodata
sections and align them to a page boundary.

It's worth noting that .efi_runtime memory permissions are left
untouched for now. There's two problems with EFI currently.

The first problem is that we bundle data, rodata and text in a single
.efi_runtime section which also must be close to .text for now.
As a result we also dont change the permissions for anything contained
in CPUDIR/start.o. In order to fix that we have to decoule .text_rest,
.text and .efi_runtime and have the runtime services on their own
section with proper memory permission annotations (efi_rodata etc).

The efi runtime regions (.efi_runtime_rel) can be relocated by the OS when
the latter is calling SetVirtualAddressMap. Which means we have to
configure those pages as RX for U-Boot but convert them to RWX just before
ExitBootServices. It also needs extra code in efi_tuntime relocation
code since R_AARCH64_NONE are emitted as well if we page align the
section.

Due to the above ignore EFI for now and fix it later once we have the
rest in place.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905X-CC
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>