pandora-u-boot.git
3 months agorockchip: sdram: Ensure ram_base is correct in SPL
Jonas Karlman [Thu, 30 Jan 2025 22:07:13 +0000 (22:07 +0000)]
rockchip: sdram: Ensure ram_base is correct in SPL

Most Rockchip SoCs use 0x0 as DRAM base address, however some SoCs use
0x60000000 and RK3576 use 0x40000000 as DRAM base address.

CFG_SYS_SDRAM_BASE is defined with correct address for each SoC and
U-Boot proper use this to set correct gd->ram_base in setup_dest_addr().

SPL never assign any value to gd->ram_base and instead use the default,
0x0. Set correct gd->ram_base in dram_init() to ensure its correctness
in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agorockchip: sdram: Limit usable ram_top to max 4G
Jonas Karlman [Thu, 30 Jan 2025 22:07:12 +0000 (22:07 +0000)]
rockchip: sdram: Limit usable ram_top to max 4G

U-Boot only works correctly when it uses RAM below the 4G address
boundary on Rockchip SoCs. Limit usable gd->ram_top to max 4G.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agorockchip: sdram: Allow the first bank to extend beyond 4 GiB
Jonas Karlman [Thu, 30 Jan 2025 22:07:11 +0000 (22:07 +0000)]
rockchip: sdram: Allow the first bank to extend beyond 4 GiB

Allow the first bank to extend beyond 4 GiB when the blob of space for
peripheral is located before start of DRAM, e.g. when start of DRAM
is 0x40000000 and continue beyond the 4 GiB mark.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agorockchip: rk3399: grf: Fix enum typos for UART2
Chen-Yu Tsai [Tue, 4 Feb 2025 17:29:53 +0000 (01:29 +0800)]
rockchip: rk3399: grf: Fix enum typos for UART2

In the GRF header file, some instances of UART2 pinmux are prefixed with
"GRF_UART2DBG" while others have "GRF_UART2DGB".

Since UART2 is the default console UART and used for debugging, it is
more likely the name should be UART2DBG.

Fix the ones that are wrong.

Fixes: a2c08df3813b ("pinctrl: add driver for rk3399")
Fixes: fa72de10452c ("rockchip: arm64: rk3399: move grf register definitions to grf_rk3399.h")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agoRevert "rockchip: rk3399: Fix TPL build of bob and kevin"
Jonas Karlman [Sat, 8 Feb 2025 22:49:40 +0000 (22:49 +0000)]
Revert "rockchip: rk3399: Fix TPL build of bob and kevin"

These power rails must be on very early for the U-Boos TPL banner to be
show over debug UART.

This reverts commit 4576e65a5d6b10fd207c3a44061676ce0220d794.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agorockchip: rk3399-gru: Enable TPL_GPIO for bob and kevin
Jonas Karlman [Sat, 8 Feb 2025 22:49:39 +0000 (22:49 +0000)]
rockchip: rk3399-gru: Enable TPL_GPIO for bob and kevin

The PP1500 and PP3000 power rails must be on very early for the U-Boot
TPL banner to be shown on debug UART.

Enable TPL_GPIO Kconfig option for bob and kevin to allow use of
spl_gpio.h functions in TPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agoRevert "rockchip: rk3399: Drop unneeded bob and kevin board specific code"
Jonas Karlman [Sat, 8 Feb 2025 22:49:38 +0000 (22:49 +0000)]
Revert "rockchip: rk3399: Drop unneeded bob and kevin board specific code"

These power rails must be on very early for the U-Boos SPL banner to be
show over debug UART.

This reverts commit af518a1dfe637cb4dc486d7a832585e4a48bc970.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
3 months agofs/erofs: fix an integer overflow in symlink resolution
Gao Xiang [Thu, 13 Feb 2025 11:28:47 +0000 (19:28 +0800)]
fs/erofs: fix an integer overflow in symlink resolution

See the original report [1], otherwise len + 1 will be overflowed.

Note that EROFS archive can record arbitary symlink sizes in principle,
so we don't assume a short number like 4096.

[1] https://lore.kernel.org/r/20250210164151.GN1233568@bill-the-cat

Fixes: 830613f8f5bb ("fs/erofs: add erofs filesystem support")
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
3 months agoled: fix coverity scan error
Heiko Schocher [Wed, 12 Feb 2025 09:10:55 +0000 (10:10 +0100)]
led: fix coverity scan error

The following was reported by Covervity scan:

