]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
15 months agocmd: gpt: Add command to set bootable flags
Joshua Watt [Thu, 31 Aug 2023 16:51:38 +0000 (10:51 -0600)]
cmd: gpt: Add command to set bootable flags

Adds a command that can be used to modify the GPT partition table to
indicate which partitions should have the bootable flag set

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
15 months agocmd: gpt: Add gpt_partition_bootable variable
Joshua Watt [Thu, 31 Aug 2023 16:51:37 +0000 (10:51 -0600)]
cmd: gpt: Add gpt_partition_bootable variable

Adds an additional variable called gpt_partition_bootable that indicates
if the given partition is bootable or not.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
15 months agotests: gpt: Remove test order dependency
Joshua Watt [Thu, 31 Aug 2023 16:51:36 +0000 (10:51 -0600)]
tests: gpt: Remove test order dependency

Re-create a clean disk image for each test to prevent modifications from
one test affecting another

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
15 months agoMerge branch 'next_ufs' of https://source.denx.de/u-boot/custodians/u-boot-sh into...
Tom Rini [Sat, 9 Sep 2023 14:12:40 +0000 (10:12 -0400)]
Merge branch 'next_ufs' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

- UFS support and GPIO clock driver

15 months agoufs: ufs-renesas: Drop include common.h
Marek Vasut [Sat, 9 Sep 2023 02:54:35 +0000 (04:54 +0200)]
ufs: ufs-renesas: Drop include common.h

The "#include <common.h>" is being phased out in favor of more fine
grained header management, i.e. ideally include a subset of headers
that are really needed. Remove it from this driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoARM: renesas: Enable UFS on R8A779F0 S4 Spider
Marek Vasut [Tue, 22 Aug 2023 01:47:56 +0000 (03:47 +0200)]
ARM: renesas: Enable UFS on R8A779F0 S4 Spider

Enable UFS controller driver and matching UFS and SCSI commands. The
former is used to initialize the device, the later is used to perform
low level access to the SCSI interface of the UFS device.

Enable R8A779F0 S4 Spider specific dependencies, the PCA953x driver
and GPIO clock gate driver. This setup is used to toggle 38.4 MHz
clock for the UFS controller.

Enable support for 48bit LBA in block layer to address disks larger
than 512*2^32 ~= 144 PiB. Enable use of 64bit LBA variables in the
rest of U-Boot, instead of the default 32bit ones.

Increase FAT cluster size to 128k as that is what is used by the
filesystem that is populated on the UFS device.

Use 'ufs init && scsi scan' to start the UFS device from U-Boot prompt.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoufs: ufs-renesas: Add support for Renesas R-Car UFS controller
Marek Vasut [Tue, 22 Aug 2023 01:47:13 +0000 (03:47 +0200)]
ufs: ufs-renesas: Add support for Renesas R-Car UFS controller

Add support for Renesas R-Car UFS controller which needs vendor-specific
initialization.

Ported from Linux kernel as of commit
c2ab666072bc ("scsi: ufs: Explicitly include correct DT includes")

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoclk: Add GPIO-controlled clock gate driver
Marek Vasut [Sun, 13 Aug 2023 23:51:27 +0000 (01:51 +0200)]
clk: Add GPIO-controlled clock gate driver

Add driver which implements GPIO-controlled clock. The GPIO is used
as a gate to enable/disable the clock. This matches linux clk-gpio.c
driver, however this does not implement the GPIO mux part, which in
U-Boot DM would be better fit in separate driver.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
15 months agoMerge branch '2023-09-08-assorted-TI-platform-updates' into next
Tom Rini [Sat, 9 Sep 2023 02:44:00 +0000 (22:44 -0400)]
Merge branch '2023-09-08-assorted-TI-platform-updates' into next

- Add TI BeaglePlay support, verdin-am62 cleanups, K3-J7 DDR timing
  updates, IOT2050 DTS update for watchdog

15 months agoWatchdog: Support WDIOF_CARDRESET on TI AM65x platform
Li Hua Qian [Tue, 29 Aug 2023 03:46:21 +0000 (11:46 +0800)]
Watchdog: Support WDIOF_CARDRESET on TI AM65x platform

To have the WDIOF_CARDRESET support for the TI AM65x platform watchdog,
this patch reserves some memories, which indicate if the current boot due
to a watchdog reset.

Signed-off-by: Li Hua Qian <huaqian.li@siemens.com>
15 months agoinclude: configs: verdin-am62: drop unused sdram address
Marcel Ziswiler [Mon, 28 Aug 2023 21:50:37 +0000 (23:50 +0200)]
include: configs: verdin-am62: drop unused sdram address

Drop unused macro. This was copied straight from the AM62x EVM but while
meant for a second region of DDR this is not even needed for the AM62x
EVM configurations and has meanwhile also been dropped there.

Note that on the Verdin AM62, we do auto-detect the amount of SDRAM.

While at it also update the comment noting that CFG_SYS_SDRAM_SIZE is
the maximum which is only used for such auto-detection.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoarm: dts: k3-j7*: ddr: Update to 0.10 version of DDR config tool
Neha Malcom Francis [Mon, 28 Aug 2023 11:44:05 +0000 (17:14 +0530)]
arm: dts: k3-j7*: ddr: Update to 0.10 version of DDR config tool

Update the DDR settings to those generated using 0.10 version of Jacinto
7 DDRSS Register Configuration tool.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
15 months agodoc: board: ti: Add BeaglePlay documentation
Nishanth Menon [Fri, 25 Aug 2023 18:03:05 +0000 (13:03 -0500)]
doc: board: ti: Add BeaglePlay documentation

