]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 months agoMerge tag 'video-20240731' of https://source.denx.de/u-boot/custodians/u-boot-video
Tom Rini [Wed, 31 Jul 2024 19:39:14 +0000 (13:39 -0600)]
Merge tag 'video-20240731' of https://source.denx.de/u-boot/custodians/u-boot-video

 - improve video sync performance with background syncing (cyclic)
 - fix dropping characters when pasting commands over the UART
 - enable background syncing by default for boards using VIDEO
 - make sandbox video more responsive

4 months agousb: bootm: Drop old USB-device-removal code
Simon Glass [Fri, 26 Jul 2024 12:36:09 +0000 (06:36 -0600)]
usb: bootm: Drop old USB-device-removal code

USB is stopped using driver model now, in dm_remove_devices_flags() in
announce_and_cleanup() at the top of this file.

The usb_stop() call actually unbinds devices.

When a USB device is unbound, it causes any bootflows attached to it to
be removed, via a call to bootdev_clear_bootflows() from
bootdev_pre_unbind(). This obviously makes it impossible to boot the
bootflow.

However, when booting a bootflow that relies on USB, usb_stop() is
called, which unbinds the device. At that point any information
attached to the bootflow is dropped.

This is quite risky since the contents of freed memory are not
guaranteed to remain unchanged. Depending on what other options are
done before boot, a hard-to-find bug may crop up.

Drop the call to this old function.

Leave the netconsole call there, since this needs conversion to
driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Shantur Rathore <i@shantur.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 months agotools: Add script to update git subtree projects
Raymond Mao [Thu, 25 Jul 2024 13:57:51 +0000 (06:57 -0700)]
tools: Add script to update git subtree projects

Recently we are introducing multiple git subtree projects and
it is the right time to have a universal script to update
various subtrees and replace the dts/update-dts-subtree.sh.

update-subtree.sh is a wrapper of git subtree commands.

Usage: From U-Boot top directory,
run
$ ./tools/update-subtree.sh pull <subtree-name> <release-tag>
for pulling a tag from the upstream.
Or run
$ ./tools/update-subtree.sh pick <subtree-name> <commit-id>
for cherry-pick a commit from the upstream.

Currently <subtree-name> supports dts, mbedtls and lwip.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
4 months agoenv: mmc: Fix env loading with CONFIG_SYS_MMC_ENV_PART
Mattijs Korpershoek [Fri, 19 Jul 2024 15:38:54 +0000 (17:38 +0200)]
env: mmc: Fix env loading with CONFIG_SYS_MMC_ENV_PART

When CONFIG_SYS_MMC_ENV_PART=2, the environment is loaded from
the USER partition (hwpart=0) instead of from the
BOOT1 partition (hwpart=2).

IS_ENABLED() cannot be used for non-boolean KConfig options.
Its documentation states:

> * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y',
> * 0 otherwise.

So in our case, IS_ENABLED(CONFIG_SYS_MMC_ENV_PART) evaluates to 0.

Because of this, the hwpart variable is never assigned and mmc_offset()
ends up switching back to the USER hwpart (0) instead of BOOT1 (2).

Fix it by using #define instead.

Tested with:

  # have CONFIG_SYS_MMC_ENV_PART=2 in defconfig
  # 1. Erase mmc0boot1
  => mmc dev 0 2
  => mmc erase 0 400
  => mmc read ${loadaddr} 0 400
  => md ${loadaddr} 4
  8200000000000000 00000000 00000000 00000000  ................

  # 2. Restore default environment and save to MMC
  => env default -a -f
  => saveenv

  # 3. Read back mmc0boot1 and confirm the env is present
  => mmc read ${loadaddr} 0 400
  => md ${loadaddr} 4
  8200000013e0632e 72646461 7469665f 3978303d  .c..addr_fit=0x9

Fixes: 5b4acb0ff79d ("env: mmc: Apply GPT only on eMMC user HW partition")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "Endian Kconfig improvements"
Tom Rini [Wed, 31 Jul 2024 17:18:43 +0000 (11:18 -0600)]
Merge patch series "Endian Kconfig improvements"

Jiaxun Yang <jiaxun.yang@flygoat.com> says:

This is a subset of my previous arm64_be work.

I wish this could be merged first so it would be easier to work
against xtensa and arm64 be support.

4 months agoconfig: Use CONFIG_SYS_BIG_ENDIAN in code whenever possible
Jiaxun Yang [Wed, 17 Jul 2024 08:07:03 +0000 (16:07 +0800)]
config: Use CONFIG_SYS_BIG_ENDIAN in code whenever possible