*** CID 541279:    (TAINTED_SCALAR)
/drivers/led/led-uclass.c: 284 in led_get_function_name()
278                     if (!ret) {
279                             snprintf(uc_plat->name, LED_MAX_NAME_SIZE,
280                                      "%s:%s-%d",
281                                      cp ? "" : led_colors[color],
282                                      func ? func : "", enumerator);
283                     } else {
>>>     CID 541279:    (TAINTED_SCALAR)
>>>     Using tainted variable "color" as an index into an array "led_colors".

Fix it.
Addresses-Coverity-ID: 541279 (TAINTED_SCALAR)
Link: https://lists.denx.de/pipermail/u-boot/2025-February/580250.html
Signed-off-by: Heiko Schocher <hs@denx.de>
3 months agotools: use cryptographically safe RNG
Heinrich Schuchardt [Tue, 11 Feb 2025 13:55:22 +0000 (14:55 +0100)]
tools: use cryptographically safe RNG

The PRNG implementing the random() function only has 2^31 states and
therefore is unsafe to use for cryptography. Use arc4random() instead.

Fixes: cc34f04efd63 ("tools: image-host.c: use random instead of rand")
Addresses-Coverity-ID: 312953 Calling risky function
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
3 months agopower: regulator: tps65941: Fix voltage calculation for ldo
Udit Kumar [Tue, 11 Feb 2025 17:51:58 +0000 (23:21 +0530)]
power: regulator: tps65941: Fix voltage calculation for ldo

As per TRM[0] Section 8.7.1 "TPS6594-Q1 Registers", LDOx_Vout
bit 6-1, define the NVM voltage settings.
Along side table 8-4 of above TRM, shows voltage to value mapping.

Driver wrongly using bits 5-1 to calculate voltage, and to convert
voltage to value driver was using buck's calculation.
So fix those calculation.

[0]: https://www.ti.com/lit/ds/symlink/tps6594-q1.pdf

Fixes: 5d7dbd22cf7d ("power: regulator: tps65941: use function callbacks for conversion ops")
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
3 months agotpm: unconstify tpm_tis_chip_data
Ilias Apalodimas [Thu, 6 Feb 2025 09:28:56 +0000 (11:28 +0200)]
tpm: unconstify tpm_tis_chip_data

The struct contains an iomem pointer that we later remap and update.
Remove const from the struct definition.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agoGitlab: Add missing symlink for qemu_arm64_lwip boardenv file
Tom Rini [Sun, 16 Feb 2025 16:29:03 +0000 (10:29 -0600)]
Gitlab: Add missing symlink for qemu_arm64_lwip boardenv file

When adding the symlink for the conf file so qemu_arm64_lwip uses
qemu_arm64 configuration information, the symlink for the boardenv file
was missed in Gitlab (but not Azure). Add that in now.

Fixes: fd10d156db3f ("CI: add qemu_arm64_lwip to the test matrix")
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sat, 15 Feb 2025 21:29:20 +0000 (15:29 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

Add empty weak assembler function armv8_switch_to_el2_prep() which is
jumped to just before U-Boot determines which EL it is running in and
decides which path to take to boot the Linux kernel. Add
IH_TYPE_TFA_BL31 into supported images type, to allow implementation of
board specific U_BOOT_FIT_LOADABLE_HANDLER(IH_TYPE_TFA_BL31, ...) TFA
BL31 loadable handler for fitImages.

This PR contains common hooks which are noop, R-Car Gen4 board specific
implementation using these hooks is coming in next PR.

3 months agoimage: Add support for starting TFA BL31 as fitImage loadables
Marek Vasut [Wed, 29 Jan 2025 21:59:19 +0000 (22:59 +0100)]
image: Add support for starting TFA BL31 as fitImage loadables

Add support for starting TFA from U-Boot running in EL3 as part of
fitImage boot, so the user can start U-Boot in the highest privilege
level on the platform, bundle TFA, Linux, DT into a single fitImage
and boot such a bundle as a whole.

There are two main benefits of this approach. First is the ability
to run U-Boot in EL3, where it has unrestricted access to the entire
system and can act as a useful debug tool, as it was always intended
to be used. Second is the ability to easily and safely update of any
component in the fitImage, be it TFA, Linux or DT.

The boot process is similar to regular Linux with DT fitImage boot
process, except the TFA has to be bundled into the fitImage. For the
bundling instructions, see below. The TFA is started as a 'loadables'
with custom U_BOOT_FIT_LOADABLE_HANDLER and armv8_switch_to_el2_prep()
handling implemented in board code, and performing the handoff and
boot in case the TFA was loaded.

The loadables handler is optional and meant to set up any sort of
handoff structures used by the TFA BL31 or perform any other setup
that is needed by the blob. The custom armv8_switch_to_el2_prep()
has to implement the jump to TFA BL31 with return to U-Boot just
before booting the Linux kernel.

Example fitImage image and configuration section:

/dts-v1/;

/ {
    description = "Linux kernel with FDT blob and TFA BL31";

    images {
        kernel-1 { ... };
        fdt-1 { ... };
        atf-1 {                  /* This is the TFA BL31 image */
            description = "TFA BL31";
            data = /incbin/("../build/plat/release/bl31.bin");
            type = "tfa-bl31";
            arch = "arm64";
            os = "arm-trusted-firmware";
            compression = "none";
            load = <0x46400000>;
            entry = <0x46400000>;
        };
    };

    configurations {
        default = "conf-1";
        conf-1 {
            description = "Boot Linux";
            kernel = "kernel-1";
            fdt = "fdt-1";
            loadables = "atf-1"; /* This is the TFA BL31 loadable */
        };
    };
};

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
3 months agoarm64: Add late jump to kernel board hook
Marek Vasut [Wed, 29 Jan 2025 21:59:18 +0000 (22:59 +0100)]
arm64: Add late jump to kernel board hook

Add empty weak assembler function armv8_switch_to_el2_prep() which is
jumped to just before U-Boot determines which EL it is running in and
decides which path to take to boot the Linux kernel.

This weak function is meant to be used by architecture specific code
to implement jump to a firmware blob, which then returns right past
this weak function and continues execution of U-Boot code which then
boots the Linux kernel. One example of such use case is when U-Boot
jump tp TFA BL31, which switches from EL3 to EL2 and then returns to
U-Boot code newly running in EL2 and starts the Linux kernel.

The weak function is called with caches already disabled and DM shut
down. Any preparatory work or even loading of more data must be done
in board_prep_linux(), this hook is meant only for the final jump to
the firmware and return to U-Boot before booting Linux.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoMerge branch 'misc' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Tom Rini [Thu, 13 Feb 2025 18:37:26 +0000 (12:37 -0600)]
Merge branch 'misc' of https://source.denx.de/u-boot/custodians/u-boot-tegra

Improvements for PMIC GPIO children, tegra20 pinmux driver fix, tegra
dts updates, various small adjustments and tweaks.

4 months agombedtls/external: remove broken git submodule
ZHANG Yuntian [Tue, 11 Feb 2025 07:30:27 +0000 (15:30 +0800)]
mbedtls/external: remove broken git submodule

When we squash imported mbedtls, the git submodule "framework" was
preserved in the commit. However, U-Boot itself does not use git
submodule, and provides no .gitmodules file to specify the submodule
repository.

This is normally not an issue when cloning U-Boot repository. However,
when U-Boot is imported as a submodule, this will break git option
`--recurse-submodules` as it fails to resolve "framework".

As we do not use the submodule, remove it to unbreak existing workflows.

Fixes: 12f1212e95fe ("Merge commit '0344c602eadc0802776b65ff90f0a02c856cf53c' as 'lib/mbedtls/external/mbedtls'")
Signed-off-by: ZHANG Yuntian <yt@radxa.com>
4 months agoboard: transformer-t30: fix model detection
Svyatoslav Ryhel [Sat, 28 Dec 2024 13:21:03 +0000 (15:21 +0200)]
board: transformer-t30: fix model detection

PCBID1 seems to be high not only on TF600T, but on TF700T as well,
that caused boot failure for TF700T. Switching PCBID1 to PCBID7
should fix this issue.

Co-developed-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agodoc: board: tegra: update device information
Svyatoslav Ryhel [Tue, 3 Dec 2024 10:50:45 +0000 (12:50 +0200)]
doc: board: tegra: update device information

Adjust and update existing manuals to reflect the most recent
updates.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoARM: tegra124: dts: mark HOST1X and DC with pre-relocation flag
Svyatoslav Ryhel [Wed, 20 Nov 2024 07:26:38 +0000 (09:26 +0200)]
ARM: tegra124: dts: mark HOST1X and DC with pre-relocation flag

Same as on previous SoC generations this is required for proper
video output work.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoMerge branch 'u-boot-net-20250212' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 12 Feb 2025 14:41:36 +0000 (08:41 -0600)]
Merge branch 'u-boot-net-20250212' of https://source.denx.de/u-boot/custodians/u-boot-net

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

net-lwip:
* Fix incorrect selection of ethernet device on boards having more than
  one
* Fix TFTP option processing
* Make the WGET_HTTPS Kconfig symbol depend on DM_RNG

lib:
* Add strnstr()

4 months agonet: Kconfig: depend on DM_RNG for WGET_HTTPS
Jerome Forissier [Tue, 4 Feb 2025 16:00:49 +0000 (17:00 +0100)]
net: Kconfig: depend on DM_RNG for WGET_HTTPS

net/lwip/wget.c/mbedtls_hardware_poll() is calling dm_rng_read() but
dependency is not recorded anywhere that's why depend on DM_RNG
when WGET_HTTPS is used.

Suggested-by: Michal Simek <michal.simek@amd.com>
Co-developed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Michal Simek <michal.simek@amd.com>
4 months agonet: use strnstr() for lwip_strnstr()
Heinrich Schuchardt [Mon, 3 Feb 2025 09:12:02 +0000 (10:12 +0100)]
net: use strnstr() for lwip_strnstr()

Using strstr() instead of strnstr() creates a security concern.

Fixes: 1c41a7afaa15 ("net: lwip: build lwIP")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agotest: unit tests for strstr() and strnstr()
Heinrich Schuchardt [Mon, 3 Feb 2025 09:12:01 +0000 (10:12 +0100)]
test: unit tests for strstr() and strnstr()

Add unit tests for the library functions.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
[jf: drop unwanted change to lib/string.c]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agolib: implement strnstr()
Heinrich Schuchardt [Mon, 3 Feb 2025 09:12:00 +0000 (10:12 +0100)]
lib: implement strnstr()

Implement library function strnstr().
Implement strstr() using strnstr().
Sort the includes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
[jf: replace <stdint.h> by <limits.h>, folded from next patch]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agonet: lwip: tftp: fix find_option()
Heinrich Schuchardt [Mon, 3 Feb 2025 09:11:59 +0000 (10:11 +0100)]
net: lwip: tftp: fix find_option()

Find_option() is used to retrieve the block size value in an option
acknowledgment in response to a request containing a block size option
according to RFC2348.

The format of an OACK response is described in RFC2347 as

+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+
|  opc  |  opt1  | 0 | value1 | 0 |  optN  | 0 | valueN | 0 |
+-------+---~~---+---+---~~---+---+---~~---+---+---~~---+---+

The current implementation of find_option() only works if

* blksize is the first option
* lwip_strnstr() ignores the length parameter,
  i.e. is implemented via strstr()

The OACK messages starts with  0x00 0x06. If 'blksize' is the first option,
strstr() reports a match when the first parameter points to 0x06. Adding
the string length of 'blksize' plus 2 to the location of the 0x06 byte
points to the value.

Find_option() would report a match for option 'blksize' if the response
contained an option called 'foo_blksize_bar'. In this case find_option()
would return 'bar' as the value string.

If 'blksize' were the second option, find_option() would return a pointer
to the second character of the value string.

Furthermore find_option() does not detect if the value string is NUL
terminated. This may lead to a buffer overrun.

Provide an implementation that correctly steps from option to option.

Fixes: 27d7ccda94fa ("net: lwip: tftp: add support of blksize option to client")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (qemu_arm64_lwip)
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agonet: lwip: move eth_init() out of new_netif()
Jerome Forissier [Thu, 30 Jan 2025 08:22:20 +0000 (09:22 +0100)]
net: lwip: move eth_init() out of new_netif()

Move the initialization of the ethernet devices out of the new_netif()
function. Indeed, new_netif() accepts a struct device argument, which
is expected to be valid and active. The activation and selection of
this device are achieved by eth_init() (on first time the network
stack is used) and eth_set_current(). This is what takes care of the
ethrotate and ethact environment variables. Therefore, move these calls
to a new function: net_lwip_set_current(), and use it whenever a
net-lwip command is run.

This patch hopefully fixes the incorrect net-lwip behavior observed on
boards with multiple ethernet interfaces [1].

Tested on an i.MX8MPlus EVK equipped wih two ethernet ports. The dhcp
command succeeds whether the cable is plugged into the first or second
port.

[1] https://lists.denx.de/pipermail/u-boot/2025-January/576326.html

Reported-by: E Shattow <e@freeshell.de>
Tested-by: E Shattow <e@freeshell.de>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 months agoARM: tegra124: dts: add missing DSI nodes
Svyatoslav Ryhel [Mon, 18 Nov 2024 06:32:13 +0000 (08:32 +0200)]
ARM: tegra124: dts: add missing DSI nodes

Bind missing DSI and MIPI calibration devices.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoARM: tegra30: dts: complete DSI nodes
Svyatoslav Ryhel [Sun, 24 Nov 2024 12:27:17 +0000 (14:27 +0200)]
ARM: tegra30: dts: complete DSI nodes

Sync DSI nodes with Linux tree.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoARM: tegra210: clock: implement PLLD2 support
Svyatoslav Ryhel [Fri, 29 Nov 2024 06:14:21 +0000 (08:14 +0200)]
ARM: tegra210: clock: implement PLLD2 support

PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoARM: tegra124: clock: implement PLLD2 support
Svyatoslav Ryhel [Fri, 15 Nov 2024 19:13:15 +0000 (21:13 +0200)]
ARM: tegra124: clock: implement PLLD2 support

PLLD2 is a simple clock (controlled by 2 registers) and appears starting
from T30. Primary use of PLLD2 is as main HDMI clock parent.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agoboard: asus: convert SPL to XPL
Svyatoslav Ryhel [Fri, 29 Nov 2024 17:30:54 +0000 (19:30 +0200)]
board: asus: convert SPL to XPL

Not sure why these files were omitted, but SPL should
be converted to XPL.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agopinctrl: tegra20: adjust pin type detection
Svyatoslav Ryhel [Fri, 6 Dec 2024 15:50:58 +0000 (17:50 +0200)]
pinctrl: tegra20: adjust pin type detection

Pin detection on t20 depends on node name. With recent changes
in node naming, let's remove '_' to be safe about both '_' or
'-' use.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
4 months agopmic: palmas: bind sysreset to parent node
Svyatoslav Ryhel [Mon, 9 Dec 2024 10:58:19 +0000 (12:58 +0200)]
pmic: palmas: bind sysreset to parent node

Bind SYSRESET child to parent node since it does not have
its own node in the device tree.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 months agopmic: max77663: bind children to parent node
Svyatoslav Ryhel [Mon, 9 Dec 2024 10:51:33 +0000 (12:51 +0200)]
pmic: max77663: bind children to parent node

Bind GPIO and SYSRESET children to parent node since they
do not have their own nodes in the device tree.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 months agoRevert "drivers: gpio-uclass: support PMIC GPIO children"
Svyatoslav Ryhel [Mon, 9 Dec 2024 10:45:18 +0000 (12:45 +0200)]
Revert "drivers: gpio-uclass: support PMIC GPIO children"

Requesting of PMIC's GPIO child should be done by binding
GPIO driver to PMIC's node is GPIO driver does not have
its own node.

This reverts commit c03cd98d1a163666b4addcdd9a34fc0c77dfd0a5.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
4 months agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 11 Feb 2025 15:11:21 +0000 (09:11 -0600)]
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge tag 'u-boot-dfu-20250211' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Tue, 11 Feb 2025 14:56:54 +0000 (08:56 -0600)]
Merge tag 'u-boot-dfu-20250211' of https://source.denx.de/u-boot/custodians/u-boot-dfu

