Commit graph

83919 commits

Author SHA1 Message Date
Simon Glass
bd90b09288 bootstd: Add the concept of a bootdev hunter
Some bootdevs must be enumerated before they appear. For example, USB
bootdevs are not visible until USB is enumerated.

With standard boot this needs to happen automatically, since we only
want to enumerate a bus if it is needed.

Add a way to define bootdev 'hunters' which can be used to hunt for
bootdevs of a given type. Track which ones have been used and add a
command to list them.

Include a clang work-around which seems to be needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:40 -05:00
Simon Glass
3722cc973f efi: Improve logging in efi_disk
When this fails it can be time-consuming to debug. Add some debugging
to help with this. Also try to return error codes instead of just using
-1.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
19efd43b0f event: Correct duplicate log message in event_notify()
Use a different one for each call.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
7f33194132 lib: Support printing an error string
It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
057c567fb5 sandbox: Enable the Ethernet bootdev
This bootdev is disabled at present since it messes with the tests. Now
that there is a way to disable networking at runtime, enable the driver.
This allows running tests with it if necessary.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
70dd88657b sandbox: Allow ethernet bootdevs to be disabled for tests
Most tests don't want these and can create a lot of noise. Add a way to
disable them. Use that in tests, with a flag provided to enable them for
tests that need this feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
f43b2df3e0 sandbox: Allow ethernet to be disabled at runtime
For bootstd tests it is seldom useful to have ethernet enabled. Add a way
to disable it, so that ethernet operations like tftpboot do nothing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
b85fc8dbab bootstd: Add a default method to get bootflows
The code in these functions turns out to often be the same. Add a default
get_bootflow() function and allow the drivers to select it by setting
the method to NULL.

This saves a little code space.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
3a2cb96e5d dm: mmc: Use bootdev_setup_sibling_blk()
At present MMC uses the bootdev_setup_for_dev() function to set up the
bootdev. This is because MMC only has one block-device child, so does not
need to worry about naming of the bootdev.

However this inconsistency with other bootdevs that use block devices is a
bit annoying. The only real reason for it is to have a name like
'mmc0.bootdev' instead of 'mmc0.blk.bootdev'.

Update bootdev_setup_sibling_blk() to drop '.blk' from the name where it
appears, thus removing the only reason to use the bootdev_setup_for_dev().
Switch MMC over to the subling function.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
d0075059e4 ide: Drop non-DM code for BLK
We require CONFIG_BLK to be enabled now, so this code is unused. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
ecb274cf06 dm: test: Correct ordering of DM setup
We must call dm_scan_other() after devices from the device tree have been
created, since that function behaves differently if there is no bootstd
device.

Adjust the logic to achieve this.

Also fix the bootflow_system() test which was relying on this broken
behaviour.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
d94d9844bc dm: part: Update test to use mmc2
At present this test sets up a partition table on mmc1. But this is used
by the bootstd tests, so it is not possible to run those after this test
has run, without restarting the Python test harness.

This is inconvenient when running tests repeatedly with 'ut dm'. Move the
test to use mmc2, which is not used by anything.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
9445d7a953 vbe: sandbox: Drop VBE node in chosen
This is not needed anymore since VBE creates the node when it sets up the
OS requests. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
f1779f2cc3 vbe: Avoid a build failure when bloblist is not enabled
This needs to be able to work (at least partially) without the bloblist
active. Add a condition for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
67bb973122 sandbox: mmc: Start off with a zeroed file
When running multiple tests the mmc emulator calls malloc() to obtain the
memory for its disk image. Since the memory is not cleared, it is possible
that it happens to contain a partition table.

The dm_test_part() test (for one) relies on mmc0 being empty on startup.
Zero the memory to ensure that it is.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
3f23ce2b6c test: Drop duplicate restore of DM state
This code is present twice. Fix it so that it is only executed once.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
f229a8ee7e test: Fix the help for the ut command
The font help has an incorrect newline. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: cdd964e380 ("test: Tidy up help for ut command")
2023-01-23 18:11:39 -05:00
Simon Glass
cb698b0a3e bootstd: Simplify locating existing bootdevs
There is no point in trying to match the alias order for bootdevs, since
build_order() either sorts them by priority, uses the boot_targets
environment variable or the bootdev-order property.