So CONFIG_SYS_BIG_ENDIAN is our cross architecture option for
selecting machine endian, while the old CONFIG_CPU_BIG_ENDIAN
is defined by Arc only.

Use it whenever possible to ensure big endian code path is enabled
for all possible big endian machines.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
4 months agoKconfig: Unify endian support option
Jiaxun Yang [Wed, 17 Jul 2024 08:07:02 +0000 (16:07 +0800)]
Kconfig: Unify endian support option

Move SUPPORT_BIG_ENDIAN, SUPPORT_LITTLE_ENDIAN to top-level
arch Kconfig and let architectures select them as necessary.

Remove if guard for Endianness selection choice so we can
have one of SYS_BIG_ENDIAN, SYS_LITTLE_ENDIAN config symbol
defined even on single endian system.

Default endian to SYS_BIG_ENDIAN for MIPS || MICROBLAZE
and LITTLE_ENDIAN for the rest to retain old config
behaviour.

Note: PPC, SH, Xtensa are technically bi-endian, but I
checked compiled u-boot image with readelf, U-Boot currently
only support little endian for SH and Xtensa, Big Endian for
PPC.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
4 months agosandbox: Drop video-sync in serial driver
Simon Glass [Wed, 31 Jul 2024 14:44:12 +0000 (08:44 -0600)]
sandbox: Drop video-sync in serial driver

With sandbox, when U-Boot is waiting for input it syncs the video
display, since presumably the user has finished typing.

Now that cyclic is used for video syncing, we can drop this. Cyclic
will automatically call the video_idle() function when idle.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agosandbox: Increase cyclic CPU-time limit
Simon Glass [Wed, 31 Jul 2024 14:44:11 +0000 (08:44 -0600)]
sandbox: Increase cyclic CPU-time limit

Now that sandbox is using cyclic for video, it trips the 1us time
limit. Updating the sandbox display often takes 20ms or more.

Increase the limit to 100ms to avoid a warning.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: Use cyclic to handle video sync
Simon Glass [Wed, 31 Jul 2024 14:44:10 +0000 (08:44 -0600)]
video: Use cyclic to handle video sync

At present U-Boot flushes the cache after every character written to
the display. This makes the command-line slower, to the point that
pasting in long strings can fail.

Add a cyclic function to sync the display every 10ms. Enable this by
default.

Allow much longer times for sandbox, since the SDL display is quite
slow.

Avoid size growth if the feature is disabled by making the new init and
destroy functions dependent on CYCLIC being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agovideo: Move last_sync to private data
Simon Glass [Wed, 31 Jul 2024 14:44:09 +0000 (08:44 -0600)]
video: Move last_sync to private data

Rather than using a static variable, use the video device's private
data to remember when the last video sync was completed. This allows
each display to have its own sync and avoids using static data in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agocyclic: Add a symbol for SPL
Simon Glass [Wed, 31 Jul 2024 14:44:08 +0000 (08:44 -0600)]
cyclic: Add a symbol for SPL

The cyclic subsystem is currently enabled either in all build phases
or none. For tools this should not be enabled, but since lib/shc256.c
and other files include watchdog.h in the host build, we must make
sure that it is not enabled there.

Add an SPL symbol so that there is more control of this.

Add an include into cyclic.h so that tools can include this file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>
4 months agoMerge tag 'efi-2024-10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Wed, 31 Jul 2024 13:20:32 +0000 (07:20 -0600)]
Merge tag 'efi-2024-10-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-10-rc2

Documentation:

* Add a description for bootmeth_android

UEFI:

* Provide and use function list_count_nodes()
* Require EFI boot manager for EBBR compliance
* Correct check in efi_load_option_dp_join()
* Adjust config options for capsule updates

SMBIOS:

* Add extended Extended BIOS ROM Size

4 months agodm: use list_count_nodes() for counting list nodes
Sughosh Ganu [Tue, 30 Jul 2024 11:11:32 +0000 (16:41 +0530)]
dm: use list_count_nodes() for counting list nodes

The linux kernel has the list_count_nodes() API functions which is
used for counting nodes of a list. This has now been imported in
U-Boot as part of an earlier commit. Use this function and drop the
list_count_items().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_memory: get the efi_mem_list node directly
Sughosh Ganu [Tue, 30 Jul 2024 11:11:31 +0000 (16:41 +0530)]
efi_memory: get the efi_mem_list node directly