u-boot-dfu-20250211:

CI:
- https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/24556

Android:
- Handle boot images with missing DTB

Usb gadget:
- Fix nullptr in g_dnl when serial# is unset
- Add missing schedule() in f_mass_storage gadget
- Add support for STih407 in dwc3-generic
- Fix usb clocks on STih407
- Migrate STih407 to DM_USB_GADGET

4 months agoconfigs: stih410-b2260: Enable CMD_USB_MASS_STORAGE flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:47 +0000 (17:35 +0100)]
configs: stih410-b2260: Enable CMD_USB_MASS_STORAGE flag

Enable CMD_USB_MASS_STORAGE flag.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-10-patrice.chotard@foss.st.com
[mkorpershoek: fixed up commit footer]
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoboard: stih410-b2260: Remove board_usb_init/cleanup()
Patrice Chotard [Thu, 30 Jan 2025 16:35:46 +0000 (17:35 +0100)]
board: stih410-b2260: Remove board_usb_init/cleanup()

Since DM_USB_GADGET is enable for this board, board_usb_init()
and board_usb_cleanup() can be removed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-9-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoconfigs: stih410-b2260: Enable DM_USB_GADGET flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:45 +0000 (17:35 +0100)]
configs: stih410-b2260: Enable DM_USB_GADGET flag