Add base documentation for BeaglePlay

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoboard: ti: am62x: Add am62x_beagleplay_* defconfigs and env file
Nishanth Menon [Fri, 25 Aug 2023 18:03:04 +0000 (13:03 -0500)]
board: ti: am62x: Add am62x_beagleplay_* defconfigs and env file

Add defconfig fragments for am625 based beagleplay and corresponding
customized environment file for beagleplay.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoarm: dts: Add k3-am625-beagleplay
Robert Nelson [Fri, 25 Aug 2023 18:03:03 +0000 (13:03 -0500)]
arm: dts: Add k3-am625-beagleplay

BeagleBoard.org BeaglePlay is an easy to use, affordable open source
hardware single board computer based on the Texas Instruments AM625
SoC that allows you to create connected devices that work even at long
distances using IEEE 802.15.4g LR-WPAN and IEEE 802.3cg 10Base-T1L.
Expansion is provided over open standards based mikroBUS, Grove and
QWIIC headers among other interfaces.

This board family can be identified by the 24c32 eeprom:

[aa 55 33 ee 01 37 00 10  2e 00 42 45 41 47 4c 45  |.U3..7....BEAGLE|]
[50 4c 41 59 2d 41 30 2d  00 00 30 32 30 30 37 38  |PLAY-A0-..020078|]

https://beagleplay.org/
https://git.beagleboard.org/beagleplay/beagleplay

baseline of base device tree is v6.5-rc1.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Co-developed-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: dts: k3-am625-sk-binman: Add labels for unsigned binary
Nishanth Menon [Fri, 25 Aug 2023 18:03:02 +0000 (13:03 -0500)]
arm: dts: k3-am625-sk-binman: Add labels for unsigned binary

Add labels for unsigned binary to permit over-ride.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoconfigs: am62x_evm_a53_defconfig: Disable semi-functional PSCI reset support
Jan Kiszka [Fri, 25 Aug 2023 18:03:01 +0000 (13:03 -0500)]
configs: am62x_evm_a53_defconfig: Disable semi-functional PSCI reset support

At this point, system shutdown is not supported by the DM firmware
that TF-A calls. As we can't de-select only this feature[1], declare
complete PSCI reset support as non-functional so that we don't signal
incomplete support to the OS via EFI runtime services. This makes
power-off under Linux work again when booting via EFI.

[1] https://uefi.org/specs/UEFI/2.9_A/08_Services_Runtime_Services.html?highlight=efiresetshutdown#resetsystem
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoarm: mach-k3: am625: Add support for UDA FS
Nishanth Menon [Fri, 25 Aug 2023 18:03:00 +0000 (13:03 -0500)]
arm: mach-k3: am625: Add support for UDA FS

While boot partition support with EMMC boot is useful, it is
constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that
can substantially vary in size and the u-boot image itself can vary over
time as we enable various features.

So use the CSD information in the case of EMMC_BOOT configuration being
enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to
pick data from UDA.

While at this, drop the extraneous whitespace.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoconfigs: am62x_evm*: Enable EMMC_BOOT configuration
Nishanth Menon [Fri, 25 Aug 2023 18:02:59 +0000 (13:02 -0500)]
configs: am62x_evm*: Enable EMMC_BOOT configuration

Enable EMMC boot support for AM62x evm base configuration.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: mach-k3: am625_init: Convert rtc_erratumi2327_init to static
Nishanth Menon [Fri, 25 Aug 2023 18:02:58 +0000 (13:02 -0500)]
arm: mach-k3: am625_init: Convert rtc_erratumi2327_init to static

The erratum is called locally, make it static, drop the #ifdeffery since
it will only be called in R5 build and mark it potentially unused to
stop compiler screaming at us.

While at this, drop the redundant return for a void function.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoarm: mach-k3: am625_init: Use IS_ENABLED()
Nishanth Menon [Fri, 25 Aug 2023 18:02:57 +0000 (13:02 -0500)]
arm: mach-k3: am625_init: Use IS_ENABLED()

Drop the #ifdeffery and use IS_ENABLED() inline check and let the compiler
do it's thing.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoboard: ti: am62x: am62x.env: Use default findfdt
Nishanth Menon [Fri, 25 Aug 2023 18:02:56 +0000 (13:02 -0500)]
board: ti: am62x: am62x.env: Use default findfdt

Use the default findfdt using CONFIG_DEFAULT_DEVICE_TREE

Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: env: ti: Add a generic default_findfdt.env
Nishanth Menon [Fri, 25 Aug 2023 18:02:55 +0000 (13:02 -0500)]
include: env: ti: Add a generic default_findfdt.env

ti_mmc bootmethod uses a findfdt routine that is expected to be
implemented by all platforms.

Define a default findfdt based on configured DEFAULT_DEVICE_TREE option
for u-boot. This saves duplication across multiple boards and handles
architecture folder location changes centrally.

TI ARMV7 platforms will need to override default_device_tree_subarch
in the env file to point to the appropriate platform. Note: default
"omap" is used to cater to "most common" default.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: env: ti: ti_armv7_common.env: Rename to ti_common.env
Nishanth Menon [Fri, 25 Aug 2023 18:02:54 +0000 (13:02 -0500)]
include: env: ti: ti_armv7_common.env: Rename to ti_common.env

ti_armv7_common does not make any more sense as it is used by armv7
and armv8 TI based platforms.

Reported-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoinclude: configs: am62x_evm: Drop distro_bootcmd usage
Nishanth Menon [Fri, 25 Aug 2023 18:02:53 +0000 (13:02 -0500)]
include: configs: am62x_evm: Drop distro_bootcmd usage

