pandora-u-boot.git
2 months agoboard: phytec: common: Fix phytec_get_product_name()
Primoz Fiser [Tue, 8 Apr 2025 07:17:10 +0000 (09:17 +0200)]
board: phytec: common: Fix phytec_get_product_name()

Currently, phytec_get_product_name() function only takes care of PCM
SoM type, however in case of PCL, KSM or KSP SoM type it will return
error:

  phytec_get_product_name: Invalid SOM type

Add support for other SoM types as defined in phytec_som_type_str enum
(see phytec_som_detection.h) to get rid of the error.

While at it, also simplify switch case statements by grouping them
together. This makes it more concise and readable.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
2 months agocommon: Add CONFIG_SKIP_RELOCATE
Jesse Taube [Wed, 9 Apr 2025 18:08:33 +0000 (14:08 -0400)]
common: Add CONFIG_SKIP_RELOCATE

Add a check for CONFIG_SKIP_RELOCATE in reserve_uboot to skip the
relocation of the U-Boot image.
CONFIG_SKIP_RELOCATE skips relocation of U-Boot to the end of RAM
allowing for systems that have extremely limited RAM to run U-Boot.

Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 months agoarm: mach-k3: am62ax: fix MCU_CLKOUT0 parent clock mux
Bryan Brattlof [Wed, 9 Apr 2025 18:25:00 +0000 (13:25 -0500)]
arm: mach-k3: am62ax: fix MCU_CLKOUT0 parent clock mux

Much like what was fixed on the AM62x and AM62Px platforms[0]. The
CU_CLKOUT0 has two (25mhz and 50mhz) mux options however the clock
structure incorrectly duplicated the first 50mhz option twice. Fix this
for the AM62A platforms so the 25mhz option is selectable.

[0] https://lore.kernel.org/all/20250408161211.3165588-1-parth105105@gmail.com/

Reported-by: Parth Pancholi <parth.pancholi@toradex.com>
Signed-off-by: Bryan Brattlof <bb@ti.com>
2 months agoinclude: configs: Adds support for AM335x ICE PRUSS mode
Parvathi Pudi [Thu, 10 Apr 2025 06:59:55 +0000 (12:29 +0530)]
include: configs: Adds support for AM335x ICE PRUSS mode

On the AM3359 ICE we have two modes of operation CPSW mode or PRU-ICSS
mode.

For PRU-ICSS mode, connect Pin2 and Pin3 of J18 and J19 and for CPSW mode,
connect Pin1 and Pin2 of J18 and J19.

This patch adds support for PRUSS mode boot strapping from uboot.

Co-developed-by: Basharath Hussain Khaja <basharath@couthit.com>
Signed-off-by: Basharath Hussain Khaja <basharath@couthit.com>
Signed-off-by: Parvathi Pudi <parvathi@couthit.com>
2 months agoMerge tag 'tpm-master-14042025' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Tue, 15 Apr 2025 13:36:25 +0000 (07:36 -0600)]
Merge tag 'tpm-master-14042025' of https://source.denx.de/u-boot/custodians/u-boot-tpm

A small fix for the cr50 which is a TPM but doesn't support all
the TPM functionality. Since it deviates from our normal TIS compliant
TPMs it can't be started twice since running the selftests twice hangs.

2 months agofirmware: ti_sci: Scan all device instances when releasing exclusive devices
Nishanth Menon [Mon, 7 Apr 2025 12:15:54 +0000 (07:15 -0500)]
firmware: ti_sci: Scan all device instances when releasing exclusive devices

When FIT image with multiple dtbs are involved for R5 boot process,
R5 SPL starts off with the first instance of dtb to probe the
eeprom, then once we have identified the type of board, invocation
of setup_multi_dtb_fit will replace the gd->fdt_blob with the proper
board dtb match. However, when we do this, two things happen:

a) Prior to the invocation of setup_multi_dtb_fit, as part of the eeprom
   discovery process, i2c controller device is already probed and marked
   as exclusive with the match of the very first tisci match (from the
   original boot dtb). This list is stored in the info->dev_list of the
   first probe.
b) When the second dtb is loaded, tisci is probed again (since this is a
   new node) and the new info->dev_list is empty.

At this stage, the exclusive devices such as i2c instances used to
probe the board information is left in the old info->dev_list that is
no longer used actively by the system using the replaced dtb.

As a result of this, the cleanup we intend to do with
ti_sci_cmd_release_exclusive_devices is no longer complete and
leaves the instances such as i2c for eeprom marked used as we scan just
the new info->dev_list.

This creates a problem when Device Manager(DM) firmware starts up later
on in the boot process and identifies that this instance of i2c is
already marked active, so it assumes this can no longer be controlled
by software and is marked internally as reserved and HLOS can no
longer control these instances. This defeated the purpose of
ti_sci_cmd_release_exclusive_devices.

NOTE: This scheme works just fine if the FIT has just a single dtb as
the info->dev_list is upto date.

To fix this, let us make ti_sci_cmd_release_exclusive_devices scan the
all registrations of tisci instances and cleanup all exclusive devices
that have ever been registered.

As part of this, change the prototype of release_exclusive_devices to
drop the handle since that has no further meaning now.

Though this issue was identified on AM64-sk, this can be present in
other builds which use multi-fit-dtb for R5 SPL startup.

Fixes: 9566b777ae0a ("firmware: ti_sci: Add a command for releasing all exclusive devices")
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2 months agoIOMUX: Fix stopping unused dropped consoles
Stephan Gerhold [Mon, 7 Apr 2025 11:10:00 +0000 (13:10 +0200)]
IOMUX: Fix stopping unused dropped consoles

iomux_match_device() returns -ENOENT instead of the end index, which means
console_stop() is never called at the moment for unused consoles.

This prevents e.g. f_acm from releasing the USB gadget interface when
removing it from stdio/stderr/stdin.

Fixes: b672c1619bb9 ("IOMUX: Split out iomux_match_device() helper")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 months agotpm: cr50: Support opening the TPM multiple times
Simon Glass [Tue, 1 Apr 2025 21:28:10 +0000 (10:28 +1300)]
tpm: cr50: Support opening the TPM multiple times

The tpm_auto_start() function is used in tests and assumes that it can
open the TPM even if it is already open and a locality claimed. The cr50
driver does not use the common TPM2 TIS code so lacks a check for the
is_open field of struct tpm_chip and in fact it doesn't use that struct.

Add an equivalent check to cr50_i2c_open().