Enable DM_USB_GADGET flag.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-8-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoconfigs: stih410-b2260: Enable USB_DWC3_GENERIC and USB_DWC3_STI flags
Patrice Chotard [Thu, 30 Jan 2025 16:35:44 +0000 (17:35 +0100)]
configs: stih410-b2260: Enable USB_DWC3_GENERIC and USB_DWC3_STI flags

Enable USB_DWC3_GENERIC and USB_DWC3_STI flags.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250130163547.512990-7-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agousb: dwc3-generic: Add STih407 support
Patrice Chotard [Thu, 30 Jan 2025 16:35:43 +0000 (17:35 +0100)]
usb: dwc3-generic: Add STih407 support

Add STi glue logic to manage the DWC3 HC on STiH407
SoC family. It configures the internal glue logic and
syscfg registers.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250130163547.512990-6-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agousb: dwc3-generic: Reorder include
Patrice Chotard [Thu, 30 Jan 2025 16:35:42 +0000 (17:35 +0100)]
usb: dwc3-generic: Reorder include

Reorder include following rules available here :
https://docs.u-boot.org/en/latest/develop/codingstyle.html#include-files

Remove useless include files.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-5-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agousb: dwc3: Remove dwc3 glue driver support for STi
Patrice Chotard [Thu, 30 Jan 2025 16:35:41 +0000 (17:35 +0100)]
usb: dwc3: Remove dwc3 glue driver support for STi

STi will migrate to dwc3-generic driver, dwc3-sti-glue driver
can be removed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250130163547.512990-4-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoconfigs: stih410-b2260: Enable DM_REGULATOR flag
Patrice Chotard [Thu, 30 Jan 2025 16:35:40 +0000 (17:35 +0100)]
configs: stih410-b2260: Enable DM_REGULATOR flag