Now that BOOTSTD is used by default, drop un-used header file
inclusion.

Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoconfigs: am62x_evm_a53_defconfig: Switch to bootstd
Nishanth Menon [Fri, 25 Aug 2023 18:02:52 +0000 (13:02 -0500)]
configs: am62x_evm_a53_defconfig: Switch to bootstd

Switch to using bootstd. Note with this change, we will stop using
distro_bootcmd and instead depend entirely on bootflow method of
starting the system up.

Suggested-by: Tom Rini <trini@konsulko.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoboard: ti: am62x: am62x.env: Add explicit boot_targets
Nishanth Menon [Fri, 25 Aug 2023 18:02:51 +0000 (13:02 -0500)]
board: ti: am62x: am62x.env: Add explicit boot_targets

Add explicit boot_targets to indicate the specific boot sequence to
follow.

NOTE: The non-standard ti_mmc emulates what is done for distro_boot.
With bootstd, this will eventually need to be replaced by equivalent
class.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: configs: am62x_evm: Wrap distroboot with CONFIG_DISTRO_DEFAULTS
Nishanth Menon [Fri, 25 Aug 2023 18:02:50 +0000 (13:02 -0500)]
include: configs: am62x_evm: Wrap distroboot with CONFIG_DISTRO_DEFAULTS

Wrap the distro_boot options with CONFIG_DISTRO_DEFAULTS.

This is an intermediate step for us to switch over to
CONFIG_BOOTSTD_DEFAULTS and drop this section in follow on patches.

Reviewed-by: Tom Rini <trini@konsulko.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: configs: am62x_evm: Drop unused SDRAM address
Nishanth Menon [Fri, 25 Aug 2023 18:02:49 +0000 (13:02 -0500)]
include: configs: am62x_evm: Drop unused SDRAM address

Drop unused macro. This was meant for a second region of DDR which we
do not need for AM62x evm configurations.

Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: configs: ti_armv7_common: Add documentation for protected section
Nishanth Menon [Fri, 25 Aug 2023 18:02:48 +0000 (13:02 -0500)]
include: configs: ti_armv7_common: Add documentation for protected section

Make the section protected by CONFIG_DISTRO_DEFAULTS macro clear.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
15 months agoinclude: env: ti: mmc: envboot: Only attempt boot.scr if BOOTSTD is not enabled
Nishanth Menon [Fri, 25 Aug 2023 18:02:47 +0000 (13:02 -0500)]
include: env: ti: mmc: envboot: Only attempt boot.scr if BOOTSTD is not enabled

'script' bootmethod that should be used with CONFIG_BOOTSTD.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoinclude: env: ti: mmc: envboot/mmcboot: Check result of mmc dev before proceeding
Nishanth Menon [Fri, 25 Aug 2023 18:02:46 +0000 (13:02 -0500)]
include: env: ti: mmc: envboot/mmcboot: Check result of mmc dev before proceeding

If mmc dev reports that the device is not present, there is no point in
proceeding further to attempt to load the files.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoboard: verdin-am62: fix check for minimum memory size
Emanuele Ghidoli [Thu, 24 Aug 2023 08:08:50 +0000 (10:08 +0200)]
board: verdin-am62: fix check for minimum memory size

verdin am62 SKUs comes in multiple memory configuration, check that
the detected memory is at least 512MB since we have some
reserved memory just before this threshold and therefore
the module cannot work with less memory.

Fixes: 7d1a10659f5b ("board: toradex: add verdin am62 support")
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
15 months agoverdin-am62: add u-boot update wrappers
Emanuele Ghidoli [Thu, 24 Aug 2023 08:08:49 +0000 (10:08 +0200)]
verdin-am62: add u-boot update wrappers

Add update_tiboot3, update_tispl and update_uboot wrappers to update
R5 SPL, A53 SPL and A53 U-boot respectively.

Usage example:
> tftpboot ${loadaddr} tiboot3-am62x-gp-verdin.bin
> run update_tiboot3

> tftpboot ${loadaddr} tispl.bin
> run update_tispl

> tftpboot ${loadaddr} u-boot.img
> run update_uboot

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
15 months agoMerge branch '2023-09-06-assorted-CI-updates' into next
Tom Rini [Wed, 6 Sep 2023 22:47:18 +0000 (18:47 -0400)]
Merge branch '2023-09-06-assorted-CI-updates' into next

- Merge in a number of changes for CI. The biggest ones of note are that
  we now support sandbox64 in CI, and Azure has been reworked to
  generally have more consistent overall runtime for the pipeline.

15 months agoAzure: Add sandbox64 to CI
Tom Rini [Fri, 1 Sep 2023 20:41:43 +0000 (16:41 -0400)]
Azure: Add sandbox64 to CI

Now that sandbox64 can run and pass the regular test.py suite, add it
here as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months ago.gitlab-ci: Test sandbox64 board in addition to sandbox
Marek Vasut [Fri, 1 Sep 2023 08:48:10 +0000 (10:48 +0200)]
.gitlab-ci: Test sandbox64 board in addition to sandbox

Test both 32bit and 64bit sandbox boards in CI.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoAzure: Split sandbox and qemu test.py runs
Tom Rini [Fri, 1 Sep 2023 20:41:42 +0000 (16:41 -0400)]
Azure: Split sandbox and qemu test.py runs

Currently, most sandbox runs take a long time (due to running so many
tests) while QEMu based test.py runs are fairly short.  Split the
pipeline here so that we get more consistent average run times.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoAzure: Rework test_py job to publish its wrapper script
Tom Rini [Fri, 1 Sep 2023 20:41:41 +0000 (16:41 -0400)]
Azure: Rework test_py job to publish its wrapper script