Use the list_for_each_entry() API to get the efi_mem_list node
directly, instead of making an additional call to list_entry().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_memory: avoid possible null pointer dereference
Sughosh Ganu [Tue, 30 Jul 2024 11:11:30 +0000 (16:41 +0530)]
efi_memory: avoid possible null pointer dereference

Populate the previous memory descriptor node pointer only after it's
parent struct has been initialised. The compiler fixes this logic to
do the right thing, but it is better to have correct code in place.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_memory: use list_count_nodes() to count list entries
Sughosh Ganu [Tue, 30 Jul 2024 11:11:29 +0000 (16:41 +0530)]
efi_memory: use list_count_nodes() to count list entries

Use the API function list_count_nodes() to count the number of EFI
memory map entries.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agolinux: list: add a function to count list nodes
Sughosh Ganu [Tue, 30 Jul 2024 11:11:28 +0000 (16:41 +0530)]
linux: list: add a function to count list nodes

Add a function to count the nodes of a list.

Taken from linux 6.11-rc1 tag commit 8400291e289e.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_loader: correct check in efi_load_option_dp_join()
Heinrich Schuchardt [Wed, 24 Jul 2024 13:26:04 +0000 (15:26 +0200)]
efi_loader: correct check in efi_load_option_dp_join()

After assigning to *dp we must check this value and not dp.

Addresses-Coverity-ID: 501792 Control flow issues (DEADCODE)
Fixes: 58bef195f94e ("cmd: eficonfig: add support for setting fdt")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agodoc: Add a description for bootmeth_android
Mattijs Korpershoek [Wed, 24 Jul 2024 12:41:25 +0000 (14:41 +0200)]
doc: Add a description for bootmeth_android

Add initial documentation for the Android bootmeth.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agosmbios: add extended Extended BIOS ROM Size
Heinrich Schuchardt [Tue, 23 Jul 2024 14:44:23 +0000 (16:44 +0200)]
smbios: add extended Extended BIOS ROM Size

U-Boot claims to create SMBIOS 3.7 tables. The type 0 table has
a field Extended BIOS ROM Size since version 3.1.

BIOS ROM sizes of 16 MiB or above must be written to this field.

Add and fill the missing field.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 months agoefi_loader: add /dtbs search path
Caleb Connolly [Mon, 22 Jul 2024 17:55:23 +0000 (19:55 +0200)]
efi_loader: add /dtbs search path

Add an additional search path /dtbs, this is where dtbs are installed on
postmarketOS and potentially other distros.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_loader: require EFI boot manager for EBBR compliance
Heinrich Schuchardt [Thu, 18 Jul 2024 12:05:09 +0000 (14:05 +0200)]
efi_loader: require EFI boot manager for EBBR compliance

A system has to support booting via the boot manager to be EBBR compliant.
See the reference to variables Boot#### in the specification.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agoefi_loader: adjust config options for capsule updates
Ilias Apalodimas [Thu, 20 Jun 2024 20:15:31 +0000 (23:15 +0300)]
efi_loader: adjust config options for capsule updates

EFI_IGNORE_OSINDICATIONS is used to ignore OsIndications if setvariable
at runtime is not supported and allow the platform to perform capsule
updates on disk. With the recent changes boards can conditionally enable
setvariable at runtime using EFI_RT_VOLATILE_STORE.

Let's make that visible in our Kconfigs and enable EFI_IGNORE_OSINDICATIONS
when set variable at runtime is disabled.

Since EFI_RT_VOLATILE_STORE needs help from the OS to persist the
variables, allow users to ignore OsIndications even if setvariable at
runtime is enabled.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
4 months agoMerge patch series "led: implement software blinking"
Tom Rini [Tue, 30 Jul 2024 18:36:22 +0000 (12:36 -0600)]
Merge patch series "led: implement software blinking"

Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> says:

v2 changes:
 * Drop sw_blink_state structure, move its necessary fields to
   led_uc_plat structure.
 * Add cyclic_info pointer to led_uc_plat structure. This
   simplify code a lot.
 * Remove cyclic function search logic. Not needed anymore.
 * Fix blinking period. It was twice large.
 * Other cleanups.

v3 changes:
 * Adapt code to recent cyclic function changes
 * Move software blinking functions to separate file
 * Other small changes

v4 changes:
 * Refactoring of led_set_period() function

v5 changes
 * Fix compilation if CONFIG_LED_BLINK is not defined