Since commit 6aa8bde8786d ("usb: host: ehci-generic: Remove DM_REGULATOR
flag") device_get_supply_regulator() returns -ENOSYS which is not handle
by ehci_enable_vbus_supply() and thus, ehci_usb_probe() return an error.

By enabling DM_REGULATOR flag, device_get_supply_regulator() return -ENOENT
which is handle and ehci_usb_probe() return 0.

This fixed the following issue:
stih410-b2260 =>usb start
starting USB...
Bus dwc3@9900000: Register 2000240 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus usb@9a03c00: USB OHCI 1.0
Bus usb@9a03e00: probe failed, error -38
Bus usb@9a83c00: USB OHCI 1.0
Bus usb@9a83e00: probe failed, error -38
scanning bus dwc3@9900000 for devices... 1 USB Device(s) found
scanning bus usb@9a03c00 for devices... data abort
pc : [<7df929b4>]          lr : [<7df92918>]
reloc pc : [<7d6409b4>]    lr : [<7d640918>]
sp : 7c73b848  ip : 9cf13c5c     fp : 7c879d08
r10: 7c85d040  r9 : 7c74ded0     r8 : 09a03c00
r7 : 00000002  r6 : 7c85d080     r5 : 7c86a040  r4 : 00000000
r3 : 00000000  r2 : 00000000     r1 : 7c85d080  r0 : 7c85d040
Flags: nzCv  IRQs off  FIQs off  Mode SVC_32
Code: 05853ae4 0affffe2 e59a2010 e59a300c (e5832010)
Resetting CPU ...

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-3-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoARM: dts: sti: Add fixed clock for ehci and ohci nodes in stih410-b2260.dtsi
Patrice Chotard [Thu, 30 Jan 2025 16:35:39 +0000 (17:35 +0100)]
ARM: dts: sti: Add fixed clock for ehci and ohci nodes in stih410-b2260.dtsi

On STi platforms, all clocks are enabled by BOOTROM, so CONFIG_CLK is
not set as no clock driver for STI exists.

As ehci-generic and ohci-generic drivers are used on platforms where
CONFIG_CLK is set, clk_get_bulk() returns-ENOSYS in case of
stih410-b2260.
To avoid this error, add fixed clocks for ehci and ohci nodes for
stih410-b2260 to fix the following errors:

Bus usb@9a03c00: ohci_generic usb@9a03c00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a03e00: ehci_generic usb@9a03e00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a83c00: ohci_generic usb@9a83c00: Failed to get clocks (ret=-19)
Port not available.
Bus usb@9a83e00: ehci_generic usb@9a83e00: Failed to get clocks (ret=-19)
Port not available.
scanning bus dwc3@9900000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20250130163547.512990-2-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agousb: gadget: f_mass_storage: Add schedule() in sleep_thread()
Patrice Chotard [Mon, 2 Dec 2024 07:46:44 +0000 (08:46 +0100)]
usb: gadget: f_mass_storage: Add schedule() in sleep_thread()

In case "ums" command is used on platforms which don't implement
g_dnl_board_usb_cable_connected() and USB cable is not connected,
we stay inside sleep_thread() forever and watchdog is triggered.

Add schedule() call to avoid this issue.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241202074644.5380-1-patrice.chotard@foss.st.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoPrepare v2025.04-rc2 v2025.04-rc2
Tom Rini [Mon, 10 Feb 2025 22:00:49 +0000 (16:00 -0600)]
Prepare v2025.04-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoCI: Drop extra condition for sjg lab
Simon Glass [Sun, 1 Dec 2024 14:42:29 +0000 (07:42 -0700)]
CI: Drop extra condition for sjg lab

The rules part of the template makes sure that this doesn't run until
specifically requested. Drop the check in the script itself, so it is
possible to trigger a run manually without re-pushing the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "Enable MCU ESM reset"
Tom Rini [Mon, 10 Feb 2025 16:32:03 +0000 (10:32 -0600)]
Merge patch series "Enable MCU ESM reset"

Judith Mendez <jm@ti.com> says:

This patch series enables ESM reset configuration in board_init_f
for am62x and am62px devices.

This is necessary in order for error events to reset the system.

This patches are tested using watchdog to reset the system via ESM.

Link: https://lore.kernel.org/r/20250129234403.574766-1-jm@ti.com
4 months agoconfigs: am62*_evm_r5: Enable ESM and MISC configs
Santhosh Kumar K [Wed, 29 Jan 2025 23:44:03 +0000 (17:44 -0600)]
configs: am62*_evm_r5: Enable ESM and MISC configs

Enable CONFIG_SPL_DRIVERS_MISC, CONFIG_SPL_MISC, CONFIG_ESM_K3
to probe the Main ESM and MCU ESM nodes.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
4 months agoarm: mach-k3: am62*_init: Probe ESM nodes
Santhosh Kumar K [Wed, 29 Jan 2025 23:44:02 +0000 (17:44 -0600)]
arm: mach-k3: am62*_init: Probe ESM nodes

On AM62A and AM62P devices, it is possible to route Main ESM error
events to MCU ESM. MCU ESM high error output can trigger the reset
logic to reset the device. So, for these devices we have Main ESM and
MCU ESM nodes in the device tree. Add functions to probe these nodes
if CONFIG_ESM_K3 is enabled.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
4 months agoinclude: env: phytec: Add optargs to K3 files
Nathan Morrisson [Wed, 29 Jan 2025 10:34:44 +0000 (02:34 -0800)]
include: env: phytec: Add optargs to K3 files

Add the optargs variable so that we can set optional arguments while
booting.

Signed-off-by: Nathan Morrisson <nmorrisson@phytec.com>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
4 months agoenv: fat: Avoid writing to read-only location
Andre Przywara [Thu, 30 Jan 2025 13:36:46 +0000 (13:36 +0000)]
env: fat: Avoid writing to read-only location

The env_fat_get_dev_part() function mostly returns a fixed string, set
via some Kconfig variable. However when the first character is a colon,
that means that the boot device number is determined at runtime, and
patched in. This requires altering the string.

So far this was done via some ugly and actually illegal direct write to
the .rodata string storage. We got away with this because U-Boot maps
everything as read/write/execute so far.

A proposed patch set actually enforces read-only (and no-execute)
permissions in the page tables, so this routine now causes an exception:
=======================
Loading Environment from FAT... "Synchronous Abort" handler, esr 0x9600004f, far 0xfffb7d4c
elr: 000000004a054228 lr : 000000004a05421c (reloc)
elr: 00000000fff7c228 lr : 00000000fff7c21c
.....
=======================

Rewrite the routine to do away with the dodgy string manipulation,
instead allocate the string in the r/w .data section, where we can
safely manipulate it.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoMerge patch series "FIX: Re-enable MUX_MMIO on J721E/J7200"
Tom Rini [Mon, 10 Feb 2025 16:29:36 +0000 (10:29 -0600)]
Merge patch series "FIX: Re-enable MUX_MMIO on J721E/J7200"

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

Hello,

This series re-enables MUX_MMIO at U-Boot proper on J721E and J7200
SoCs. The commits which introduced support for Hyperflash boot on both
of these SoCs disabled MUX_MMIO functionality at U-Boot proper, thereby
introducing a regression.

Series is based on commit
2b1c8d3b2d cmd: Fix Kconfig coding style
of the master branch of U-Boot.

Link: https://lore.kernel.org/r/20250201091809.1894892-1-s-vadapalli@ti.com
4 months agoconfigs: j7200_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Siddharth Vadapalli [Sat, 1 Feb 2025 09:18:00 +0000 (14:48 +0530)]
configs: j7200_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper

Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree. On J7200
SoC, PCIe functionality is broken since commit under fixes.

Fix this regression by re-enabling MUX_MMIO.

Fixes: 038f6faea9f0 ("configs: j7200_evm_*_defconfig: Add configs for Hyperflash boot")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Anurag Dutta <a-dutta@ti.com>
4 months agoconfigs: j721e_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Siddharth Vadapalli [Sat, 1 Feb 2025 09:17:59 +0000 (14:47 +0530)]
configs: j721e_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper

Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree.

Fix this regression by re-enabling MUX_MMIO.

Fixes: fd7fcd4098d5 ("configs: j721e_evm_*_defconfig: Add configs for Hyperflash boot")
Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
4 months agortc: emul_rtc: Make emul_rtc_probe() static
Michal Simek [Mon, 3 Feb 2025 09:18:57 +0000 (10:18 +0100)]
rtc: emul_rtc: Make emul_rtc_probe() static

emul_rtc_probe() is not called from anywhere else that's why make it
static. Issue is reported by build with W=1.

Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agonet: designware: support phy io micro voltage setting.
Michael Chang [Wed, 5 Feb 2025 02:01:06 +0000 (10:01 +0800)]
net: designware: support phy io micro voltage setting.

Support phy io micro voltage setting for NPCM8XX rgmii
interface.

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
4 months agomediatek: mt7981: enable ethernet switch auto-detction
Weijie Gao [Wed, 5 Feb 2025 01:24:37 +0000 (09:24 +0800)]
mediatek: mt7981: enable ethernet switch auto-detction

This patch enables switch auto-detction for mt7981 as some new mt7981
boards will use AN8855 ethernet switch.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
4 months agoconfigs: phycore_am64x_r5_defconfig: Enable PHYTEC_SOM_DETECTION
Wadim Egorov [Wed, 5 Feb 2025 04:30:13 +0000 (05:30 +0100)]
configs: phycore_am64x_r5_defconfig: Enable PHYTEC_SOM_DETECTION

Enable configs required for detecting and fixing up for different RAM variants.
Also resync after savedefconfig.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
4 months agoboard: phytec: phycore_am64x: Add support for 1 GB RAM variant and ECC
Wadim Egorov [Wed, 5 Feb 2025 04:30:12 +0000 (05:30 +0100)]
board: phytec: phycore_am64x: Add support for 1 GB RAM variant and ECC

Detect RAM size via EEPROM and adjust DDR size and banks accordingly.
Include necessary fixups to handle ECC-enabled configurations.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
4 months agoarch: arm: dts: phyboard-electra-uboot.dtsi: Add bootph props to i2c
Wadim Egorov [Wed, 5 Feb 2025 04:30:11 +0000 (05:30 +0100)]
arch: arm: dts: phyboard-electra-uboot.dtsi: Add bootph props to i2c

Add bootph-all properties to I2C0 nodes to ensure the bus and EEPROM
are accessible across all stages. This enables reading the SoM
configuration at any point during the boot process.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
4 months agotest/py: usb: Fix format string for fstype command
Andrew Goodbody [Wed, 5 Feb 2025 13:04:26 +0000 (13:04 +0000)]
test/py: usb: Fix format string for fstype command

USB tests on ext partitions can fail with the following output

test/py/tests/test_usb.py:245: in test_usb_part
    'fstype usb %d:%d' % i, part_id
E   TypeError: not enough arguments for format string

So add brackets around the format string arguments to prevent the
error.

Fixes: a730947974e3 ("test/py: usb: Distinguish b/w ext2/ext4 partitions")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Love Kumar <love.kumar@amd.com>
4 months agotools: mkenvimage: List -V parameter in help text
Marek Vasut [Wed, 5 Feb 2025 14:34:28 +0000 (15:34 +0100)]
tools: mkenvimage: List -V parameter in help text

The -V version parameter is missing in the optional list of parameters
in help text. Add it.

Signed-off-by: Marek Vasut <marex@denx.de>
4 months agomediatek: mt7986: rename pinctrl to pio in mt7986-u-boot.dtsi
Weijie Gao [Thu, 6 Feb 2025 00:41:28 +0000 (08:41 +0800)]
mediatek: mt7986: rename pinctrl to pio in mt7986-u-boot.dtsi

The change from pinctrl to pio was missing in mt7986-u-boot.dtsi and will
cause build failure. Now fix it.

Fixes: f1775996ba9 (mediatek: mt7986: move gpio-controller up and rename pinctrl to pio)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
4 months agopinctrl: mediatek: support reading register base address by name
Weijie Gao [Thu, 6 Feb 2025 02:19:06 +0000 (10:19 +0800)]
pinctrl: mediatek: support reading register base address by name

This patch add support to read register base address by name if
provided.

Also devfdt_get_addr_* is changed to dev_read_addr_* to support DT
live tree.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
4 months agopinctrl: mediatek: mt7988: remove _base from reg-names
Weijie Gao [Thu, 6 Feb 2025 02:18:57 +0000 (10:18 +0800)]
pinctrl: mediatek: mt7988: remove _base from reg-names

The reg-names in mt7988.dtsi have no _base suffix. Remove the suffix
will also make it match upstream linux format.

Fixes: 8c2cb748ef5 (pinctrl: mediatek: mt7988: rename reg-names to upstream linux format)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
4 months agoAzure: Add missing "set -e" to docs job
Tom Rini [Fri, 7 Feb 2025 19:12:50 +0000 (13:12 -0600)]
Azure: Add missing "set -e" to docs job

Without setting the shell flag to exit immediately when a command exists
with a non-zero status we can have the situation where the htmldocs
target fails with an error but the job will succeed due to infodocs
passing and being the last build target.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Mon, 10 Feb 2025 14:45:04 +0000 (08:45 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

- e850-96 platform updates

4 months agoMerge patch series "cmd/setexpr: support concatenation of direct strings"
Tom Rini [Fri, 7 Feb 2025 19:35:32 +0000 (13:35 -0600)]
Merge patch series "cmd/setexpr: support concatenation of direct strings"

Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.
* Remove invalid memory leak tests

Link: https://lore.kernel.org/r/20250203151029.60265-1-heinrich.schuchardt@canonical.com
4 months agocmd/setexpr: support concatenation of direct strings
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:29 +0000 (16:10 +0100)]
cmd/setexpr: support concatenation of direct strings

The setexpr.s command allows to concatenate two strings.

According to the description in doc/usage/cmd/setexpr.rst the parameters
value1 and value2 can be either direct values or pointers to a
memory location holding the values.

Unfortunately `setexpr.s <value1> + <value2>` fails if any of the values
is a direct value. $? is set to false.

* Add support for direct values in setexpr.s.
* Correct the unit test for "setexpr.s fred 0".
* Add a new unit test for "setexpr.s fred '1' + '3'" giving '13'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agotest: remove available memory check in setexpr_test_str_oper()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:28 +0000 (16:10 +0100)]
test: remove available memory check in setexpr_test_str_oper()