This fixes all init sequences on that TPM -- e.g 'tpm init && tpm init'
or 'tpm autostart && tpm init' used to hang

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoMerge patch series "Static initcalls"
Tom Rini [Mon, 14 Apr 2025 14:59:45 +0000 (08:59 -0600)]
Merge patch series "Static initcalls"

Jerome Forissier <jerome.forissier@linaro.org> says:

This series replaces the dynamic initcalls (with function pointers) with
static calls, and gets rid of initcall_run_list(), init_sequence_f,
init_sequence_f_r and init_sequence_r. This makes the code simpler and the
binary slighlty smaller: -2281 bytes/-0.21 % with LTO enabled and -510
bytes/-0.05 % with LTO disabled (xilinx_zynqmp_kria_defconfig).

Execution time doesn't seem to change noticeably. There is no impact on
the SPL.

The inline assembly fixes, although they look unrelated, are triggered
on some platforms with LTO enabled. For example: kirkwood_defconfig.

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

Link: https://lore.kernel.org/r/20250404135038.2134570-1-jerome.forissier@linaro.org
2 months agoinitcall: remove initcall_run_list()
Jerome Forissier [Fri, 4 Apr 2025 13:50:37 +0000 (15:50 +0200)]
initcall: remove initcall_run_list()

Now that all initcalls have been converted to static calls, remove
initcall_run_list().

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2 months agocommon: board: make initcalls static
Jerome Forissier [Fri, 4 Apr 2025 13:50:36 +0000 (15:50 +0200)]
common: board: make initcalls static

Change board_init_f(), board_init_f_r() and board_init_r() to make
static calls instead of iterating over the init_sequence_f,
init_sequence_f_r and init_sequence_r arrays, respectively. This makes
the code a simpler (and even more so when initcall_run_list() is
later removed) and it reduces the binary size as well. Tested with
xilinx_zynqmp_kria_defconfig; bloat-o-meter results:

- With LTO
add/remove: 106/196 grow/shrink: 10/28 up/down: 31548/-33829 (-2281)
Total: Before=1070471, After=1068190, chg -0.21%
- Without LTO
add/remove: 0/54 grow/shrink: 3/0 up/down: 2322/-2832 (-510)
Total: Before=1121723, After=1121213, chg -0.05%

Execution time does not change in a noticeable way.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2 months agoarm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set
Jerome Forissier [Fri, 4 Apr 2025 13:50:35 +0000 (15:50 +0200)]
arm: asm/system.h: mrc and mcr need .arm if __thumb2__ is not set

The mcr and msr instructions are available in Thumb mode only if
Thumb2 is supported. Therefore, if __thumb2__ is not set, make
sure we switch to ARM mode by inserting a .arm directive in the
inline assembly.