v6 changes:
 * Enable LEDST_BLINK state unconditionally.
 * Function led_set_period() becomes available when CONFIG_LED_BLINK
   is disabled. This makes led code simpler.
 * Software blinking requires about 100 bytes of data for a led. It's
   not a good idea to allocate so much memory for each supported led.
   Change the code to allocate blinking data only for required leds.

4 months agoled: Add dts property to specify blinking of the led
Michael Polyntsov [Fri, 19 Jul 2024 09:12:13 +0000 (13:12 +0400)]
led: Add dts property to specify blinking of the led

The standard property

    linux,default-trigger = "pattern";

used to get an effect. No blinking parameters can be set yet.

Signed-off-by: Michael Polyntsov <michael.polyntsov@iopsys.eu>
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoled: Implement software led blinking
Michael Polyntsov [Fri, 19 Jul 2024 09:12:12 +0000 (13:12 +0400)]
led: Implement software led blinking

If hardware (or driver) doesn't support leds blinking, it's
now possible to use software implementation of blinking instead.
This relies on cyclic functions.

Signed-off-by: Michael Polyntsov <michael.polyntsov@iopsys.eu>
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoled: enable LEDST_BLINK state unconditionally
Mikhail Kshevetskiy [Fri, 19 Jul 2024 09:12:11 +0000 (13:12 +0400)]
led: enable LEDST_BLINK state unconditionally

Changes:
 * enable LEDST_BLINK state unconditionally
 * function led_set_period() becomes available when CONFIG_LED_BLINK
   is disabled. This makes led code simpler.
 * fix cmd/led.c to work properly when LEDST_BLINK present, but
   CONFIG_LED_BLINK is disabled

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 months agoMerge patch series "include: asm-generic: Remove duplicate newlines"
Tom Rini [Mon, 29 Jul 2024 21:01:36 +0000 (15:01 -0600)]
Merge patch series "include: asm-generic: Remove duplicate newlines"

Drop all duplicate newlines from the include directory files.

4 months agoinclude: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:34 +0000 (01:28 +0200)]
include: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: zfs: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:33 +0000 (01:28 +0200)]
include: zfs: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: valgrind: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:32 +0000 (01:28 +0200)]
include: valgrind: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: usb: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:31 +0000 (01:28 +0200)]
include: usb: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: u-boot: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:30 +0000 (01:28 +0200)]
include: u-boot: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: power: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:29 +0000 (01:28 +0200)]
include: power: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: net: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:28 +0000 (01:28 +0200)]
include: net: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: mtd: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:27 +0000 (01:28 +0200)]
include: mtd: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: linux: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:26 +0000 (01:28 +0200)]
include: linux: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: jffs2: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:25 +0000 (01:28 +0200)]
include: jffs2: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: fsl-mc: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:24 +0000 (01:28 +0200)]
include: fsl-mc: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: firmware: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:23 +0000 (01:28 +0200)]
include: firmware: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: dt-bindings: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:22 +0000 (01:28 +0200)]
include: dt-bindings: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: dm: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:21 +0000 (01:28 +0200)]
include: dm: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoinclude: asm-generic: Remove duplicate newlines
Marek Vasut [Mon, 22 Jul 2024 23:28:20 +0000 (01:28 +0200)]
include: asm-generic: Remove duplicate newlines

Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
4 months agoMerge tag 'dm-pull-29jul24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Mon, 29 Jul 2024 16:22:42 +0000 (10:22 -0600)]
Merge tag 'dm-pull-29jul24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

qconfig minor improvement
binman support for alternate entries

5 months agoMakefile: Pass OF_SPL_REMOVE_PROPS to binman
Simon Glass [Sat, 20 Jul 2024 10:49:50 +0000 (11:49 +0100)]
Makefile: Pass OF_SPL_REMOVE_PROPS to binman

Pass CONFIG_OF_SPL_REMOVE_PROPS to binman so that it can remove
properties correctly when producing FITs for SPL phases.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoMakefile: Provide VPL devicetree and padding to binman
Simon Glass [Sat, 20 Jul 2024 10:49:49 +0000 (11:49 +0100)]
Makefile: Provide VPL devicetree and padding to binman

Provide these parameters to binman so that it can produce images
targeted at VPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: fit: Allow running fdtgrep on devicetree blobs
Simon Glass [Sat, 20 Jul 2024 10:49:48 +0000 (11:49 +0100)]
binman: fit: Allow running fdtgrep on devicetree blobs