env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agotest: remove available memory check in setexpr_test_str()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:27 +0000 (16:10 +0100)]
test: remove available memory check in setexpr_test_str()

env_set() frees the previous value after allocating the new value.
As the free() may merge memory chunks the available memory is not
expected to stay constant.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agotest: clean up setexpr_test_str()
Heinrich Schuchardt [Mon, 3 Feb 2025 15:10:26 +0000 (16:10 +0100)]
test: clean up setexpr_test_str()

Assign variable buf in the sub-test where it is used.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agoMerge patch series "led: add function naming option from linux"
Tom Rini [Fri, 7 Feb 2025 16:53:43 +0000 (10:53 -0600)]
Merge patch series "led: add function naming option from linux"

Heiko Schocher <hs@denx.de> says:

In linux we have the option to create the name of a led
optionally through the following properties:

- function
- color
- function-enumerator

This series adds support for parsing this properties if there
is no label property.

Link: https://lore.kernel.org/r/20250128135246.74838-1-hs@denx.de
[trini: Document name parameter in led.h]

4 months agoled: add function naming option from linux
Heiko Schocher [Tue, 28 Jan 2025 13:52:46 +0000 (14:52 +0100)]
led: add function naming option from linux

in linux we have the option to create the name of a led
optionally through the following properties:

- function
- color
- function-enumerator

This patch adds support for parsing this properties if there
is no label property.

The led name is created in led_post_bind() and we need some
storage place for it. Currently this patch prevents to use
malloc() instead it stores the name in new member :

        char name[LED_MAX_NAME_SIZE];

of struct led_uc_plat. While at it append led tests for the
new feature.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agodoc: remove redundant leds bindings
Heiko Schocher [Tue, 28 Jan 2025 13:52:45 +0000 (14:52 +0100)]
doc: remove redundant leds bindings

remove file doc/device-tree-bindings/leds/common.txt
as we have this now already in
dts/upstream/include/dt-bindings/leds/common.h
which is imported from linux.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agoMerge tag 'xilinx-for-v2025.04-rc2' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 6 Feb 2025 14:09:54 +0000 (08:09 -0600)]
Merge tag 'xilinx-for-v2025.04-rc2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.04-rc2

fpga:
- Cleanup help
- Show xilinx only options on Xilinx devices

ospi-versal:
- Fix alignment issue
- Fix cadence_qspi_flash_reset() prototype

zynqmp:
- Define usb_pgood_delay
- Fix bootseq number

versal:
- Fix mini_ospi configuration

versal2:
- Enable OPTEE

xilinx:
- Enable some flashes
- Clean up SYS_MALLOC_F_LEN Kconfig
- Some binman fixes
- DT updates
- Enable mkfwumdata compilation
- Enable meminfo command
- Switch to LWIP and enable HTTPS

4 months agoboot: android: handle boot images with missing DTB
Sam Day [Thu, 23 Jan 2025 14:35:01 +0000 (14:35 +0000)]
boot: android: handle boot images with missing DTB

607b07554e2 removed the check on the return status of the
android_image_get_dtb_img_addr call from android_image_get_dtb_by_index,
which results in null pointer accesses shortly after when trying to
check the header of a nonexistent DTB.

Fixes: 607b07554e2 ("android: boot: move to andr_image_data structure")
Signed-off-by: Sam Day <me@samcday.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250123-android-handle-no-dtb-v1-1-1cb7373247da@samcday.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agousb: gadget: g_dnl: Fix NULLPTR dereference when serial# is unset
Michael Ferolito [Tue, 28 Jan 2025 03:09:45 +0000 (21:09 -0600)]
usb: gadget: g_dnl: Fix NULLPTR dereference when serial# is unset

The current behaviour of this function will dereference a null pointer
if the serial# environment variable is unset. This was discovered on a
board where U-Boot did not have access to the first 256MB of ram,
resulting in a board crash.
In the event that U-Boot has full access to memory, it will still read
from address 0, which is probably not optimal.
This simple check is enough to fix it

Signed-off-by: Michael Ferolito <michaelsunn101@gmail.com>
Cc: Marek Vasut <marex@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250128030945.1219589-1-michaelsunn101@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agoarm64: configs: Remove SYS_BOOTM_LEN for TI devices
Aashvij Shenai [Wed, 29 Jan 2025 10:56:09 +0000 (16:26 +0530)]
arm64: configs: Remove SYS_BOOTM_LEN for TI devices

AM62x BOOTM_LEN is too small to contain OS images. Removing this sets the
size to a default 0x4000000 (for all arm64 devices).

It is unnecessary to specifically call the default size for the other
configs.

Signed-off-by: Kamlesh Gurudasani <kamlesh@ti.com>
Signed-off-by: Aashvij Shenai <a-shenai@ti.com>
4 months agoarm: Correct dependency for STATIC_MACH_TYPE
Liya Huang [Tue, 28 Jan 2025 13:31:49 +0000 (21:31 +0800)]
arm: Correct dependency for STATIC_MACH_TYPE

Kconfig should not display the STATIC_MACH_TYPE option when
SUPPORT_PASSING_ATAGS is not selected. For example, when using most
platforms with menuconfig, it shows the STATIC_MACH_TYPE option causing
confusion.  As we know, this should not occur when SUPPORT_PASSING_ATAGS
is not selected

[trini: Reword commit message]
Signed-off-by: Liya Huang <1425075683@qq.com>
4 months agoarmv7m: kconfig adds the NVIC option and masks the GIC option when NVIC is selected
Liya Huang [Tue, 28 Jan 2025 13:22:15 +0000 (21:22 +0800)]
armv7m: kconfig adds the NVIC option and masks the GIC option when NVIC is selected

ARMv7-M architecture uses NVIC instead of GIC.
NVIC is an interrupt controller specially designed for
ARM Cortex-M series processors.