Fixes LTO link errors with kirkwood platforms, triggered by a later
commit:

 tools/buildman/buildman -o /tmp/build -eP sheevaplug
 [...]
 {standard input}:24085: Error: selected processor does not support `mrc p15,0,r3,c1,c0,0' in Thumb mode

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2 months agoefi_loader: Moved the generated ESL file to objtree
Ilias Apalodimas [Sun, 13 Apr 2025 11:34:26 +0000 (14:34 +0300)]
efi_loader: Moved the generated ESL file to objtree

Tom reports that generating the ESL file we need for authenticated
capsule updates fails to work on azure which expects a RO git tree.

Move it to $(objtree)

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Tom Rini [Sat, 12 Apr 2025 18:43:40 +0000 (12:43 -0600)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra

2 months agoARM: tegra20: add funcmux for exposing UART over uSD slot on Tegra 20
Artur Kowalski [Sun, 30 Mar 2025 19:26:39 +0000 (21:26 +0200)]
ARM: tegra20: add funcmux for exposing UART over uSD slot on Tegra 20

UART-A can be exposed through uSD, this was tested on Transformer T20
but should work on all Ventana-based boards.

TX is exported on SDD pingroup corresponding to uSD CLK pin
RX is exported on SDB which is CMD pin in uSD slot

Signed-off-by: Artur Kowalski <arturkow2000@gmail.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: nvidia: tegratab: add Nvidia Tegra Note 7 support
Svyatoslav Ryhel [Thu, 29 Jun 2023 07:10:26 +0000 (10:10 +0300)]
board: nvidia: tegratab: add Nvidia Tegra Note 7 support

The Tegra Note 7 is a mini tablet computer and the second Tegra 4
based mobile device designed by Nvidia that runs the Android operating
system. The Tegra Note has a 7" IPS display with 1280 x 800 (217 ppi)
resolution. The 1 GB of RAM and 16 GB of internal memory can be
supplemented with a microSDXC card giving up to 64 GB of additional
storage.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: asus: transformer: add ASUS Transformer Pad TF701T support
Svyatoslav Ryhel [Tue, 14 Mar 2023 16:24:51 +0000 (18:24 +0200)]
board: asus: transformer: add ASUS Transformer Pad TF701T support

The ASUS Transformer Pad TF701T is an Android tablet computer made by
ASUS, successor to the ASUS Transformer Pad Infinity. The tablet includes
a Tegra 4 T114 processor clocked at 1.9 GHz, and an upgraded 2560×1600
pixel resolution screen, increasing the pixel density to 300 PPI and
a mobile dock. Transformers (t114) board derives from Nvidia Macallan
development board.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra114: clock: avoid touching DISP clocks on init
Svyatoslav Ryhel [Thu, 3 Apr 2025 07:52:51 +0000 (10:52 +0300)]
ARM: tegra114: clock: avoid touching DISP clocks on init

The clock initialization routine sets the DISP* clock parent to PLLC,
resulting in DC failure in the case when PLLD was previously configured.
This issue disrupts chainloading and to prevent failures caused by DISP*
clock parent conflicts, clock initialization should not modify DISP*. The
DC driver handles DISP* configuration.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: replace per-device config headers with generic Tegra
Svyatoslav Ryhel [Mon, 31 Mar 2025 14:18:18 +0000 (17:18 +0300)]
ARM: tegra: replace per-device config headers with generic Tegra

Most device headers contain SoC specific part and common Tegra post part.
Add a generic header which can be used by any Tegra device of one of the
supported SoC generations (T20, T30, T114, T124 or T210) without need in
device specific configuration.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: convert CFG_TEGRA_BOARD_STRING into Kconfig option
Svyatoslav Ryhel [Mon, 31 Mar 2025 13:44:24 +0000 (16:44 +0300)]
ARM: tegra: convert CFG_TEGRA_BOARD_STRING into Kconfig option

Convert CFG_TEGRA_BOARD_STRING into Kconfig option and move it into device
board Kconfig.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: board: set CFG_SYS_NS16550_COM1 according to TEGRA_ENABLE_UART
Svyatoslav Ryhel [Mon, 31 Mar 2025 06:33:17 +0000 (09:33 +0300)]
ARM: tegra: board: set CFG_SYS_NS16550_COM1 according to TEGRA_ENABLE_UART

Link CFG_SYS_NS16550_COM1 value to chosen CONFIG_TEGRA_ENABLE_UART Tegra
wide. Remove all CFG_SYS_NS16550_COM1 from device headers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agopinctrl: tegra: detect unknown/invalid pin/func configurations
Svyatoslav Ryhel [Mon, 31 Mar 2025 08:28:53 +0000 (11:28 +0300)]
pinctrl: tegra: detect unknown/invalid pin/func configurations

Applies same logic to general Tegra pincontrol driver as is done to Tegra20
by commit:

a35bf832d70 ("pinctrl: tegra20: detect unknown/invalid pin/func
configurations")

Suggested-by: Artur Kowalski <arturkow2000@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agopinctrl: tegra20: detect unknown/invalid pin/func configurations
Artur Kowalski [Sun, 30 Mar 2025 19:11:54 +0000 (21:11 +0200)]
pinctrl: tegra20: detect unknown/invalid pin/func configurations

Tegra20 driver doesn't know about some pin configurations and even about
some pins. In case when pin configuration is unknown the pin would be
muxed to whatever is under function 0, in case when pin itself is
unknown, it could cause out-of-bounds array access in pinmux_set_func
and pinmux_set_pullupdown.

Signed-off-by: Artur Kowalski <arturkow2000@gmail.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: motorola: add Atrix 4G MB860 and Droid X2 MB870 support
Svyatoslav Ryhel [Sun, 3 Dec 2023 17:34:49 +0000 (19:34 +0200)]
board: motorola: add Atrix 4G MB860 and Droid X2 MB870 support

The Motorola Atrix 4G (MB860) and Droid X2 (MB870) both featured a
dual-core NVIDIA Tegra 2 AP20H processor clocked at 1GHz, coupled with 1GB
of DDR2 RAM. Storage consisted of 16GB of internal flash memory, expandable
via microSD. The display was a 4.0-inch TFT LCD with a resolution of
960x540 pixels (qHD). The devices originally ran on Android up to 2.3
(Gingerbread).

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: backlight: add TI LM3532 led controller
Svyatoslav Ryhel [Wed, 19 Mar 2025 11:51:58 +0000 (13:51 +0200)]
video: backlight: add TI LM3532 led controller

The LM3532 is a 500-kHz fixed frequency asynchronous boost converter which
provides the power for 3 high-voltage, low-side current sinks. The device
is programmable over an I2C-compatible interface and has independent
current control for all three channels.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: panel: add Motorola Atrix 4G and Droid X2 panel
Svyatoslav Ryhel [Wed, 19 Mar 2025 08:15:29 +0000 (10:15 +0200)]
video: panel: add Motorola Atrix 4G and Droid X2 panel

Add support for the LCD panel module used in Motorola Atrix 4G or Droid X2.
Exact panel vendor and model are unknown. The panel has a 540x960 (qHD)
resolution and uses 24 bit RGB per pixel.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoinput: add support for CPCAP power button
Svyatoslav Ryhel [Tue, 25 Mar 2025 18:23:07 +0000 (20:23 +0200)]
input: add support for CPCAP power button

CPCAP has a dedicated interrupt for power button. Implement this to have
more input control over the devices.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agopower: regulator: add regulator support for CPCAP PMIC
Svyatoslav Ryhel [Mon, 17 Mar 2025 18:49:22 +0000 (20:49 +0200)]
power: regulator: add regulator support for CPCAP PMIC

The driver provides regulator set/get voltage and enable/disable functions
for CPCAP PMIC.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agopower: pmic: add the basic CPCAP PMIC support
Svyatoslav Ryhel [Sat, 1 Feb 2025 14:02:45 +0000 (16:02 +0200)]
power: pmic: add the basic CPCAP PMIC support

The CPCAP is a Motorola/ST-Ericsson creation, a multifunctional IC whose
main purpose was power control. It was used in a wide variety of Motorola
products, both Tegra and OMAP based. The most notable devices using this
PMIC are the Motorola Droid 4, Atrix 4G, and Droid X2.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: tegra: adjust DC and DSI config names
Svyatoslav Ryhel [Sat, 29 Mar 2025 15:18:12 +0000 (17:18 +0200)]
video: tegra: adjust DC and DSI config names

Fix DC and DSI config names to reflect more generic nature of existing
Tegra video drivers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: tegra: drop prefix from file names
Svyatoslav Ryhel [Sat, 29 Mar 2025 15:00:20 +0000 (17:00 +0200)]
video: tegra: drop prefix from file names

Dir name is enough.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: move tegra124 into common tegra dir
Svyatoslav Ryhel [Sat, 29 Mar 2025 14:53:24 +0000 (16:53 +0200)]
video: move tegra124 into common tegra dir

Place Tegra124 SOR and eDP implenetation into common Tegra driver folder
until it is integrated into existing setup.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: rename tegra20 to tegra
Svyatoslav Ryhel [Sat, 29 Mar 2025 14:49:53 +0000 (16:49 +0200)]
video: rename tegra20 to tegra

Since this set of drivers suports four Tegra SoC generations, lets name it
just 'tegra'.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
2 months agovideo: tegra20: dsi: add Tegra20 support
Svyatoslav Ryhel [Mon, 24 Mar 2025 19:25:17 +0000 (21:25 +0200)]
video: tegra20: dsi: add Tegra20 support

Existing Tegra30 DSI configuration is fully compatible with Tegra20.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agosysreset: diverge GPIO reset and poweroff configs per-phase
Svyatoslav Ryhel [Sat, 29 Mar 2025 11:02:03 +0000 (13:02 +0200)]
sysreset: diverge GPIO reset and poweroff configs per-phase

GPIO reset and power-off functionality depends on device tree data, which
is often absent in SPL or TPL. To address this, incorporate PHASE_ into the
config option and add Kconfig option or each phase.

Adjust SYSRESET_GPIO and POWEROFF_GPIO uses to address possible
regressions.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: clock: fix PLLD2 info table entry on Tegra124 and Tegra210
Svyatoslav Ryhel [Tue, 25 Mar 2025 07:51:47 +0000 (09:51 +0200)]
ARM: tegra: clock: fix PLLD2 info table entry on Tegra124 and Tegra210

Historically, PLLD2 mirrored PLLD's layout on Tegra30 and 114. However,
with the introduction of Tegra124, this changed. This layout alteration was
not considered, and it now requires a corrective action to prevent future
complications.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: clock: take in account PLLD/D2 enable bit on clock_set_rate
Svyatoslav Ryhel [Mon, 24 Mar 2025 19:24:45 +0000 (21:24 +0200)]
ARM: tegra: clock: take in account PLLD/D2 enable bit on clock_set_rate

PLLD and PLLD2 clocks possess a unique enable bit within their
miscellaneous register. Take this into account when using clock_set_rate
function.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agospi: tegra20_slink: fix CS polarity setup
Svyatoslav Ryhel [Sun, 26 Jan 2025 17:48:22 +0000 (19:48 +0200)]
spi: tegra20_slink: fix CS polarity setup

Add missing configuration of chip select polarity. Default polarity is LOW,
which satisfies most cases but some devices require HIGH polarity and will
not work.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoMerge patch series "binman: Check code-coverage requirements"
Tom Rini [Fri, 11 Apr 2025 20:32:02 +0000 (14:32 -0600)]
Merge patch series "binman: Check code-coverage requirements"

Simon Glass <sjg@chromium.org> says:

This series adds a cover-coverage check to CI for Binman. The iMX8 tests
are still not completed, so a work-around is included for those.

A few fixes are included for some other problems.

Link: https://lore.kernel.org/r/20250410124333.843527-1-sjg@chromium.org
2 months agoCI: Run code-coverage test for Binman
Simon Glass [Thu, 10 Apr 2025 12:43:05 +0000 (06:43 -0600)]
CI: Run code-coverage test for Binman

Binman includes a good set of tests covering all of its functionality.
This includes a code-coverage test.

However to date the code-coverage test has not been checked
automatically by CI, relying on people to run 'binman test -T'
themselves.

Plug the gap to avoid bugs creeping in future.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agobinman: Work around missing test coverage
Simon Glass [Thu, 10 Apr 2025 12:43:04 +0000 (06:43 -0600)]
binman: Work around missing test coverage

The iMX8 entry-types don't have proper test coverage. Add a work-around
to skip this for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Workaround lz4 cli padding in test cases
Jiaxun Yang [Thu, 10 Apr 2025 12:43:03 +0000 (06:43 -0600)]
binman: Workaround lz4 cli padding in test cases

Newer lz4 util is not happy with any padding at end of file,
it would abort with error message like:

Stream followed by undecodable data at position 43.

Workaround by skipping testCompUtilPadding test case and manually
strip padding in testCompressSectionSize test case.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agobinman: Drop algo check in CheckSetHashValue()
Simon Glass [Thu, 10 Apr 2025 12:43:02 +0000 (06:43 -0600)]
binman: Drop algo check in CheckSetHashValue()

The CheckAddHashValue() function is always called before this one, so
the algorithm check is never used. Replace it with an assert to avoid a
coverage error.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: fit: Drop unused code
Simon Glass [Thu, 10 Apr 2025 12:43:01 +0000 (06:43 -0600)]
binman: fit: Drop unused code

The key-name-hint case is not tested so is presumably not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Drop GetRootSkipAtStart()
Simon Glass [Thu, 10 Apr 2025 12:43:00 +0000 (06:43 -0600)]
binman: Drop GetRootSkipAtStart()

This method is not called anymore, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Exclude dist-packages and site-packages
Simon Glass [Thu, 10 Apr 2025 12:42:59 +0000 (06:42 -0600)]
binman: Exclude dist-packages and site-packages

Newer versions of the python3-coverage tool require a directory
separator before and after the directory name. Add this so that system
package are not included in the coverage report.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agobinman: Add coverage to requirements
Simon Glass [Thu, 10 Apr 2025 12:42:58 +0000 (06:42 -0600)]
binman: Add coverage to requirements

We need the code-coverage package to run the coverage tests. Add this
package.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoMerge patch series "Switch to using $(PHASE_) in Makefiles"
Tom Rini [Fri, 11 Apr 2025 18:16:49 +0000 (12:16 -0600)]
Merge patch series "Switch to using $(PHASE_) in Makefiles"

Tom Rini <trini@konsulko.com> says:

This series switches to always using $(PHASE_) in Makefiles when
building rather than $(PHASE_) or $(XPL_). It also starts on documenting
this part of the build, but as a follow-up we need to rename
doc/develop/spl.rst and expand on explaining things a bit.

Link: https://lore.kernel.org/r/20250401225851.1125678-1-trini@konsulko.com
2 months agodoc/develop/codingstyle.rst: Expand to include CONFIG_IS_ENABLED and PHASE_
Tom Rini [Tue, 1 Apr 2025 22:55:25 +0000 (16:55 -0600)]
doc/develop/codingstyle.rst: Expand to include CONFIG_IS_ENABLED and PHASE_

Expand the conditional compilation section to explain when to use
CONFIG_IS_ENABLED rather than IS_ENABLED and provide an example. Next,
note what the PHASE_ macro is supposed to be used for as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agodoc/develop/codingstyle.rst: Add a section on conditional compilation
Tom Rini [Tue, 1 Apr 2025 22:55:24 +0000 (16:55 -0600)]
doc/develop/codingstyle.rst: Add a section on conditional compilation

In order to make a start on explaining how and when to use certain
macros, we need to document their usage somewhere. As a first step, take
section 21 of the v6.13 Linux Kernel coding-style document on
conditional compilation, verbatim, and add it to our documentation.
Further rewording to be clearer about U-Boot will be done next.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoKbuild: Always use $(PHASE_)
Tom Rini [Tue, 1 Apr 2025 22:55:23 +0000 (16:55 -0600)]
Kbuild: Always use $(PHASE_)

It is confusing to have both "$(PHASE_)" and "$(XPL_)" be used in our
Makefiles as part of the macros to determine when to do something in our
Makefiles based on what phase of the build we are in. For consistency,
bring this down to a single macro and use "$(PHASE_)" only.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agocmd: optee: fix hello subcommand argument check
Vincent Stehlé [Fri, 4 Apr 2025 12:53:58 +0000 (14:53 +0200)]
cmd: optee: fix hello subcommand argument check

When the `optee hello' subcommand is called, the do_optee_hello_world_ta()
function passes a NULL pointer to the strcmp() function while verifying its
input argument, which results in the following crash:

  => optee hello
  "Synchronous Abort" handler, esr 0x96000010, far 0x0