Just use the iterator instead, to simplify the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
6a6638f093 bootstd: Remove special-case code for boot_targets
Rather than implement this as its own case in build_order(), process the
boot_targets environment variable in the bootstd_get_bootdev_order()
function. This allows build_order() to be simplified.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
3e96ed44e8 lib: Add a function to split a string into substrings
Some environment variables provide a space-separated list of strings. It
is easier to process these when they are broken out into an array of
strings.

Add a utility function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
a0fb9de60d dm: test: Correct assertion in dm_test_part()
This obscures the line number. Update the test to avoid make sure that
the line which failed is displayed, so it is possible to diagnose the
failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
3d01254140 dm: core: Support sorting devices with dm tree
Add a -s flag to sort the top-level devices in order of uclass ID.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Simon Glass
c0f19fedaa dm: core: Correct ordering of uclasses IDs
A few of these are out of order. Fix them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:39 -05:00
Tom Rini
dd31cd58b0 Pull request for efi-2023-04-rc1-2
Documentation
 
 * man-pages for source, blkcache, bdinfo
 * fix references to distro documentation
 
 UEFI:
 
 * allow clear screen by scrolling
 * ensure that file ubootefi.var is created
 * fix CapsuleMax variable reporting
 
 Others:
 
 * reduce verbosity of fat_read_file()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEbcT5xx8ppvoGt20zxIHbvCwFGsQFAmPK4d8ACgkQxIHbvCwF
 GsTF7g/9GV5pCoXX3Z3y5s7aLdbCrTxl0R1cMkVEupwQ2t9kIhenVxI1xC/lYIq4
 8DQN5LEB98iH9Ivl28nnsbQnznHlAh0MOzIEVgw0UcAvxLT59hCHyaNcFPAXQsE6
 oVb0H6EX1QhP6j645nHtTq8dbgXP+a8VCN6KFE+j4mS46h+4wQwmV8hHZh/sUF4X
 bFs4aAkRULndQ3hrgj+GnNwQwEnek9VUkoa+28qOwZdAmRrfQfz3uY8mcvE+k0lh
 fHHu6+7KMOBR0wC288/tdCcejyDmPseFU1aflbxJ7GqOp3Jfth2MK+mmKFJ0FeeQ
 mJtlcLXH7fEdymisoVSBpwYFeN+G394yxLNhqnVP2zt88gDFp42zNz56tT6vOhR7
 t5VjmdpWqQOff9A0U7FCtatM8D7kCVDME+prVztQuQ92ED3GiBuY+NHggHo2GgC6
 tezJRpYLD9OBFIfDVRPYDJ0M4NISCCFzHLYQqUZ/IE9InHS34j4oGfjkPgCuxO5l
 y8caw2tcxazdX+QZ2m2jdf0i1pyexk/pYsPBtZcmwg1vwNzFg4a9E19Uq4+IxJVg
 1LyKQ84QdcSzYE8DKZVaqG4Dg2MQZz8huMV35/H/xXIFhsU983HKLGIyG6Cjtuc/
 aAasn2kGlD4mulEB76aXNO09Mb6F0lQwW6yCzN8g+2RKugsEq3w=
 =gM74
 -----END PGP SIGNATURE-----

Merge tag 'efi-2023-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2023-04-rc1-2

Documentation

* man-pages for source, blkcache, bdinfo
* fix references to distro documentation

UEFI:

* allow clear screen by scrolling
* ensure that file ubootefi.var is created
* fix CapsuleMax variable reporting

Others:

* reduce verbosity of fat_read_file()
2023-01-20 14:23:20 -05:00
Tom Rini
0b9b01517f Merge branch '2023-01-20-finish-CONFIG-migration-work'
- Merge in the final batch of CONFIG to Kconfig/CFG migration work. This
  includes a fix for a number of ns16550 or similar UARTs due to a
  migration bug. We also pull in a revert for enabling CONFIG_VIDEO on
  tools-only_defconfig.
2023-01-20 14:21:38 -05:00
Fabio Estevam
6333acb961 Revert "config: tools only: add VIDEO to build bmp_logo"
This reverts commit 1cfba53ca4.

