]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
4 months agoclk: clk-uclass: Print clk name in clk_enable/clk_disable
Michael Trimarchi [Tue, 9 Jul 2024 06:28:13 +0000 (08:28 +0200)]
clk: clk-uclass: Print clk name in clk_enable/clk_disable

Print clk name in clk_enable and clk_disable. Make sense to know
what clock get disabled/enabled before a system crash or system
hang.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
4 months agoclk: Revise help text for clk_get_parent_rate()
Alexander Dahl [Fri, 3 May 2024 07:20:09 +0000 (09:20 +0200)]
clk: Revise help text for clk_get_parent_rate()

The function returns the rate of the parent clock, the previous text
made no sense at all.

Fixes: 4aa78300a025 ("dm: clk: Define clk_get_parent_rate() for clk operations")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
4 months agoclk: Fix error message in clk_get_bulk
Jan Kiszka [Sat, 9 Mar 2024 12:27:09 +0000 (13:27 +0100)]
clk: Fix error message in clk_get_bulk

Fix a logical inversion of the printed text.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
4 months agoMerge patch series "clk: mediatek: add OPs to support OF_UPSTREAM"
Tom Rini [Thu, 1 Aug 2024 21:32:54 +0000 (15:32 -0600)]
Merge patch series "clk: mediatek: add OPs to support OF_UPSTREAM"

Christian Marangi <ansuelsmth@gmail.com> says:

This series doesn't currently change anything and it does add all the
additional OPs to make support of OF_UPSTREAM.

While converting the mt7681/7686/7688/7623/7622 it was notice lots of
discrepancy between the downstream dtsi and the upstream one and the
clock ID between downstream clock ID and upstream clock ID.

Upstream reference clock by names and clock are handled by the
CCF (Common Clock Framework). The same can't be used here as we would
quickly reach the max space allocated before relocation.

The current mediatek clock driver reference all the parents and clocks
with offset from the clk ID related to the different tables.

Discrepancy between clock ID and the order in the clocks table cause
one clock referenced for another or even crash for trying to access
a clock at an offset that doesn't exist.

To handle this and permit use of OF_UPSTREAM, various measure and
changes are done to the mediatek clock driver to support it.

This series have all the generic clock changes. Once this is merged,
series for each SoC will came that will just change files in their
dedicated clock driver. This is to prevent massive patch and to
permit to split series, one for each SoC.

As said at the start, these changes doesn't cause regression and are
just expansion to the current API. Current behaviour is saved in every
possible way (aside from the first 2 patch that fixes latent bugs)

4 months agoclk: mediatek: add support for APMIXED parent in infra MUX
Christian Marangi [Fri, 28 Jun 2024 17:40:57 +0000 (19:40 +0200)]
clk: mediatek: add support for APMIXED parent in infra MUX

Add support for APMIXED parent in infra MUX. This is the case for mt7622
that reference APMIXED parents for the MUX1_SEL clock.

We assume the second level parent is always APMIXED.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for GATEs for APMIXED OPs
Christian Marangi [Fri, 28 Jun 2024 17:40:56 +0000 (19:40 +0200)]
clk: mediatek: add support for GATEs for APMIXED OPs

Add support for GATEs for APMIXED OPs. It's possible that some APMIXED
have also gates on top of PLL. This is the case for mt7622. Add support
for this.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: implement MUX_FLAGS and MUX_MIXED_FLAGS macro
Christian Marangi [Fri, 28 Jun 2024 17:40:55 +0000 (19:40 +0200)]
clk: mediatek: implement MUX_FLAGS and MUX_MIXED_FLAGS macro

Some simple MUX might require flags to specify the parent source.
Implement MUX_FLAGS as a variant of the MUX macro that takes custom
flags as last arg.
Also implement MUX_MIXED_FLAGS for PARENT_MIXED implementation and
MUX_MIXED with no additional flags.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for remapping clock ID
Christian Marangi [Fri, 28 Jun 2024 17:40:54 +0000 (19:40 +0200)]
clk: mediatek: add support for remapping clock ID

Upstream kernel linux might have a different clock ID order in their
<soc>-clk.h header. This is the case of some clock ID for mt7623 that
upstream use the shared header clk-mt7601.h

This header doesn't have a well distincted order and have factor or mux
in the middle of the CLK ID list. This is problematic with the mtk clock
driver that expect everything well organized in block and apply offset
to reference the clk in the different array.

To solve this problem, implement in the mtk_clk_tree an additional
option .id_offs_map, an array where each CLK ID can be remapped to what
the driver expect permitting to reorganize the clock following the
expected logic of fixed, factor, mux and gates.