Fix this by verifying the number of input arguments instead.

Fixes: e3cf80fbe02d ("cmd: Add support for optee commands")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jerome Forissier <jerome.forissier@linaro.org>
Cc: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
2 months agoconfigs: qemu-arm raise CONFIG_NR_DRAM_BANKS
Heinrich Schuchardt [Thu, 3 Apr 2025 14:47:53 +0000 (16:47 +0200)]
configs: qemu-arm raise CONFIG_NR_DRAM_BANKS

The number of memory banks in QEMU is not bounded by 1.

In this example we have two banks:

    qemu-system-aarch64 \
    -machine virt \
    -nographic \
    -cpu cortex-a72 \
    -m 8G \
    -smp 8,sockets=2,cores=4,threads=1 \
    -object memory-backend-ram,id=mem0,size=4G \
    -numa node,cpus=0-3,memdev=mem0 \
    -object memory-backend-ram,id=mem1,size=4G \
    -numa node,cpus=4-7,memdev=mem1 \
    -bios u-boot.bin

Use the default value defined in /Kconfig as 4.

Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Suggested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoconfigs: phycore_am62x_a53_defconfig: Enable gpio
Daniel Schultz [Fri, 28 Mar 2025 05:58:24 +0000 (22:58 -0700)]
configs: phycore_am62x_a53_defconfig: Enable gpio