Since commit 1cfba53ca4 ("config: tools only: add VIDEO to build
bmp_logo") the build of tools-only_defconfig fails:

| /bin/sh: line 1: tools/bmp_logo: No such file or directory

This has been noticed in OpenEmbedded and Debian [1].

Revert it for now.

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

Signed-off-by: Fabio Estevam <festevam@denx.de>
2023-01-20 12:27:24 -05:00
Tom Rini
a03efb6f47 CI: Make check for new defined CONFIG symbols even more robust
Now that all remaining in-tree cases where we define or undef a CONFIG
symbol have been migrated to Kconfig or renamed to CFG we can make the
CI check more robust. We will exclude the doc, tools and arch/arm/dts
directories from this check as they are special cases. Further, we can
exclude the scripts/kconfig/lkc.h and include/linux/kconfig.h files as
the CONFIG values they define are special tooling cases and not real
symbols.

In the case of docs, the only places that currently fail this test are
old documentation that should be rewritten so that we can remove this
special case.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-20 12:27:24 -05:00
Tom Rini
6e7df1d151 global: Finish CONFIG -> CFG migration
At this point, the remaining places where we have a symbol that is
defined as CONFIG_... are in fairly odd locations. While as much dead
code has been removed as possible, some of these locations are simply
less obvious at first. In other cases, this code is used, but was
defined in such a way as to have been missed by earlier checks.  Perform
a rename of all such remaining symbols to be CFG_... rather than
CONFIG_...

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-01-20 12:27:24 -05:00
Tom Rini
ad24234468 watchdog: Clean up defaults for imx_watchdog / ulp_wdog
In imx_watchdog, clean up the comment to just note the range now, as we
do not need to set the default here as Kconfig does this for us. For
ulp_wdog, set the default value via Kconfig instead.

Cc: Stefan Roese <sr@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2023-01-20 12:27:23 -05:00
Tom Rini
c50c778ea7 usbtty: Remove default CONFIG_USBD_* values
For this legacy driver, the only user sets these values in Kconfig, so
we can remove them from the header.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:23 -05:00
Tom Rini
a84fa1bef4 nxp: Finish migration of SYS_FSL_SRDS_[12] to Kconfig
As this is used on both ARM and PowerPC platforms, this needs to be
listed in arch/Kconfig.nxp and match how they're currently used by
select'ing them under the required PowerPC ARCH_xxx options.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:23 -05:00
Tom Rini
89c90cadf3 nxp: Finish migration of SYS_FSL_IFC_BANK_COUNT to Kconfig
As this is used on both ARM and PowerPC platforms, this needs to be
asked in arch/Kconfig.nxp.  Set the PowerPC defaults based on
arch/powerpc/include/asm/config_mpc85xx.h and remove the default set in
drivers/mtd/nand/raw/fsl_ifc_nand.c

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
bd22bde92e net: phy: mv88e61xx: Finish migration of MV88E61XX_FIXED_PORTS
Set the default for MV88E61XX_FIXED_PORTS to 0x0 in Kconfig, and move
the comment from code to the help to explain what this does.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-01-20 12:27:06 -05:00
Tom Rini
80c75ce00d fsl-layerscape: Rework usage of CONFIG_CLUSTER_CLK_FREQ
In the case where CONFIG_CLUSTER_CLK_FREQ is not defined, simply set
cluster_clk to get_board_sys_clk().

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
8de73b7bc1 usb: musb: Rename CONFIG_USB_MUSB_TIMEOUT to MUSB_TIMEOUT
This variable has never been configured to another value at present, and
was not converted to Kconfig. Opt instead to rename this to
MUSB_TIMEOUT.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2023-01-20 12:27:06 -05:00
Tom Rini
8fe042be9a fpga: Migrate CONFIG_MAX_FPGA_DEVICES to Kconfig
This is always defined to 5, so use that as the default.

Cc: Michal Simek <michal.simek@amd.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
2023-01-20 12:27:06 -05:00
Tom Rini
2d1e2e5717 common/update: Finish Kconfig migration
We can enforce the dependencies of this module via Kconfig now, so do so
rather than with #error statements. Further, we can ensure that all
required values are set to their defaults in Kconfig, and in fact
already do so, so remove the tests here. The exception is
CONFIG_UPDATE_LOAD_ADDR which needed to be migrated to Kconfig in the
first place.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
6e73ab32d8 spl: sata: Rework the loading case it not use IS_ENABLED(...)
In this case, using IS_ENABLED(...) to attempt to load the image results
in harder to read and less useful code, along with having to define a
CONFIG value that would be unused. To maintain the current albeit
slightly odd behavior, maintain that if we have both SPL_FS_FAT and
SPL_SATA_RAW_U_BOOT_USE_SECTOR enabled, we use SPL_FS_FAT for the load.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
d35e44fbe7 autoboot: Rework CONFIG_AUTOBOOT_STOP_STR_* usage
In order to not define a CONFIG value when the
CONFIG_AUTOBOOT_STOP_STR_* functionality is not enabled, rework the
assignment of empty and unused (as the code will be discarded under if
0, in the end) values to be AUTOBOOT_STOP_STR_* instead of
CONFIG_AUTOBOOT_STOP_STR_*.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
1c88640fc8 arm: lib1funcs.S: Update compatibility with Linux comment slightly
At this point, the Linux code for "lib1funcs" has changed rather
dramatically. While a resync would be beneficial, it's outside the scope
of what we need here.  Simply remove the define for CONFIG_AEABI and
tests for it.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
5bbf9c927a dm: ns16550: Restore how we define UART_REG
Prior to commit 9591b63531 ("Convert CONFIG_SYS_NS16550_MEM32 et al to
Kconfig") we had defined CONFIG_SYS_NS16550_REG_SIZE to -1 with
DM_SERIAL such that we would then have a size 0 character array. This
resulted in functionally no padding. The confusion on my part came from
dealing with the constraints around platforms that do not use DM_SERIAL
in SPL/TPL. After Andre Przywara reported that sunxi was broken, I've
re-read the code and comments again and thought on this harder. What we
want I believe is what this patch does now.

If DM_SERIAL is defined for this stage, regardless of
CONFIG_SYS_NS16550_REG_SIZE then we will dynamically handle reg shifts
and 'struct ns16550' needs no padding (which is functionally what
unsigned char foo[0] provides). This is the same case as NS16550_DYNAMIC
and DEBUG_UART. Expand the existing comment here slightly.

Otherwise, we will have CONFIG_SYS_NS16550_REG_SIZE set to a non-zero
value, and handle padding within the struct.

Cc: Simon Glass <sjg@chromium.org>
Cc: Sergei Antonov <saproj@gmail.com>
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Fixes: 9591b63531 ("Convert CONFIG_SYS_NS16550_MEM32 et al to Kconfig")
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
2023-01-20 12:27:06 -05:00
Tom Rini
ae8a922bd2 arm: Rework usage of CONFIG_ARMV[78]_SECURE_BASE in linker scripts
In order to avoid defining CONFIG_ARMV[78_]SECURE_BASE as empty in the
linker scripts, if not already defined, add and use
__ARMV[78_]SECURE_BASE for when the base is not defined and we want the
linker scripts to continue.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
81451a3985 i2c: fsl_i2c: Rework usage of CONFIG_SYS_IMMR
This driver is used on both m68k, where CONFIG_SYS_IMMR is not used, and
PowerPC an ARM where it is. Abstract this to a new value rather than
re-defining a CONFIG symbol on m68k.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
409163a46e arc: Migrate ARC_MMU_VER to Kconfig
Move this value to Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Tom Rini
a3fda0d30a global: Remove unused CONFIG defines
Remove some CONFIG symbols and related comments, etc, that are unused
within the code itself at this point.

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-01-20 12:27:06 -05:00
Ilias Apalodimas
e10fffe8b5 efi_loader: fix CapsuleMax variable reporting
Currently the code that adds the CapsuleMax variable is under a
Kconfig named 'EFI_HAVE_CAPSULE_UPDATE.  Git history only shows a
single occurrence of that.  The IS_ENABLED should be checking for
EFI_HAVE_CAPSULE_SUPPORT

Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 17:10:57 +01:00
Ilias Apalodimas
cd63e2d26c efi_loader: update the error message of TCG protocol installation
"Unable to find TPMv2 device" doesn't explain much with regards to the
error origin. Update it to match what we have in the RNG protocol
installation.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00
Heinrich Schuchardt
90c420509e efi_loader: ensure that file ubootefi.var is created
Currently file ubootefi.var is only created if the user sets a non-volatile
EFI variable. If the file is missing, a warning is written.

With the change PlatformLang is always persisted. So the file will exist on
second boot.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-01-20 16:38:52 +01:00
Jan Kiszka
e585b79ee4 efi_loader: Avoid overwriting previous outputs on console screen clearing
Before clearing the screen, ensure that no previous output of firmware
or UEFI programs will be overwritten on serial devices or other
streaming consoles. This helps generating complete boot logs.

Tested regarding multi-output against qemu-x86_defconfig. Still, there
were remaining concerns about side effects, so this is provided as an
opt-in feature.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00
Jan Kiszka
de94f0f320 efi_loader: Set default console colors on efi_cout_clear_screen if needed
Ensures a consistent background color of the whole screen for succeeding
outputs as both demanded by the spec and implemented in EDK2 as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-01-20 16:38:52 +01:00