Both to aide in debugging of any test.py issues as well as to make it
easier to split the current matrix in two, have a new job that creates
and publishes the current wrapper script we use for test.py jobs.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoCI: Drop some jobs we didn't really utilize
Tom Rini [Sun, 20 Aug 2023 17:31:29 +0000 (13:31 -0400)]
CI: Drop some jobs we didn't really utilize

- We have added more TODO/etc comments since this task was created and
  never focused on removing them.
- The output of sloccount isn't preserved or looked at, and if desired
  should be in the release stats pages instead somehow.
- The results of cppcheck aren't investigated and require modeling work
  to be useful to start with.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoCI: Combine tools-only and envtools jobs
Tom Rini [Sun, 20 Aug 2023 17:31:28 +0000 (13:31 -0400)]
CI: Combine tools-only and envtools jobs

These jobs are to confirm specific build targets, on a Linux host.  We
can safely combine these two build tests, with a make mrproper in
between.

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoAzure: Rework build the world jobs
Tom Rini [Sun, 20 Aug 2023 17:31:27 +0000 (13:31 -0400)]
Azure: Rework build the world jobs

Now that we have 3600 minutes per build job, condense and rework things
such that our overall time largely doesn't change, but we can also
largely avoid having to re-tweak this job to avoid timeouts.  Given that
we have 10 threads, we also move a few of the specific sandbox test
builds to a prior stage.

Note that while sandbox builds with address sanitization enabled (ASAN)
not all tests pass, so we limit ourselves to just checking that the
version test passes for now.

Link: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/phases?view=azure-devops&tabs=yaml#timeouts
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotest: print: Fix hexdump test on 64bit systems
Marek Vasut [Fri, 25 Aug 2023 08:19:40 +0000 (10:19 +0200)]
test: print: Fix hexdump test on 64bit systems

Use the following regex to make this test compatible with
both 32bit and 64bit systems. The trick is to use %0*lx
format string for the address prefix in the test.

"
s@\(ut_assert_nextline("\)0\+\([^:]\+\)\(:.*"\)\();\)@\1%0*lx\3, IS_ENABLED(CONFIG_PHYS_64BIT) ? 16 : 8, 0x\2UL\4
"

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotest: dm: test-fdt: Use fdtdec_get_int() in dm_check_devices()
Marek Vasut [Wed, 23 Aug 2023 19:37:44 +0000 (21:37 +0200)]
test: dm: test-fdt: Use fdtdec_get_int() in dm_check_devices()

The current fdtdec_get_addr() takes into consideration #address-cells
and #size-cells for "ping-expect" property which is clearly neither.
Use fdtdec_get_int() instead and return negative one in case the
property is not in DT or the platform under test is not DT based,
i.e. mimic the current fdtdec_get_addr() behavior.

This fixes ut dm dm_test_bus_children test.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoconfigs: sandbox64: Enable legacy image format support
Marek Vasut [Wed, 23 Aug 2023 00:17:12 +0000 (02:17 +0200)]
configs: sandbox64: Enable legacy image format support