The AM62x uses the DA8XX (DaVinci) GPIO controller. Enable
CONFIG_DA8XX_GPIO to support GPIO access from the Cortex-A53.

Also enable the 'gpio' command to allow users to interact
with GPIOs from the U-Boot shell.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 months agoconfigs: phycore_am62x_a53_defconfig: Enable remoteproc cmd
Daniel Schultz [Fri, 28 Mar 2025 05:58:23 +0000 (22:58 -0700)]
configs: phycore_am62x_a53_defconfig: Enable remoteproc cmd

This enables the 'rproc' command, allowing users to
start, stop, and manage co-processors as well as load firmware
images.

Useful for systems with auxiliary cores, such as the M4 core
in the AM62x soc.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 months agoconfigs: phycore_am64x_a53_defconfig: Enable remoteproc cmd
Daniel Schultz [Fri, 28 Mar 2025 05:58:22 +0000 (22:58 -0700)]
configs: phycore_am64x_a53_defconfig: Enable remoteproc cmd

This enables the 'rproc' command, allowing users to
start, stop, and manage co-processors as well as load firmware
images.

Useful for systems with auxiliary cores, such as M4 or R5 cores
in the AM64x soc.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2 months agoCI: Build missing binman tools before binman tests
Leonard Anderweit [Tue, 1 Apr 2025 08:46:42 +0000 (10:46 +0200)]
CI: Build missing binman tools before binman tests

The CI image does not ship with all tools required for the binman tests.
Have binman build the missing tools.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
2 months agoMerge tag 'qcom-for-2025.07' of https://source.denx.de/u-boot/custodians/u-boot-snapd...
Tom Rini [Fri, 11 Apr 2025 15:12:16 +0000 (09:12 -0600)]
Merge tag 'qcom-for-2025.07' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

Qualcomm changes for v2025.07:

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/25653

There's been a surprising amount of activity lately on the Qualcomm
side with the two oldest boards getting some fresh attention and a lot
of cleanup and polish going on across the board.

* SDM660 gets USB phy fixes and a pinctrl driver
* The recently added SA8775P/QCS9100 SoC gets a pinctrl driver
* The Qualcomm pinctrl driver now handles reserved pins correctly,
  fixing crashes on some boards when running "gpio status -a"
* OF_UPSTREAM_BUILD_VENDOR is enabled in qcom_defconfig
* SDM845 and SC7280 get missing clocks added (since we're now stricter
  about those). This gets USB working more reliably in more cases.
* DM_USB_GADGET is enabled for all boards using DWC3 and fasbtoot is
  enabled too
* A bug in the livetree fixup code is fixed (making USB work on a lot
  more platforms)
* Button label lookup is made case insensitive* bootretry becomes more dynamic, allowing it to be hijacked to make a
  "persistent" boot menu that allows dropping to U-Boot shell later on
* A new qcom-phone.config fragment is added along with a phone-specific
  default environment and phone-specific debugging/bringup docs. These
  make U-Boot more usable on devices without a serial port or keyboard.
* The db820c gets fixed up and updated documentation
* The db410c also gets some love and modernisation as well as a new
  reviewer.
* A new driver is added for the USB VBUS regulator found on various
  Qualcomm PMICs
* The Qualcomm SPMI driver gets some fixes and cleanup for SPMI v5 and
  v7 support.

2 months agoMerge tag 'u-boot-imx-master-20250411' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Fri, 11 Apr 2025 15:11:38 +0000 (09:11 -0600)]
Merge tag 'u-boot-imx-master-20250411' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Add i.MX8MP LDB support.
- Various phycore-imx93 environment improvements.
- Add support for Toradex SMARC iMX8MP.

2 months agoMerge tag 'efi-2025-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 11 Apr 2025 15:09:08 +0000 (09:09 -0600)]
Merge tag 'efi-2025-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-07-rc1

CI:

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

Documentation:

* Update authenticated capsules documentation

UEFI:

* Add support for loading FIT images including initrd
  - efi_loader: efi_load_initrd: provide a memory mapped initrd
  - efi_loader: binary_run: register an initrd
  - bootm: add support for initrd in do_bootm_efi
* efi_selftest: remove un-needed NULL checks
* efi: Fix efiboot for payloads loaded from memory

* Print extra information from the bootmgr
* Move public cert for capsules to .rodata
* Set EFI capsule dfu_alt_info env explicitly
* Make FDT extra space configurable
* Install the ACPI table from the bloblist
* Handle GD_FLG_SKIP_RELOC
* Handle malloc() errors

Others:

* acpi: select CONFIG_BLOBLIST
* smbios: select CONFIG_BLOBLIST
* xilinx: dfu: Fill directly update_info.dfu_string
* cmd: fwu: Dump custom fields from mdata structure
* board: remove capsule update support in set_dfu_alt_info()