Each clock function is updated to tranparently handle this by first
converting the clk ID to the remapped one.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: provide common clk init function for infrasys
Christian Marangi [Fri, 28 Jun 2024 17:40:53 +0000 (19:40 +0200)]
clk: mediatek: provide common clk init function for infrasys

Provide common clk init function for infrasys that defaults to topckgen
driver if clock-parent is not defined. This is the case for upstream
DTSI that doesn't provide this entry.

This is needed for infracfg driver that will make use of the unified
gates + muxes implementation.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for gate clock to reference topckgen clock
Christian Marangi [Fri, 28 Jun 2024 17:40:52 +0000 (19:40 +0200)]
clk: mediatek: add support for gate clock to reference topckgen clock

Add support for gate clock get_rate to reference topckgen clock for
infracfg-ao implementation.

In infracfg-ao implementation topckgen is on second level of parent with
infracfg in the middle.
To correctly detect this, check the driver of the dev parent and use the
second level parent if it's not mtk_clk_topckgen.

Due to all the dependency, parent tree must be filled before a gate is
used, hence is safe to assume it will be there.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for parent mux from different source for topckgen
Christian Marangi [Fri, 28 Jun 2024 17:40:51 +0000 (19:40 +0200)]
clk: mediatek: add support for parent mux from different source for topckgen

As done for infracfg, also add support for parent mux from different
source for topckgen. This is needed as upstream linux doesn't use 1/1
factor and use directly the APMIXED clocks.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for parent mux from different source
Christian Marangi [Fri, 28 Jun 2024 17:40:50 +0000 (19:40 +0200)]
clk: mediatek: add support for parent mux from different source

There is a current limitation where parents for a mux can be all declared
as they are from a common source. This is not true as there are some MUX
that can have parent from both infracfg or from topckgen.

To handle this, implement a new flag for the mux, CLK_PARENT_MIXED, and
a new entry for the mux parent_flags.

To use this, CLK_PARENT_MIXED must be used and parent_flags will be used
instead of the parent variable.

Entry in parent_flags are just a struct of ID and flags where it will be
defined where that parent comes from with the usage of
CLK_PARENT_INFRASYS or CLK_PARENT_TOPCKGEN.

This permits to have MUX with parents from infracfg or topckgen.

Notice that with CLK_PARENT_MIXED applied the CLK_BYPASS_XTAL is
ignored.
With CLK_PARENT_MIXED declare CLK_PARENT_XTAL for the relevant parent
instead.

Also alias for the CLK_PARENT macro are provided to better clear their
usage. CLK_PARENT_MIXED require these alias that describe the clk type
to be defined in the clk_tree flags to prevent clk ID clash from
different subsystem that may have equal clk ID.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for gate ID at offset
Christian Marangi [Fri, 28 Jun 2024 17:40:49 +0000 (19:40 +0200)]
clk: mediatek: add support for gate ID at offset

Add support to clk_gate ops to reference the clk ID at an offset by
using the just introduced gates_offs value from the unified muxes +
gates implementation.

Gate clock that doesn't have gates_offs set won't be affected as the
offset will simply be 0 and won't be offset of any value.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: add support for gates in clk_tree for infrasys
Christian Marangi [Fri, 28 Jun 2024 17:40:48 +0000 (19:40 +0200)]
clk: mediatek: add support for gates in clk_tree for infrasys

Add support for gates in clk_tree for infrasys ops.

Infracfg clks can have a sum of gates and muxes, and current solution
handle this by duplicating the driver and split clks for mux and clks
for gates. Upstream linux kernel handle this differently and doesn't
have this distinction.

To be closer to the upstream kernel clock definition, implement
additional logic to have gates defined in the clk_tree and implement
variant for the infrasys ops to handle gates defined in the tree.

Similar to how it's done with factor and mux, we introduce gates_offs.
Upstream kernel follow the similar logic with all the ID defined as
FDIVS, MUXES and finally GATES.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: return XTAL rate for infrasys get_mux_rate
Christian Marangi [Fri, 28 Jun 2024 17:40:47 +0000 (19:40 +0200)]
clk: mediatek: return XTAL rate for infrasys get_mux_rate

We currently return 0 if XTAL rate is requested in get_mux_rate. This
deviates from what is done in get_factor_rate and is totally wrong as it
can cause unwanted results (division by 0 crash)