When using FIT to load firmware builds for multiple models, the FIT must
include a common binary along with a number of devicetree blobs, one for
each model. This is the same mechanism as is used for loading an OS.

However, SPL builds do not normally use the full devicetree, but instead
a cut-down version which various nodes and properties removed.

Add a new fit,fdt-phase property to allow binman to produce these
devicetree blobs.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: fit: Write the compatible string to configuration
Simon Glass [Sat, 20 Jul 2024 10:49:47 +0000 (11:49 +0100)]
binman: fit: Write the compatible string to configuration

FIT allows the FDT's root-node compatible string to be placed in a
configuration node to simplify and speed up finding the best match for
booting.

Add a new property to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: fit: Allow providing FDT filenames in a directory
Simon Glass [Sat, 20 Jul 2024 10:49:46 +0000 (11:49 +0100)]
binman: fit: Allow providing FDT filenames in a directory

In some cases the list of available FDT files is not available in an
entryarg. Provide an option to point to a directory containing them
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Add support for alternative FDTs
Simon Glass [Sat, 20 Jul 2024 10:49:45 +0000 (11:49 +0100)]
binman: Add support for alternative FDTs

FIT provides a way to select between different devicetree blobs
depending on the model. This works fine for U-Boot proper and allows SPL
to select the correct blob for the current board at runtime. The boot
sequence (SPL->U-Boot proper) is therefore covered by the existing
feature set.

The first boot phase (typically TPL) cannot use FIT since SoC boot ROMs
don't currently support it. Therefore the TPL image must be specific to
each model it boots on.

To support booting on mulitple models, binman must therefore produce a
separate TPL image for each model, even if the images for the rest of
the phases are identical.

TPL needs to be packaged as an executable binary along with a reduced
devicetree. When multiple models are supported, a reduced devicetree
must be provided for each model.

U-Boot's build system is designed to build a single devicetree for SPL
builds, so does not support this requirement.

Add a new 'alternatives' feature to Binman, allowing it to automatically
subset a devicetree to produce the reduced devicetree for a particular
phase for each supported model. With this it is possible to produce a
separate TPL image for each of the models. The correct one can then be
loaded onto a board, along with the common FIT image(s).

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Allow entry types to override FDT contents
Simon Glass [Sat, 20 Jul 2024 10:49:44 +0000 (11:49 +0100)]
binman: Allow entry types to override FDT contents

At present the contents of an FDT (for each phase) are fixed,
determined by the build and provided to Binman as input files.

Provide a means for entry types to provide their own FDT, so that it can
be processed, if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Remove dependency on pylibfdt for entry-docs
Simon Glass [Sat, 20 Jul 2024 10:49:43 +0000 (11:49 +0100)]
binman: Remove dependency on pylibfdt for entry-docs

Allow the entry-docs command to operate even if pylibfdt is not present
in the systemn.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Add a bintool for fdtgrep
Simon Glass [Sat, 20 Jul 2024 10:49:42 +0000 (11:49 +0100)]
binman: Add a bintool for fdtgrep

Binman needs the ability to run fdtgrep to prepare devicetree subsets
for use by SPL and TPL. Add a new bintool in preparation for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Correct indentation in testSplPubkeyDtb
Simon Glass [Sat, 20 Jul 2024 10:49:41 +0000 (11:49 +0100)]
binman: Correct indentation in testSplPubkeyDtb

This function has strange indentation. Fix it.

Fixes: 8c1fbd1f607 ("binman: ftest: Add test for u_boot_spl_pubkey_dtb")
Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Fix a comment typo in _DoReadFileDtb()
Simon Glass [Sat, 20 Jul 2024 10:49:40 +0000 (11:49 +0100)]
binman: Fix a comment typo in _DoReadFileDtb()

Fix a minor typo in this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Mention expanded entries in u-boot-vpl
Simon Glass [Sat, 20 Jul 2024 10:49:39 +0000 (11:49 +0100)]
binman: Mention expanded entries in u-boot-vpl

Add a comment about this entry type being expanded, to match the comment
for SPL and TPL. Drop an unwanted line in the SPL and TPL docs while
here.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Correct comment in blob_dtb GetFdtEtype()
Simon Glass [Sat, 20 Jul 2024 10:49:38 +0000 (11:49 +0100)]
binman: Correct comment in blob_dtb GetFdtEtype()

The filenames are a bit confused. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Write the compressed output to a file
Simon Glass [Sat, 20 Jul 2024 10:49:37 +0000 (11:49 +0100)]
binman: Write the compressed output to a file