2 months agoMerge tag 'mmc-2025-04-11' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Fri, 11 Apr 2025 14:50:55 +0000 (08:50 -0600)]
Merge tag 'mmc-2025-04-11' of https://source.denx.de/u-boot/custodians/u-boot-mmc

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

- Support Sandisk and Micron eMMC BOOT/RPMB hardware partition resizing
- Optimize eMMC erasing time
- Simplify poll CD logic
- Fix possible Synchronous Abort for sdhci
- Kconfig dependencies fix
- Minor code update, return fail if mmc_complete_init, avoid uniniting twice

2 months agoboard: dragonboard410c: Update maintainers
Stephan Gerhold [Mon, 7 Apr 2025 16:59:34 +0000 (18:59 +0200)]
board: dragonboard410c: Update maintainers

Ramon has been inactive on the U-Boot mailing list for over a year now and
the DB410c port has not been updated much lately. I've been doing most of
the DB410c-specific fixes/rework lately and try to test it every now and
then, so add myself as new maintainer. Also add Sam as reviewer, since he's
been doing lots of testing and reviews for MSM8916 recently.

Cc: Sam Day <me@samcday.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-13-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Use button_cmd instead of custom code
Stephan Gerhold [Mon, 7 Apr 2025 16:59:33 +0000 (18:59 +0200)]
board: dragonboard410c: Use button_cmd instead of custom code

Simplify the board code by using the new BUTTON_CMD functionality, instead
of implementing this separately using C code. This allows disabling or
customizing this functionality if wanted.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-12-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Enable support for Android boot images
Stephan Gerhold [Mon, 7 Apr 2025 16:59:32 +0000 (18:59 +0200)]
board: dragonboard410c: Enable support for Android boot images

The U-Boot port for DB410c still has plenty of extra space available at
this point, so avoid disabling features that would be normally enabled by
default. In particular, this incldues support for Android boot images,
which is quite likely to be used together with the USB Fastboot interface.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-11-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS
Stephan Gerhold [Mon, 7 Apr 2025 16:59:31 +0000 (18:59 +0200)]
board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS

Reduce the environment size by using standard boot instead of distro boot.
It uses faster bootdevs first by default (eMMC -> SD -> USB -> Network), so
set "boot_targets" to keep the current ordering (USB -> SD -> eMMC ->
Network). Perhaps this should be changed for consistency, but for now this
keeps the behavior similar to before.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-10-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Enable RTL8152 ethernet
Stephan Gerhold [Mon, 7 Apr 2025 16:59:30 +0000 (18:59 +0200)]
board: dragonboard410c: Enable RTL8152 ethernet

The Geniatech DB4 V3 [1] has a RTL8152 onboard for Ethernet. I don't have
one to test if that works, but the other USB Ethernet drivers work pretty
much as-is, so just enable it with the assumption it will work out fine.

[1]: https://www.96boards.org/product/db4/

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-9-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Fix counter frequency
Stephan Gerhold [Mon, 7 Apr 2025 16:59:29 +0000 (18:59 +0200)]
board: dragonboard410c: Fix counter frequency

The actual counter frequency is 19.2 MHz, not 19.0 MHz. This isn't really
used so far though, since probably no one (except me) ever tried using
U-Boot in EL3 where we need to program the counter frequency.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-8-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Use dynamically allocated load addresses
Stephan Gerhold [Mon, 7 Apr 2025 16:59:28 +0000 (18:59 +0200)]
board: dragonboard410c: Use dynamically allocated load addresses

The generic Qualcomm board code allocates addresses for loading the kernel,
ramdisk, DT, fastboot etc. This also happens on the DB410c and already
overrides these definitions defined in the default env. So let's just drop
the static ones, since the dynamic ones work just fine.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-7-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Drop unused linux_image
Stephan Gerhold [Mon, 7 Apr 2025 16:59:27 +0000 (18:59 +0200)]
board: dragonboard410c: Drop unused linux_image

This does not seem to be used anywhere.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-6-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Drop reflash functionality
Stephan Gerhold [Mon, 7 Apr 2025 16:59:26 +0000 (18:59 +0200)]
board: dragonboard410c: Drop reflash functionality

This is broken ever since we switched to using U-Boot as first stage
bootloader. Since no one seems to test this actively, let's just drop this
entirely. There are other tools available for re-flashing the DB410c.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-5-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Drop UNSTUFF_BITS() macro
Stephan Gerhold [Mon, 7 Apr 2025 16:59:25 +0000 (18:59 +0200)]
board: dragonboard410c: Drop UNSTUFF_BITS() macro

This was originally taken from Linux, but at this point it's an inline
function upstream and no longer a macro. Given that we just want to extract
the serial number from the MMC CID, let's just inline that specifically.
This is also the style used in the MMC core code within U-Boot.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-4-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Fix BD address
Stephan Gerhold [Mon, 7 Apr 2025 16:59:24 +0000 (18:59 +0200)]
board: dragonboard410c: Fix BD address

local-bd-address in the device tree needs to be formatted with the least
significant byte first (i.e. little endian). We're not doing this when
adding it to the DT, which means the MAC address ends up being reversed in
Linux. Fix this by reversing the array before setting it in the DT.

We're also flipping the wrong bit when generating the BD address. Before
reversing the array, the least significant bit is in the last byte.

Fixes: ff06dc240325 ("db410: alter WLAN/BT MAC address fixup")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-3-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: dragonboard410c: Fix RAM size
Stephan Gerhold [Mon, 7 Apr 2025 16:59:23 +0000 (18:59 +0200)]
board: dragonboard410c: Fix RAM size

DB410c has exactly 1 GiB of RAM. Some of it is reserved, but this is
described separately in the DT.