For infrasys that makes use of CLK_XTAL, assume xtal_rate to be defined
in clk_tree and return the rate when BYPASS_XTAL is not enabled with
clk ID 0 index parents.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agoclk: mediatek: return XTAL rate directly for gates with XTAL parent
Christian Marangi [Fri, 28 Jun 2024 17:40:46 +0000 (19:40 +0200)]
clk: mediatek: return XTAL rate directly for gates with XTAL parent

There is currently a massive bug that makes any gate clk that have
CLK_XTAL as parent to return the wrong clock.

Following the code, with CLK_XTAL defined as TOPCKGEN parent, the
topckgen get_rate is called. The clk ID (0) is parsed and only in some
corner case (scenario where fixed clock are not defined) the correct
XTAL rate will be returned as get_factor or get_mux is called (that have
correct handling for CLK_XTAL). With fixed clock defined, the rate that
will be returned will always be the FIRST ELEMENT of the fixed clock
table instead of the hardcoded XTAL rate.

To handle this, add additional logic and if the flag is set to
PARENT_XTAL for the gate, return the XTAL rate directly.

We assume the clk_tree to have xtal_rate defined with clk gates that
have XTAL as parents.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
4 months agonet: dwc_eth_qos: mdio: Implement clause 45
Philip Oberfichtner [Tue, 7 May 2024 09:42:37 +0000 (11:42 +0200)]
net: dwc_eth_qos: mdio: Implement clause 45

Bevor this commit, only clause 22 access was possible. After this commit,
clause 45 direct access will available as well.

Note that there is a slight change of behavior: Before this commit, the
C45E bit was set to whatever value was left in the register from the
previous access. After this commit, we adopt the common practice of
discerning C45 from C22 using the devad argument.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
Reviewed-by: Marek Vasut <marex@denx.de>
4 months agonet/tftp: make tftpput working with servers that do not use OACK
Mikhail Kshevetskiy [Fri, 12 Jul 2024 09:47:54 +0000 (13:47 +0400)]
net/tftp: make tftpput working with servers that do not use OACK

Option Acknowledgment (OACK) is an extension of TFTP protocol (see rfc2347).
Not all tftp servers implements it. For example it does not supported by
tftpd server from debian-11 (https://packages.debian.org/bullseye/tftpd).

Starting the "tftpput $loadaddr $size out_file" command with such server
will results in the following packets flow:

192.168.27.3   192.168.27.1   TFTP   Write Request, ...
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 0
192.168.27.3   192.168.27.1   TFTP   Write Request, ...
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 0
192.168.27.3   192.168.27.1   TFTP   Write Request, ...
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 0
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 0
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 0
...

so, no data transfer happening.

Here is a packets flow for tftp-server with OACK support
(tftpd-hpa: https://packages.debian.org/stable/tftpd-hpa)

192.168.27.3   192.168.27.1   TFTP   Write Request, ...
192.168.27.1   192.168.27.3   TFTP   Option Acknowledgement, ...
192.168.27.3   192.168.27.1   TFTP   Data Packet, Block: 1
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 1
192.168.27.3   192.168.27.1   TFTP   Data Packet, Block: 2
192.168.27.1   192.168.27.3   TFTP   Acknowledgement, Block: 2

and this time data transfer starts normally.

As we can see there is no OACK packet in the first case. Investigating
an issue we'll find out:

1) tftp_start() sets

      tftp_state = STATE_SEND_WRQ;

2) on OACK tftp_handler() sets

      tftp_state = STATE_DATA;

   and send a first DATA packet.

3) on ACK tftp_handler() will call a tftp_send() function.
   tftp_send() will

   * tftpd with OACK support:

       Current state is STATE_DATA, so transmittion of data packet will
       happen.

   * tftpd without OACK support

      Current state is STATE_SEND_WRQ, so retransmission of WRQ packet
      will happen. Thus tftpd-server will retransmit an ACK.

      This will repeats until timeout happens.

      According to RFC1350 this is wrong. We should start data transfer
      instead of WRQ retransmission.

This patch fix an issue, so tftpput works fine with both types of servers.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
4 months agonet: remove duplicate eth_env_set_enetaddr_by_index() declaration
Alexander Sverdlin [Mon, 8 Jul 2024 09:09:58 +0000 (11:09 +0200)]
net: remove duplicate eth_env_set_enetaddr_by_index() declaration

eth_env_set_enetaddr_by_index() declaration is duplicated in eth_internal.h
and net.h, but all units including eth_internal.h already include net.h.
Remove the superfluous declaration.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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.

5 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>
5 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>
5 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>
5 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.

5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>