When an entry is compressed, write the compressed contents to a file so
that it is possible to see what was produced. This aids debugging with
new images.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: elf: Add more debugging to LookupAndWriteSymbols()
Simon Glass [Sat, 20 Jul 2024 10:49:36 +0000 (11:49 +0100)]
binman: elf: Add more debugging to LookupAndWriteSymbols()

When symbol-writing does not appear to work, it can sometimes be hard to
figure out what is going on. Add some more debugging to help.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Move problem-checking code into a function
Simon Glass [Sat, 20 Jul 2024 10:49:35 +0000 (11:49 +0100)]
binman: Move problem-checking code into a function

This has become quite long, so move it into a separate function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Tidy up comment for Bintoolfdt_add_pubkey.run()
Simon Glass [Sat, 20 Jul 2024 10:49:34 +0000 (11:49 +0100)]
binman: Tidy up comment for Bintoolfdt_add_pubkey.run()

This function returns a value, so add documentation for it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Tidy up bintool docs
Simon Glass [Sat, 20 Jul 2024 10:49:33 +0000 (11:49 +0100)]
binman: Tidy up bintool docs

The docs have somehow got out of sync. Regenerate the file to fix the
problem.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Correct an error in the FIT-template example
Simon Glass [Sat, 20 Jul 2024 10:49:32 +0000 (11:49 +0100)]
binman: Correct an error in the FIT-template example

The example contains references to an non-existent node. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agofixdep: Support VPL
Simon Glass [Sat, 20 Jul 2024 10:49:31 +0000 (11:49 +0100)]
fixdep: Support VPL

Add VPL support in this tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: f86ca5ad8f7 ("Introduce Verifying Program Loader (VPL)")
5 months agoqconfig: Support a 'list' format
Simon Glass [Thu, 18 Jul 2024 09:11:25 +0000 (10:11 +0100)]
qconfig: Support a 'list' format

Add a flag to output the found list in a more user-friendly format, with
one board per line. Omit the board count.

This can be useful with grep, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Sort the boards by name when finding
Simon Glass [Thu, 18 Jul 2024 09:11:24 +0000 (10:11 +0100)]
qconfig: Sort the boards by name when finding

There is no particular ordering of the board list at present, since it
is generated by a multi-threaded process. Sort them by name to make it
easier to see if a particular board is present.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Allow searching for CONFIG values
Simon Glass [Thu, 18 Jul 2024 09:11:23 +0000 (10:11 +0100)]
qconfig: Allow searching for CONFIG values

Add basic support for searching for matching of non-matching values.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/20
5 months agoMerge tag 'dm-pull-26jul24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Fri, 26 Jul 2024 16:35:44 +0000 (10:35 -0600)]
Merge tag 'dm-pull-26jul24' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm

buildman minor fix
qconfig refactoring
patman fix for Python 3.12

5 months agobuildman: Show board list with -x
Simon Glass [Thu, 11 Jul 2024 08:10:04 +0000 (09:10 +0100)]
buildman: Show board list with -x

When -x is used, buildman does not show the list of boards that will be
built, since there are no terms which cause boards to be added, only
terms which cause them to be removed.

Add a special case to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Tom Rini <trini@konsulko.com>
5 months agosandbox: Fix LTO to work with STACKPROTECTOR
Andrew Goodbody [Tue, 2 Jul 2024 17:00:09 +0000 (18:00 +0100)]
sandbox: Fix LTO to work with STACKPROTECTOR

Add the STACKPROTECTOR symbols to the script that generates the
symbols that should not be removed by the use of LTO when linking
a shared object. This prevents a fail to build due to link errors.

https://source.denx.de/u-boot/u-boot/-/issues/35

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 months agobinman: Update cbfstool
Simon Glass [Tue, 2 Jul 2024 16:37:28 +0000 (17:37 +0100)]
binman: Update cbfstool

Update to a newer version of this tool, 4.22.01. This runs OK with the
current binman tests and matches the one in CI.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
5 months agotools: patman: fix `pip install` with Python 3.12
Brandon Maier [Mon, 1 Jul 2024 17:51:41 +0000 (17:51 +0000)]
tools: patman: fix `pip install` with Python 3.12

Installing patman with `cd ./tools/patman && pip install -e .` fails
with the error below.

As described in the error output below, the license line is not allowed
to be only defined in the setup.py. We remove the 'license' field
entirely, as the Python Packaging User Guide recommends using projects
classifiers instead[1] and we already set the GPL-2.0+ classifier.