This was fixed before in commit 1d667227ea51 ("board: dragonboard410c: Fix
PHYS_SDRAM_1_SIZE"), but was reintroduced when DB410c was converted to use
the upstream device tree.

Note that there are variants of apq8016-sbc with 2 GiB RAM (e.g. the
Geniatech DB4). They need the WIP SMEM memory map parsing [1] to use the
full amount of RAM.

[1]: https://lore.kernel.org/u-boot/20241124-b4-modernise-smem-v1-0-b7852c11b67c@linaro.org/T/

Fixes: ed8fbd2889fc ("dts: msm8916: replace with upstream DTS")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-2-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agomach-snapdragon: Fix EL2 boot on DragonBoard 410c
Stephan Gerhold [Mon, 7 Apr 2025 16:59:22 +0000 (18:59 +0200)]
mach-snapdragon: Fix EL2 boot on DragonBoard 410c

The workaround for the "PSCI bug" on DragonBoard 410c implemented in
arch/arm/mach-snapdragon/include/mach/boot0.h clobbers the x0 register
by storing the CurrentEL in there. When running in EL1, the mode switch
sequence implemented there later clears the register again, but this is
skipped when U-Boot is booted in EL2.

This causes crashes in the mach-snapdragon board_fdt_blob_setup() later,
because the invalid address stored in x0 gets dereferenced to check if it
points to a valid DTB.

We can't rely on having a valid values in the CPU registers for the first
stage bootloader configuration on DB410c, and nothing would place a DTB
there anyway. Skip selecting the SAVE_PREV_BL_FDT_ADDR option for the boot0
hook case to avoid crashing with the clobbered register value.

Fixes: 059d526af312 ("mach-snapdragon: generalise board support")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by:
Link: https://lore.kernel.org/r/20250407-db410c-fixes-v1-1-524aefbc8bb4@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agopinctrl: qcom: handle reserved ranges
Caleb Connolly [Thu, 10 Apr 2025 08:52:38 +0000 (10:52 +0200)]
pinctrl: qcom: handle reserved ranges

Some Qualcomm boards feature reserved ranges of pins which are protected
by firmware. Attempting to read or write any registers associated with
these pins results the board resetting.

Add support for parsing these ranges from devicetree and ensure that the
pinctrl and GPIO drivers don't try to interact with these pins.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250410-topic-sm8x50-pinctrl-reserved-ranges-v2-1-654488392b9a@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agobutton: make button_get_by_label() case insensitive
Caleb Connolly [Mon, 31 Mar 2025 12:23:23 +0000 (14:23 +0200)]
button: make button_get_by_label() case insensitive

This function is already doing a fuzzy match, since there are no
guarantees that a given label is unique.

Ignoring case makes it much easier to catch "Volume down" or "Volume
Down" in board-agnostic code.

Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-6-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agobutton: qcom-pmic: prettify and standardise button labels
Caleb Connolly [Mon, 31 Mar 2025 12:23:22 +0000 (14:23 +0200)]
button: qcom-pmic: prettify and standardise button labels

Boards using gpio-keys for volume buttons label them "Volume Down",
let's match that here, and make the power button nicer too.

This simplifies configuring button_cmds in a board-agnostic way.

Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-5-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agodoc: board/qualcomm: describe phone support and bringup
Caleb Connolly [Mon, 31 Mar 2025 12:23:21 +0000 (14:23 +0200)]
doc: board/qualcomm: describe phone support and bringup

Add some documentation which attempts to describe Qualcomm smartphone
support with the qcom-phone.config fragment, as well as a high level
debugging guide for diagnosing U-Boot issues when UART and framebuffer
are unavailable.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-4-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agobootretry: check for bootretry variable changes
Caleb Connolly [Mon, 31 Mar 2025 12:23:20 +0000 (14:23 +0200)]
bootretry: check for bootretry variable changes

To enable more complex sequencing of the bootmenu, autoboot, and
bootretry, handle changes to the bootretry variable between tries. This
makes it possible to turn bootretry off (e.g. to drop to a shell) and
then back on again.

This makes it possible to have a persistent bootmenu (the only way to
navigate U-Boot on devices like smartphones which lack a physical
keyboard) by having bootcmd be defined to launch the bootmenu. This
allows for menu options like enabling USB mass storage gadget to return
back to the boot menu once the gadget is shut down.

Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-3-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agocli_hush: support running bootcmd on boot retry
Caleb Connolly [Mon, 31 Mar 2025 12:23:19 +0000 (14:23 +0200)]
cli_hush: support running bootcmd on boot retry

Introduce a new config option: RETRY_BOOTCMD. When enabled this causes
hush shell to re-run "bootcmd" when the auto-boot counter times out.

Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-2-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard/qualcomm: introduce phone config
Caleb Connolly [Mon, 31 Mar 2025 12:23:18 +0000 (14:23 +0200)]
board/qualcomm: introduce phone config

Phones don't have keyboards! Introduce a phone-specific config fragment
and associated environment file to make U-Boot more useful on these
devices. This allows for navigating via the buttons and enabling
various USB gadget modes or displaying info about U-Boot.

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Danila Tikhonov <danila@jiaxyga.com> # google-sunfish
Tested-by: Jens Reidel <adrian@mainlining.org> # xiaomi-davinci
Link: https://lore.kernel.org/r/20250331-qcom-phones-v4-1-f52e57d3b8c6@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agodrivers: pinctrl: Add Qualcomm SDM630/660 TLMM driver
Alexey Minnekhanov [Mon, 31 Mar 2025 15:55:31 +0000 (18:55 +0300)]
drivers: pinctrl: Add Qualcomm SDM630/660 TLMM driver

Add support for TLMM pin controller block (Top Level Mode
Multiplexer) on SDM630/660 SoCs, with support for special pins.

Correct pin configuration is required for working debug UART
and eMMC/SD cards.

SDM630 and SDM660 TLMM blocks are the same.

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250331155531.3638165-1-alexeymin@postmarketos.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agogpio: msm: return correct value return for special output pins
Neil Armstrong [Tue, 1 Apr 2025 07:45:20 +0000 (09:45 +0200)]
gpio: msm: return correct value return for special output pins

When a special pin is output only, the current code would return 0,
but if the pin is output only we can get the output value.

Try to return the output value and in all the other cases return
an error instead of 0.

Fixes: f9bb539460d ("gpio: msm: add support for special pins")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250401-topic-sm8x50-msm-gpio-special-fixes-v1-2-a1148a02bb16@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agogpio: msm: fix get_function return for special pins
Neil Armstrong [Tue, 1 Apr 2025 07:45:19 +0000 (09:45 +0200)]
gpio: msm: fix get_function return for special pins

The get_function callback wrongly returns 0 for special pins,
return the appropriate pin function by probing into the special
pins data fields to find if the pin is gpio capable.

Fixes: f9bb539460d ("gpio: msm: add support for special pins")
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250401-topic-sm8x50-msm-gpio-special-fixes-v1-1-a1148a02bb16@linaro.org
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2 months agoboard: phycore-imx93: env: Add common RAUC boot logic
Martin Schwan [Thu, 10 Apr 2025 08:41:22 +0000 (10:41 +0200)]
board: phycore-imx93: env: Add common RAUC boot logic

Add a common RAUC boot logic environment and make use of it in the
i.MX93 environment. The RAUC boot logic is deactivated by default and
can be activated by setting "doraucboot" to "1".

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Reviewed-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: phycore-imx93: env: Move bootcmd from defconfig to env
Leonard Anderweit [Thu, 10 Apr 2025 08:41:21 +0000 (10:41 +0200)]
board: phycore-imx93: env: Move bootcmd from defconfig to env

Move the default bootcmd from the defconfig to the board environment in
preparation for RAUC support. No change in functionality.

Signed-off-by: Leonard Anderweit <l.anderweit@phytec.de>
Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: phycore-imx93: env: Add option to disable bootenv.txt import
Primoz Fiser [Thu, 10 Apr 2025 08:41:20 +0000 (10:41 +0200)]
board: phycore-imx93: env: Add option to disable bootenv.txt import

Add support for disabling external environment import (bootenv.txt) by
setting the ${no_bootenv} environment variable.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: phycore-imx93: env: Add prepare_mcore to environment
Primoz Fiser [Thu, 10 Apr 2025 08:41:19 +0000 (10:41 +0200)]
board: phycore-imx93: env: Add prepare_mcore to environment

Add prepare_mcore script to environment to be able to notify Linux about
the state of M33 core via the kernel cmdline by appending to ${optargs}.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: phycore-imx93: env: Add optargs to environment
Primoz Fiser [Thu, 10 Apr 2025 08:41:18 +0000 (10:41 +0200)]
board: phycore-imx93: env: Add optargs to environment

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

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: phycore-imx93: env: Move fdt and bootenv addresses
Primoz Fiser [Thu, 10 Apr 2025 08:41:17 +0000 (10:41 +0200)]
board: phycore-imx93: env: Move fdt and bootenv addresses

Move the load addresses for FDTs and bootenv.txt to create space for
loading OS image. Otherwise, parts of the image might get corrupted.
and the following boot error will be present:

  ERROR: FDT image overlaps OS image (OS=80400000..832a0000)

Moreover, this commit also syncs addresses with downstream PHYTEC
u-boot for i.MX93 in preparation for FIT image support in the future.

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
2 months agoboard: toradex: add Toradex SMARC iMX8MP
Vitor Soares [Mon, 7 Apr 2025 13:04:36 +0000 (14:04 +0100)]
board: toradex: add Toradex SMARC iMX8MP

Add support for the Toradex SMARC iMX8MP.

Link: https://www.toradex.com/computer-on-modules/smarc-arm-family/nxp-imx-8m-plus
Link: https://www.toradex.com/products/carrier-board/smarc-development-board-kit
Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
2 months agotoradex: tdx-cfg-block: add 0096 Toradex SMARC iMX95
Vitor Soares [Mon, 7 Apr 2025 13:04:35 +0000 (14:04 +0100)]
toradex: tdx-cfg-block: add 0096 Toradex SMARC iMX95

Add PID4 0096 Toradex SMARC iMX95 Hexa 8GB WB IT to config block handling.

Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
2 months agoarm: dts: imx8mp: sync with Linux v6.15-rc1
Vitor Soares [Mon, 7 Apr 2025 13:04:34 +0000 (14:04 +0100)]
arm: dts: imx8mp: sync with Linux v6.15-rc1

Sync imx8mp.dtsi with Linux v6.15-rc1.

Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
2 months agoefi_selftest: remove un-needed NULL checks
Bryan Brattlof [Tue, 8 Apr 2025 06:06:58 +0000 (01:06 -0500)]
efi_selftest: remove un-needed NULL checks

Because we've already returned early in the event 'handle' is NULL we
don't need these extra not NULL checks. Remove them

Signed-off-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agodoc/buildman: typo 'require'
Heinrich Schuchardt [Mon, 7 Apr 2025 06:59:24 +0000 (08:59 +0200)]
doc/buildman: typo 'require'

%s/require/required/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agosmbios: select CONFIG_BLOBLIST
Heinrich Schuchardt [Mon, 7 Apr 2025 06:44:24 +0000 (08:44 +0200)]
smbios: select CONFIG_BLOBLIST

Since commit 53d5a221632e ("emulation: Use bloblist to hold tables")
`make qemu-riscv64_smode_defconfig acpi.config && make` fails with

    drivers/misc/qfw_smbios.c:93:(.text.qfw_evt_write_smbios_tables+0xe):
    undefined reference to `bloblist_add'

Build with bloblist support.

Fixes: 53d5a221632e ("emulation: Use bloblist to hold tables")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoacpi: select CONFIG_BLOBLIST
Heinrich Schuchardt [Mon, 7 Apr 2025 06:44:23 +0000 (08:44 +0200)]
acpi: select CONFIG_BLOBLIST

Since commit 53d5a221632e ("emulation: Use bloblist to hold tables")
`make qemu-riscv64_smode_defconfig acpi.config && make` fails with

    qfw_acpi.c:146:(.text.evt_write_acpi_tables+0xc):
    undefined reference to `bloblist_add'

Build with bloblist support.

Fixes: 53d5a221632e ("emulation: Use bloblist to hold tables")
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agofirmware: scmi: smt: Interrupt communication enable
Viorel Suman [Tue, 1 Apr 2025 07:56:35 +0000 (15:56 +0800)]
firmware: scmi: smt: Interrupt communication enable

i.MX95 System Manager uses interrupt driven communication which requires
the caller to set Bit[0] of channel flags to 1. When transmission
completes and the previous general purpose interrupt has been processed
by the other core, i.MX95 System Manager will set General Purpose
Interrupt Control Register (GCR). U-Boot polls General-purpose Status
(GSR) to check if the operation is finished.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 months agotoradex: apalis-imx6: Fix build failure when CONFIG_VIDEO_IPUV3 is enabled
Rafael Beims [Fri, 28 Mar 2025 10:20:40 +0000 (11:20 +0100)]
toradex: apalis-imx6: Fix build failure when CONFIG_VIDEO_IPUV3 is enabled

If CONFIG_VIDEO_IPUV3 is enabled without also having CONFIG_IMX_HDMI
enabled, the build fails for the Apalis iMX6 board.

Fixes: 592f4aed6db7 ("arm: imx: initial support for apalis imx6")
Signed-off-by: Rafael Beims <rafael.beims@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agodoc: Update authenticated capsules documentation
Ilias Apalodimas [Tue, 1 Apr 2025 11:27:26 +0000 (14:27 +0300)]
doc: Update authenticated capsules documentation

Now that we moved out the capsule signature from the DTB, remove the
relevant documentation.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>