Align the sandbox64 defconfig with sandbox defconfig. Enable missing
legacy image format support. This fixes ut_bootstd_bootflow_cmd_menu
test.

Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-coldfire into...
Tom Rini [Wed, 6 Sep 2023 15:50:49 +0000 (11:50 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-coldfire into next

- Relocation support

15 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-usb into next
Tom Rini [Wed, 6 Sep 2023 15:50:22 +0000 (11:50 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-usb into next

15 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Wed, 6 Sep 2023 15:00:42 +0000 (11:00 -0400)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

- rmobile cleanup

15 months agoARM: rmobile: Clean up rmobile_cpuinfo_idx()
Marek Vasut [Sat, 19 Aug 2023 14:39:13 +0000 (16:39 +0200)]
ARM: rmobile: Clean up rmobile_cpuinfo_idx()

Clean the function up a bit further. Return immediately on match
and return ARRAY_SIZE() - 1 on failure. Add proper comment in that
case.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
15 months agoMerge branch '2023-09-06-riscv-fixes' into next
Tom Rini [Wed, 6 Sep 2023 15:00:10 +0000 (11:00 -0400)]
Merge branch '2023-09-06-riscv-fixes' into next

- Merge two patches to fix the issues with risc-v building on next after
  the merge of v2023.10-rc4 to next.

15 months agoriscv: Correct event usage for riscv_cpu_probe/setup
Tom Rini [Mon, 4 Sep 2023 19:06:35 +0000 (15:06 -0400)]
riscv: Correct event usage for riscv_cpu_probe/setup

With having both an EVENT_SPY_SIMPLE setup for both riscv_cpu_probe and
riscv_cpu_setup we do not need the latter function to call the former
function as it will already have been done in time.

Fixes: 1c55d62fb9cc ("riscv: cpu: make riscv_cpu_probe to EVT_DM_POST_INIT_R callback")
Tested-by: Milan P. Stanić <mps@arvanta.net>
Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoriscv: Rework riscv_cpu_probe for current event macros
Tom Rini [Mon, 4 Sep 2023 19:06:34 +0000 (15:06 -0400)]
riscv: Rework riscv_cpu_probe for current event macros

This function should now be a EVENT_SPY_SIMPLE call, update it.

Tested-by: Milan P. Stanić <mps@arvanta.net>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoarch: m68k: Implement relocation
Marek Vasut [Sat, 26 Aug 2023 22:25:36 +0000 (00:25 +0200)]
arch: m68k: Implement relocation

Implement relocation for M68K. Perform all the updates in start.S
relocate_code in assemby, since it is a simple matter of traversing
the dynsym table and adding relocation offset - MONITOR_BASE to all
the items in that table. The necessity to deal with MONITOR_BASE is
a specific of M68K, where the ELF entry point is at offset 0x400,
which is the MONITOR_BASE, while TEXT_BASE is at offset 0 .

This also removes the one last user of NEEDS_MANUAL_RELOC, so that
could be finally cleaned up .

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agotools: relocate-rela: Add M68K support
Marek Vasut [Sat, 26 Aug 2023 22:25:35 +0000 (00:25 +0200)]
tools: relocate-rela: Add M68K support

Add M68K ELF32 support into this tool, so it can patch static rela
into M68K u-boot-nodtb.bin . This is the first step toward M68K
relocation support, and in turn, removal of NEEDS_MANUAL_RELOC
from the codebase altogether.

Tested-by: Michal Simek <michal.simek@amd.com> # microblaze, arm64
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agotools: relocate-rela: Fix BE symtab handling
Marek Vasut [Sun, 30 Jul 2023 22:16:52 +0000 (00:16 +0200)]
tools: relocate-rela: Fix BE symtab handling

The symtab contains data in target endianness, convert the data to
native endianness before doing any operations and on them, and back
to target endianness before updating the bin file.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Michal Simek <michal.simek@amd.com> # microblaze, arm64
Reviewed-by: Angelo Dureghello <angelo@kernel-space.org>
15 months agousb: host: ohci-generic: Make usage of clock/reset bulk() API
Fabrice Gasnier [Mon, 4 Sep 2023 12:20:21 +0000 (14:20 +0200)]
usb: host: ohci-generic: Make usage of clock/reset bulk() API

Make usage of clock and reset bulk API in order to simplify the code

Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Xavier Drudis Ferran <xdrudis@tinet.cat>
15 months agousb: check for companion controller in uclass
Fabrice Gasnier [Fri, 1 Sep 2023 09:52:01 +0000 (11:52 +0200)]
usb: check for companion controller in uclass

EHCI is usually used with companion controller (like OHCI) as companion
controller. This information on the companion is missing currently in
companion drivers.
So, if the usb-uclass isn't aware, it may scan busses in any order: OHCI
first, then EHCI.
This is seen on STM32MP1 where DT probing makes the probe order to occur
by increasing address (OHCI address < EHCI address).

When a low speed or full-speed device is plugged in, it's not detected as
EHCI should first detect it, and give ownership (handover) to OHCI.

Current situation on STM32MP1 (with a low speed device plugged-in)
STM32MP> usb start
starting USB...
Bus usb@5800c000: USB OHCI 1.0
Bus usb@5800d000: USB EHCI 1.00
scanning bus usb@5800c000 for devices... 1 USB Device(s) found
scanning bus usb@5800d000 for devices... 1 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found

The "companion" property in the device tree allow to retrieve companion
controller information, from the EHCI node. This allow marking the
companion driver as such.

With this patch (same low speed device plugged in):
STM32MP> usb start
starting USB...
Bus usb@5800c000: USB OHCI 1.0
Bus usb@5800d000: USB EHCI 1.00
scanning bus usb@5800d000 for devices... 1 USB Device(s) found
scanning bus usb@5800c000 for devices... 2 USB Device(s) found
   scanning usb for storage devices... 0 Storage Device(s) found
STM32MP> usb tree
USB device tree:
1  Hub (12 Mb/s, 0mA)
|   U-Boot Root Hub
|
+-2  Human Interface (1.5 Mb/s, 100mA)
   HP HP USB 1000dpi Laser Mouse

1  Hub (480 Mb/s, 0mA)
 u-boot EHCI Host Controller

This also optimize bus scan when a High speed device is plugged in, as
the usb-uclass skips OHCI in this case:

STM32MP> usb reset
resetting USB...
Bus usb@5800c000: USB OHCI 1.0
Bus usb@5800d000: USB EHCI 1.00
scanning bus usb@5800d000 for devices... 2 USB Device(s) found
   scanning usb for storage devices... 1 Storage Device(s) found
STM32MP> usb tree
USB device tree:
1  Hub (480 Mb/s, 0mA)
|  u-boot EHCI Host Controller
|
+-2  Mass Storage (480 Mb/s, 200mA)
   SanDisk Cruzer Blade 03003432021922011407

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Reviewed-by: Marek Vasut <marex@denx.de>
15 months agoevent.h: Documented some newly added portions better
Tom Rini [Mon, 4 Sep 2023 15:19:50 +0000 (11:19 -0400)]
event.h: Documented some newly added portions better

After the merge of v2023.10-rc4 to next include/event.h needs to be
fully documented in order for documentation builds to complete.  Rewords
two of the event_t descriptions to be docbook style and better match the
rest of this enum.  Fix two typos (flag->flags) in other comments.

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoMerge tag 'v2023.10-rc4' into next
Tom Rini [Mon, 4 Sep 2023 14:51:58 +0000 (10:51 -0400)]
Merge tag 'v2023.10-rc4' into next

Prepare v2023.10-rc4

15 months agoPrepare v2023.10-rc4
Tom Rini [Mon, 4 Sep 2023 14:39:43 +0000 (10:39 -0400)]
Prepare v2023.10-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoMerge tag 'rpi-2023.10' of https://source.denx.de/u-boot/custodians/u-boot-raspberrypi
Tom Rini [Mon, 4 Sep 2023 14:07:48 +0000 (10:07 -0400)]
Merge tag 'rpi-2023.10' of https://source.denx.de/u-boot/custodians/u-boot-raspberrypi

Updates for RPi for 2023.10:

- rpi: Disable DISTRO_DEFAULTS
- arm: rpi: Switch to standard boot
- arm: rpi: Switch to a text environment

15 months agoarm: rpi: Switch to a text environment
Simon Glass [Thu, 27 Jul 2023 21:54:30 +0000 (15:54 -0600)]
arm: rpi: Switch to a text environment

Use the new environment format so we can drop most of the config.h file.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agorpi: Disable DISTRO_DEFAULTS
Simon Glass [Thu, 27 Jul 2023 21:54:29 +0000 (15:54 -0600)]
rpi: Disable DISTRO_DEFAULTS

Disable this option to reclaim some space, since bootstd requires less
functionality to operate (e.g. hush parser).

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agoarm: rpi: Switch to standard boot
Simon Glass [Thu, 27 Jul 2023 21:54:28 +0000 (15:54 -0600)]
arm: rpi: Switch to standard boot

Drop use of the distro scripts and use standard boot instead.

We don't need to specify the mmc devices individually, since they are
used in order from 0 to 2, and standard boot uses that order anyway.

Signed-off-by: Simon Glass <sjg@chromium.org>
15 months agoMerge tag 'doc-2023-10-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 2 Sep 2023 13:08:54 +0000 (09:08 -0400)]
Merge tag 'doc-2023-10-rc4-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request doc-2023-10-rc4-2

* Man-page for gpt command
* Fix long text help of gpt command
* Add events to HTML documentation
* Update Toradex documentation

15 months agoMerge tag 'doc-next' of https://source.denx.de/u-boot/custodians/u-boot-efi into...
Tom Rini [Sat, 2 Sep 2023 13:08:34 +0000 (09:08 -0400)]
Merge tag 'doc-next' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request doc-next

* Update TI am64x documentation

15 months agodoc: Add gpt command documentation
Joshua Watt [Thu, 31 Aug 2023 16:51:35 +0000 (10:51 -0600)]
doc: Add gpt command documentation

Adds initial documentation for the gpt command

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
15 months agocmd: gpt: Remove confusing help text
Joshua Watt [Thu, 31 Aug 2023 16:51:34 +0000 (10:51 -0600)]
cmd: gpt: Remove confusing help text

This help text appears to be a fragment of the text shown when
CONFIG_CMD_GPT_RENAME is enabled, but is confusing so remove it.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
15 months agodoc: board: ti: am64x: Fix build step numbering
Nishanth Menon [Tue, 22 Aug 2023 16:41:03 +0000 (11:41 -0500)]
doc: board: ti: am64x: Fix build step numbering

Fix up build step numbering.

Fixes: 4bf49bade124 ("doc: board: ti: am64: Add boot flow diagram")
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
15 months agodoc: board: ti: am64x: provide image alt text
Nishanth Menon [Tue, 22 Aug 2023 16:40:58 +0000 (11:40 -0500)]
doc: board: ti: am64x: provide image alt text

Provide alternative text for image.

Fixes: 4bf49bade124 ("doc: board: ti: am64: Add boot flow diagram")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
15 months agodoc: board: toradex: verdin-am62: document update u-boot wrapper
Marcel Ziswiler [Mon, 28 Aug 2023 22:01:54 +0000 (00:01 +0200)]
doc: board: toradex: verdin-am62: document update u-boot wrapper

Now with the update U-Boot wrappers having been sorted out, document
their usage.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agodoc: board: toradex: minor documentation update
Marcel Ziswiler [Mon, 28 Aug 2023 22:01:53 +0000 (00:01 +0200)]
doc: board: toradex: minor documentation update

- Update SPDX-License-Identifier from obsolete GPL-2.0+ to
  GPL-2.0-or-later.
- Add links to product websites of SoM and carrier board where missing.
- Add information about update U-Boot wrapper where missing.
- Add sectionauthor where missing.
- Update information about imx-seco from version 3.7.4 to 3.8.1.
- Various minor grammatic and spelling fixes.
- Improve whitespace by adding or removing new lines.
- Change from code-block for output to just Output::.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agovideo: fix typo in video_sync_all documentation
Heinrich Schuchardt [Mon, 28 Aug 2023 20:40:47 +0000 (22:40 +0200)]
video: fix typo in video_sync_all documentation

%s/there/their/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agodoc: add events.h to documentation
Heinrich Schuchardt [Mon, 28 Aug 2023 19:13:33 +0000 (21:13 +0200)]
doc: add events.h to documentation

Add the events.h include to the API documentation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agodm: event: document all events
Heinrich Schuchardt [Mon, 28 Aug 2023 19:13:32 +0000 (21:13 +0200)]
dm: event: document all events

Provide Sphinx documentation for all events.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-31-replace-more-init-hooks-with-events' into next
Tom Rini [Thu, 31 Aug 2023 19:10:42 +0000 (15:10 -0400)]
Merge branch '2023-08-31-replace-more-init-hooks-with-events' into next

To quote the author:
This series replaces some more of the init hooks in board_f.c and
board_r.c with events. Notably it converts last_state_init() over.

It also provides a 'simple' event spy, which takes no arguments. It
turns out that this is quite a common case, so it is worth optimising
for this, to reduce code size, before events become too commonly used.

Finally, it introduces a way of emitting an event in an initcall,
instead of calling a function. This is likely to be used at least as
often as the functions, as we convert more of these initcalls.

As part of this, the initcall code is brought back into a C file. Somehow
the compiler has changed or something else, so that this does not confer
any benefits now.

For boards with EVENT enabled, this unfortunately results in small
growth, e.g. for firefly:

   aarch64: (for 1/1 boards) all +114.0 data +16.0 rodata +22.0 text +76.0
       arm: (for 1/1 boards) all +82.0 rodata +18.0 text +64.0

For boards without EVENT enabled the growth is smaller, e.g. nokia_rx51:

       arm: (for 1/1 boards) all +32.0 data +8.0 rodata -8.0 text +32.0

I cannot find a good way to avoid the latter, other than macro magic
with an embedded comma (to completely remove an event entry), which
seems nasty.

16 months agoevent: Use an event to replace last_stage_init()
Simon Glass [Tue, 22 Aug 2023 03:17:01 +0000 (21:17 -0600)]
event: Use an event to replace last_stage_init()

Add a new event which handles this function. Convert existing use of
the function to use the new event instead.

Make sure that EVENT is enabled by affected boards, by selecting it from
the LAST_STAGE_INIT option. For x86, enable it by default since all boards
need it.

For controlcenterdc, inline the get_tpm() function and make sure the event
is not built in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agofreescale: Drop call to init_func_vid() in the init sequence
Simon Glass [Tue, 22 Aug 2023 03:17:00 +0000 (21:17 -0600)]
freescale: Drop call to init_func_vid() in the init sequence

Use the misc_init_f event instead, which is designed for this purpose.

All boards with CONFIG_VID already enable CONFIG_EVENT.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agox86: Convert arch_fsp_init() to use events
Simon Glass [Tue, 22 Aug 2023 03:16:59 +0000 (21:16 -0600)]
x86: Convert arch_fsp_init() to use events

Convert this to use events instead of calling a function directly in the
init sequence.

Rename it to arch_fsp_init_f() to distinguish it from the one that happens
after relocation.

For FSPv2 nothing needs to be done here, so drop the empty function.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Update documentation for simple spy
Simon Glass [Tue, 22 Aug 2023 03:16:58 +0000 (21:16 -0600)]
event: Update documentation for simple spy

Now that we have two types of spy, mention this in the documentation. Put
the simple spy first, since it seems to be the common case.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Rename EVENT_SPY to EVENT_SPY_FULL
Simon Glass [Tue, 22 Aug 2023 03:16:57 +0000 (21:16 -0600)]
event: Rename EVENT_SPY to EVENT_SPY_FULL

The new name makes it clearer that this is for a full spy, with access to
the context and the event data.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Convert existing spy records to simple
Simon Glass [Tue, 22 Aug 2023 03:16:56 +0000 (21:16 -0600)]
event: Convert existing spy records to simple

Very few of the existing event-spy records use the arguments they are
passed. Update them to use a simple spy instead, to simplify the code.

Where an adaptor function is currently used, remove it where possible.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoinitcall: Support manual relocation
Simon Glass [Tue, 22 Aug 2023 03:16:55 +0000 (21:16 -0600)]
initcall: Support manual relocation

Move the manual-relocation code to the initcall file. Make sure to avoid
manually relocating event types. Only true function pointers should be
relocated.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoinitcall: Support emitting events
Simon Glass [Tue, 22 Aug 2023 03:16:54 +0000 (21:16 -0600)]
initcall: Support emitting events

At present the initcall list consists of a list of function pointers. Over
time the initcall lists will likely change to mostly emitting events,
since most of the calls are board- or arch-specific.

As a first step, allow an initcall to be an event type instead of a
function pointer. Add the required macro and update initcall_run_list() to
emit an event in that case, or ignore it if events are not enabled.

The bottom 8 bits of the function pointer are used to hold the event type,
with the rest being all ones. This should avoid any collision, since
initcalls should not be above 0xffffff00 in memory.

Convert misc_init_f over to use this mechanism.

Add comments to the initcall header file while we are here. Also fix up
the trace test to handle the change.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Export event_type_name()
Simon Glass [Tue, 22 Aug 2023 03:16:53 +0000 (21:16 -0600)]
event: Export event_type_name()

Export this function so it can be used with initcall debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoinitcall: Adjust the failure message and return value
Simon Glass [Tue, 22 Aug 2023 03:16:52 +0000 (21:16 -0600)]
initcall: Adjust the failure message and return value

Move the failure message outside the loop, so it is easier to follow the
code. Avoid swallowing the error code - just pass it along.

Drop the initcall-list address from the output. This is confusing since
we show two addresses. Really it is only the function address which is
useful, since it can be looked up in the map, e.g. with:

   grep -A1 -B1 serial_init u-boot.map

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoinitcall: Adjust the loop logic
Simon Glass [Tue, 22 Aug 2023 03:16:51 +0000 (21:16 -0600)]
initcall: Adjust the loop logic

Use a variable to hold the function, so we don't need to repeat the
pointer access each time. Rename the init pointer to 'ptr' since we only
refer to it in the for() statement now.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoinitcall: Factor out reloc_off calculation
Simon Glass [Tue, 22 Aug 2023 03:16:50 +0000 (21:16 -0600)]
initcall: Factor out reloc_off calculation

Move this into a function and do it once, not each time around the loop.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoRevert "initcall: Move to inline function"
Simon Glass [Tue, 22 Aug 2023 03:16:49 +0000 (21:16 -0600)]
Revert "initcall: Move to inline function"

Somehow I do not see any inlining with initcalls now. I was sure I saw
it when this commit went in, but now it seems to make things worse.

This reverts commit 47870afab92fca6e672c03d0dea802a55e200675.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoevent: Support a simple spy record
Simon Glass [Tue, 22 Aug 2023 03:16:48 +0000 (21:16 -0600)]
event: Support a simple spy record

The current event spy is always passed the event context and the event.
The context is always NULL for a static spy. The event is not often used.

Introduce a 'simple' spy which takes no arguments. This allows us to drop
the adaptation code that many of these spy records use.

Update the event script to find these in the image.

Signed-off-by: Simon Glass <sjg@chromium.org>
16 months agoMerge branch '2023-08-30-assorted-code-improvements' into next
Tom Rini [Thu, 31 Aug 2023 16:23:36 +0000 (12:23 -0400)]
Merge branch '2023-08-30-assorted-code-improvements' into next

- pcie-bcmstb improvements, nvmxip improvements, fix a corner case in
  the serial uclass, send error messages to stderr in host tools, fwu
  library CI state fixup, turn some setexpr diagnostic messages to debug

16 months agosetexpr: Silence some diagnostic messages
Łukasz Stelmach [Thu, 24 Aug 2023 06:10:25 +0000 (08:10 +0200)]
setexpr: Silence some diagnostic messages

Neither successful match nor lack thereof should be considered an
extraordinary situation. Thus, neither require printing a message.

Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoconfigs: sandbox: Enable NVMXIP QSPI driver
Marek Vasut [Wed, 23 Aug 2023 00:18:21 +0000 (02:18 +0200)]
configs: sandbox: Enable NVMXIP QSPI driver

Enable NVMXIP QSPI driver on sandbox, since it is already enabled
on sandbox64.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodrivers/mtd/nvmxip: Move sandbox_set_enable_memio() to test
Marek Vasut [Wed, 23 Aug 2023 00:18:20 +0000 (02:18 +0200)]
drivers/mtd/nvmxip: Move sandbox_set_enable_memio() to test

The sandbox_set_enable_memio() should only ever be set during
sandbox testing, not within driver itself, move it back to test/ .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodrivers/mtd/nvmxip: Print phys_addr_t without warnings on both 32bit and 64bit systems
Marek Vasut [Wed, 23 Aug 2023 00:18:19 +0000 (02:18 +0200)]
drivers/mtd/nvmxip: Print phys_addr_t without warnings on both 32bit and 64bit systems

Cast the address such that it can be printed without warnings
on both 32bit and 64bit systems. This really should use some
better print formatter, but for the lack of it, do it this way.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodrivers/mtd/nvmxip: Rework the read accessor to support 32bit systems
Marek Vasut [Wed, 23 Aug 2023 00:18:18 +0000 (02:18 +0200)]
drivers/mtd/nvmxip: Rework the read accessor to support 32bit systems

Get rid of nvmxip_mmio_rawread() and just implement the readl()/readq()
reader loop within nvmxip_blk_read(). Cast the destination buffer as
needed and increment the read by either 4 or 8 bytes depending on if
this is systemd with 32bit or 64bit physical address.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agodrivers/mtd/nvmxip: Trigger post bind as probe on driver level
Marek Vasut [Wed, 23 Aug 2023 00:18:17 +0000 (02:18 +0200)]
drivers/mtd/nvmxip: Trigger post bind as probe on driver level

Perform all the block device creation only once, after the driver itself
successfully bound. Do not do this in uclass post bind, as this might be
triggered multiple times. For example the ut_dm_host test triggers this
and triggers a memory leak that way, since there are now multiple block
devices created using the blk_create_devicef() .

To retain the old probe-on-boot behavior, set DM_FLAG_PROBE_AFTER_BIND
flag in uclass post_bind callback, so the driver model would probe the
driver at the right time.

Rename the function as well, to match similar functions in
other block-related subsystems, like the mmc one.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
16 months agofwu: Initialize global fwu library state during CI test
Marek Vasut [Wed, 23 Aug 2023 00:16:52 +0000 (02:16 +0200)]
fwu: Initialize global fwu library state during CI test

The current CI test worked by sheer luck, the g_dev global pointer
in the fwu library was never initialized and the test equally well
failed on sandbox64. Trigger the main loop in sandbox tests too to
initialize that global state, and move the sandbox specific exit
from fwu_boottime_checks after g_dev is initialized.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
16 months agoserial-uclass: reset gd->cur_serial_dev to NULL if serial not found
Maksim Kiselev [Fri, 18 Aug 2023 09:34:30 +0000 (12:34 +0300)]
serial-uclass: reset gd->cur_serial_dev to NULL if serial not found

Reset gd->cur_serial_dev pointer to avoid calling non-relocated code
from relocated code if a serial driver is not found and
CONFIG_REQUIRE_SERIAL_CONSOLE is disabled.

Here is detailed explanation of what this patch is trying to fix.

U-boot calls the serial_find_console_or_panic() function twice.
The first console setup occurs before U-boot relocation in
the serial_init(). This stage uses simple FDT parsing and
assigns gd->cur_serial_dev to a "serial" device that lives in
non-relocated code too.

The second console setup after U-boot relocation(from serial_initialize())
may use full live DT (if OF_LIVE enabled) probe sequence with buses,
clocks, resets, etc... And if the console setup fails at this step,
than we should be caught by panic_str("No serial driver found").

But... If we disable CONFIG_REQUIRE_SERIAL_CONSOLE, than we
return from serial_init() with gd->cur_serial_dev pointing
to the "old"(non-relocated) serial device.

And if this area, where "old" serial device is placed, is changed
(e.g. Linux kernel may be relocated at this address), than we will get
an unexpected crash on the next call of printf().

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
16 months agotools: image-host: print error messages to stderr
Oleksandr Suvorov [Thu, 17 Aug 2023 15:36:10 +0000 (18:36 +0300)]
tools: image-host: print error messages to stderr

The make by default cuts off the stdout output from external tools,
so all error messages from the image-host are not shown in a make
output. Besides that, it is a common approach to use stderr stream
for error messages.
Use stderr for all error messages in image-host.

Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io>
Reviewed-by: Simon Glass <sjg@chromium.org>