> $ cd ./tools/patman && pip install -e .
> Obtaining file:///.../u-boot/tools/patman
>   Installing build dependencies ... done
>   Checking if build backend supports build_editable ... done
>   Getting requirements to build editable ... error
>   error: subprocess-exited-with-error
>
>   × Getting requirements to build editable did not run successfully.
>   │ exit code: 1
>   ╰─> [61 lines of output]
>       /tmp/pip-build-env-mqjvnmz8/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76:
>           _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored.
>       !!
>
>       ********************************************************************************
>       The following seems to be defined outside of `pyproject.toml`:
>
>       `license = 'GPL-2.0+'`
>
>       According to the spec (see the link below), however, setuptools CANNOT
>       consider this value unless `license` is listed as `dynamic`.
>
>       https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table
>
>       To prevent this problem, you can list `license` under `dynamic` or alternatively
>       remove the `[project]` table from your file and rely entirely on other means of
>       configuration.
>       ********************************************************************************
>
>       !!

[1] https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move operation check into parse_args()
Simon Glass [Wed, 17 Jul 2024 15:57:11 +0000 (16:57 +0100)]
qconfig: Move operation check into parse_args()

Put the check for an operation being provided into the parse_args()
function, to reduce the size of main().

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Drop col argument from Slots()
Simon Glass [Wed, 17 Jul 2024 15:57:10 +0000 (16:57 +0100)]
qconfig: Drop col argument from Slots()

This is not needed since the progress indicator has the object. Use that
instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Use the Color object in Progress
Simon Glass [Wed, 17 Jul 2024 15:57:09 +0000 (16:57 +0100)]
qconfig: Use the Color object in Progress

Since the Progress class has the required object, use it from there
instead of passing it around.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move the last two operations into their own functions
Simon Glass [Wed, 17 Jul 2024 15:57:08 +0000 (16:57 +0100)]
qconfig: Move the last two operations into their own functions

Put the summary and database-writing code into separate functions to
reduce the size of main().

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move progress output into the class
Simon Glass [Wed, 17 Jul 2024 15:57:07 +0000 (16:57 +0100)]
qconfig: Move progress output into the class

Rather than create these outputs separately, put them in the class so
that the main program doesn't need to deal with them.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move commit code into a separate function
Simon Glass [Wed, 17 Jul 2024 15:57:06 +0000 (16:57 +0100)]
qconfig: Move commit code into a separate function

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move all move_config code into move_config()
Simon Glass [Wed, 17 Jul 2024 15:57:05 +0000 (16:57 +0100)]
qconfig: Move all move_config code into move_config()

Move the setup and completion code into the move_config() function so
it is all in one place.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Add a return value to do_find_config()
Simon Glass [Wed, 17 Jul 2024 15:57:04 +0000 (16:57 +0100)]
qconfig: Add a return value to do_find_config()

Return an exit code so we can use this function like do_tests().
Refactor the caller to handle this.

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move imply into a separate function
Simon Glass [Wed, 17 Jul 2024 15:57:03 +0000 (16:57 +0100)]
qconfig: Move imply into a separate function

Reduce the size of main() by putting this code into its own function,
with the usage message staying in main().

Tidy up the comments for do_imply_config() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Add a return value to do_scan_source()
Simon Glass [Wed, 17 Jul 2024 15:57:02 +0000 (16:57 +0100)]
qconfig: Add a return value to do_scan_source()

Return an exit code so we can use this function like do_tests().
Refactor the caller to handle this.

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move testing into a separate function
Simon Glass [Wed, 17 Jul 2024 15:57:01 +0000 (16:57 +0100)]
qconfig: Move testing into a separate function

Reduce the size of main() by putting this code into its own function.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move converting config args to the top
Simon Glass [Wed, 17 Jul 2024 15:57:00 +0000 (16:57 +0100)]
qconfig: Move converting config args to the top

Move this check to the top, so it happens always. There is no harm to
doing this earlier and it separates the setup from actual program logic.

Update the arg rather than adding a new variable, with the new variable
only created when moving or building, since it is used more heavily.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move checking directory to the top
Simon Glass [Wed, 17 Jul 2024 15:56:59 +0000 (16:56 +0100)]
qconfig: Move checking directory to the top

Move this check to the top, so it happens always. The tool should be
run from the U-Boot source directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move getting the colour to where it is needed
Simon Glass [Wed, 17 Jul 2024 15:56:58 +0000 (16:56 +0100)]
qconfig: Move getting the colour to where it is needed