Signed-off-by: Liya Huang <1425075683@qq.com>
4 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Wed, 5 Feb 2025 18:38:50 +0000 (12:38 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

4 months agozynqmp: Save "bootseq" environment variable in decimal format
Benjamin Szőke [Tue, 4 Feb 2025 20:56:17 +0000 (21:56 +0100)]
zynqmp: Save "bootseq" environment variable in decimal format

In U-Boot, most of mmc releated commands uses decimal value in arguments, like
"mmc dev ${bootseq}" or "bootargs=root=/dev/mmcblk${bootseq}p2". In order to
improve compatibilities, export "bootseq" number to environment variable in
decimal format instead of hex.

Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Link: https://lore.kernel.org/r/20250204205617.1238-1-egyszeregy@freemail.hu
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agoarm64: zynqmp: Describe images without TF-A
Michal Simek [Tue, 4 Feb 2025 08:53:41 +0000 (09:53 +0100)]
arm64: zynqmp: Describe images without TF-A

U-Boot can run out of EL3, NS-EL2 and NS-EL1. Currently default
configuration is NS-EL2 with TF-A but when TF-A is not passed and
configured images can still boot just fine. That's why support this
configuration and describe it via binman.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9b3dad80138e97005df3d033b4611c9d7e05a177.1738659214.git.michal.simek@amd.com
4 months agoarm64: zynqmp: Use DTB address base from .config
Michal Simek [Tue, 4 Feb 2025 08:53:40 +0000 (09:53 +0100)]
arm64: zynqmp: Use DTB address base from .config

CONFIG_XILINX_OF_BOARD_DTB_ADDR holds DTB address which U-Boot is checking.
Currently address in binman match default value but macro can be used
directly.
Also sync node name (s/hash-1/hash/) and sync location to have the same
order load/hash/image.

All binman DTSes are compiled that's why also guard
CONFIG_XILINX_OF_BOARD_DTB_ADDR which depends on OF_BOARD || OF_SEPARATE
which is a problem for mini configurations which are using OF_EMBED.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a22c9671b965b222bfd419f5bfaee012929f3d88.1738659214.git.michal.simek@amd.com
4 months agoarm64: zynqmp: Fix TEE loading address and add hash
Michal Simek [Tue, 4 Feb 2025 08:53:39 +0000 (09:53 +0100)]
arm64: zynqmp: Fix TEE loading address and add hash

There is incorrect loading address listed for TEE.
CONFIG_BL32_LOAD_ADDR should be used.
Also there is missing hash for this entry which is present for other nodes.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/4e7e3a7110acc050ea7c06ac661e5b5be46e8602.1738659214.git.michal.simek@amd.com
4 months agofpga: Make do_fpga_loads() static
Michal Simek [Mon, 3 Feb 2025 09:28:15 +0000 (10:28 +0100)]
fpga: Make do_fpga_loads() static

do_fpga_loads() is not called from anywhere else that's why make it static.

Reviewed-by: Alexander Dahl <ada@thorsis.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cbe93e4eb33752aaddc943b15fd04731d4f75b68.1738574893.git.michal.simek@amd.com
4 months agoconfigs: versal: update initial stack pointer
Padmarao Begari [Mon, 3 Feb 2025 09:04:09 +0000 (14:34 +0530)]
configs: versal: update initial stack pointer

The mini u-boot is hanging because of an initial stack
pointer address is used at half of the memory, when mini
u-boot is called reloc_fdt() function and doing memcpy()
for the fdt before relocation, and there is no sufficient
memory for the stack pointer. To fix, set an initial stack
pointer address to near the top of memory. The new stack
pointer address is assigned before calling the relocate
of u-boot based on the stack relocate calculation and
this new stack pointer is used while executing u-boot
from the relocated memory.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250203090409.844403-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agoxilinx: Enable MBEDTLS/LWIP/WGET and WGET_HTTPS
Michal Simek [Wed, 29 Jan 2025 15:31:25 +0000 (16:31 +0100)]
xilinx: Enable MBEDTLS/LWIP/WGET and WGET_HTTPS

Enable lwip and https on our platforms to be able to use it in a boot.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cb05adaf0758c2c4f1361f8665169897493638e7.1738164681.git.michal.simek@amd.com
4 months agoxilinx: Enable meminfo command with mapping
Michal Simek [Mon, 27 Jan 2025 11:11:38 +0000 (12:11 +0100)]
xilinx: Enable meminfo command with mapping

Enable meminfo command to be able to see where things are mapped.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b7f9f5e18e16a945277d4b8cfde5a7f057e77676.1737976295.git.michal.simek@amd.com
4 months agoxilinx: Enable mkfwumdata tool for a/b update
Michal Simek [Fri, 24 Jan 2025 13:04:07 +0000 (14:04 +0100)]
xilinx: Enable mkfwumdata tool for a/b update

Build mkfwumdata tool by default for building ab mdata structure.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/6d82c9a2db30e12ea17fa125c68a555d7f070851.1737723845.git.michal.simek@amd.com
4 months agofpga: add new symbol for fpga_loadb
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:34 +0000 (13:01 +0000)]
fpga: add new symbol for fpga_loadb

Adding new symbol for the fpga loadb command which is exclusive to
Xilinx. Default value is y for backward compatibility.

Clarify the type of file used for fpga programming commands

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-6-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agofpga: xilinx exclusive commands
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:33 +0000 (13:01 +0000)]
fpga: xilinx exclusive commands

Ensure all Xilinx exclusive fpga commands have a KConfig symbol and
dependency to FPGA_XILINX listed. Remove (Xilinx only) text from the
help command.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-5-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agofpga: resort fpga commands
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:32 +0000 (13:01 +0000)]
fpga: resort fpga commands

Resort the fpga commands both in the Kconfig and in the source code to
list

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-4-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 months agofpga: improve loads usage information
Ibai Erkiaga [Tue, 21 Jan 2025 13:01:31 +0000 (13:01 +0000)]
fpga: improve loads usage information

Current usage information for loads command is too verbose and long for
a command usage prompt. This flag simplifies the text for readability
purposes.

Signed-off-by: Ibai Erkiaga <ibai.erkiaga-elorza@amd.com>
Link: https://lore.kernel.org/r/20250121130138.1999916-3-ibai.erkiaga-elorza@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>