Move this assignment down to just above where it is needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move arg checking to the top of main()
Simon Glass [Wed, 17 Jul 2024 15:56:57 +0000 (16:56 +0100)]
qconfig: Move arg checking to the top of main()

Check for 'test' as one of the possible operations for this tool,
moving the check above the implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move arg checking a little higher
Simon Glass [Wed, 17 Jul 2024 15:56:56 +0000 (16:56 +0100)]
qconfig: Move arg checking a little higher

Check for scan_source as one of the possible operations for this tool,
moving the check above the scan_source implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Move arg parsing into a separate function
Simon Glass [Wed, 17 Jul 2024 15:56:55 +0000 (16:56 +0100)]
qconfig: Move arg parsing into a separate function

Reduce the size of main() by putting this code into its own function.
For now the parser object needs to be returned too.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Rename the doc link
Simon Glass [Wed, 17 Jul 2024 15:56:54 +0000 (16:56 +0100)]
qconfig: Rename the doc link

This was missed during the renaming of the tool. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: ea4d6dead37 ("moveconfig: Rename the tool to qconfig")
5 months agoqconfig: Correct format string in do_imply_config()
Simon Glass [Wed, 17 Jul 2024 15:56:53 +0000 (16:56 +0100)]
qconfig: Correct format string in do_imply_config()

One of the strings was converted incorrectly. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 1bd43060b3e ("moveconfig: Use f strings where possible")
5 months agoqconfig: Tidy up some pylint warnings
Simon Glass [Wed, 17 Jul 2024 15:56:52 +0000 (16:56 +0100)]
qconfig: Tidy up some pylint warnings

Reduce the number of warnings in this file a little bit.

Add my own name to the copyright message.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Make KconfigScanner a function
Simon Glass [Wed, 17 Jul 2024 15:56:51 +0000 (16:56 +0100)]
qconfig: Make KconfigScanner a function

This doesn't have any methods so is not good as a class. Make it a
function instead, to keep pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Drop the try_expand() function
Simon Glass [Wed, 17 Jul 2024 15:56:50 +0000 (16:56 +0100)]
qconfig: Drop the try_expand() function

This is not used anymore, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoqconfig: Fix pylint error in read_database()
Simon Glass [Wed, 17 Jul 2024 15:56:49 +0000 (16:56 +0100)]
qconfig: Fix pylint error in read_database()

Fix this error by initing the variable before the loop:

tools/qconfig.py:880:22: E0606: Possibly using variable 'defconfig'
   before assignment (possibly-used-before-assignment)

Signed-off-by: Simon Glass <sjg@chromium.org>
5 months agoMerge branch 'qcom-main' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon
Tom Rini [Fri, 26 Jul 2024 00:04:16 +0000 (18:04 -0600)]
Merge branch 'qcom-main' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon

* Qualcomm platforms >~2016 gain support for the RPMh (Resource Power Manager)
  peripheral which is used to control most regulators. The RB5 is now able to
  power up its USB VBUS regulator via the rpmh regulator driver. Git history
  from the original Linux driver is preserved for ease of maintenance.
* IPQ40xx SoCs gain ethernet networking support via the new ESS EDMA driver.

5 months agoarm: dts: add IPQ4019 ESS EDMA U-Boot additions
Robert Marko [Mon, 3 Jun 2024 12:06:16 +0000 (14:06 +0200)]
arm: dts: add IPQ4019 ESS EDMA U-Boot additions

IPQ4019 ESS EDMA support is not yet in upstream Linux, so for now lets use
the latest pending Linux DTS node for wired networking.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
5 months agonet: add Qualcomm ESS EDMA adapter
Robert Marko [Mon, 3 Jun 2024 12:06:15 +0000 (14:06 +0200)]
net: add Qualcomm ESS EDMA adapter

This adds the driver for the ESS EDMA ethernet adapter
found inside of Qualcomm IPQ40xx SoC series.

This driver also integrates the built in modified QCA8337N
switch support as they are tightly integrated.

Co-Developed-by: Gabor Juhos <j4g8y7@gmail.com>
Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
5 months agoclock: qcom: ipq4019: add missing networking resets
Robert Marko [Mon, 3 Jun 2024 12:06:14 +0000 (14:06 +0200)]
clock: qcom: ipq4019: add missing networking resets

IPQ4019 has more networking related resets that will be required for future
wired networking support, so lets add them.

This syncs the driver with Linux.

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>