Commit graph

94888 commits

Author SHA1 Message Date
Simon Glass
2e9313179a global_data: Drop spl_handoff
Provide a function to locate this information, rather than doing it
automatically on startup, to save space in global_data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
e821897622 board_f: Move new_bloblist to boardf
This value is only used before relocation. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
8941972854 board_f: Move new_bootstage to boardf
This value is only used before relocation. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
5019d3282c board_f: Move fdt_size to board
This value is only really used before relocation. There is not much use
to showing its value in bdinfo, so drop it. Move it to the new boardf
struct.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
6abd992ada board_f: Add a new struct to hold pre-relocation info
Quite a few of the members of struct global_data are only used before
reloction, or have little meaning afterwards, yet they hang around in
struct global_data for the lifetime of U-Boot. This uses up precious
pre-relocation SRAM on many boards.

To help with this, start a new struct which exists only before
relocation. Move new_fdt into this new struct. Drop the display of it
in the 'bdinfo' command as it is probably not very useful.

Note that the field does not exist in SPL builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
52cd51c02f global_data: Use less space for environment fields
Use shorter types for some of these fields to save space. Reorder to put
fields with like alignment together.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
423bdf6690 global_data: Drop pci_bootdelay
This is not used. Drop the field and the environment code which uses it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
a6616bac98 global_data: Drop global_data hose
This is set on one x86 boards, but is not used anymore. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
7d08262ec3 global_data: Remove pci_ram_top
This field is set but not used. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
f44fded236 global_data: Convert have_console into a flag
We don't need a full word for this boolean value. Convert it into a flag
to save space in global_data.

Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
30e331e9cb global_data: Drop fb_base
This value mirrors information recorded by driver model video drivers,
so can be removed to save space. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
32c24a1705 video: Avoid setting global_data fb_base in video setup
This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
3430a62568 video: Avoid setting global_data fb_base from SPL handoff
This field is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
3876abbbfc zynqmp: Avoid setting the framebuffer address
This is handled by driver model so this driver should not be setting the
framebuffer address. Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
4b39b56c3a arm: ronetix: Avoid accessing global_data fb_base
Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
54a221d2cd arm: friendlyarm: Avoid accessing global_data fb_base
Use the new video function to get the framebuffer base.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
1a36338e68 video: mxs: Avoid setting global_data fb_base
This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:38 -06:00
Simon Glass
60fa5e9eff video: mxc: Avoid setting global_data fb_base
This is not used, so don't set it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:37 -06:00
Simon Glass
b5c5923e4e video: Add a function to obtain the framebuffer address
Add a new function which returns the framebuffer address of the first
video device. This will allow the global_data field top be dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:37 -06:00
Simon Glass
26d3faae29 x86: Drop use of global_data fb_base
This value is set by not used on x86 so there is no point in setting it.
Drop the assignment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:37 -06:00
Simon Glass
5f32aac98e global_data: Move pci_clk to m68k and powerpc
Only m68k and powerpc use this field, so move it to the arch-specific
info, to reduce the size for other archs.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-26 14:05:37 -06:00
Tom Rini
7670200d4b Merge patch series "test/overlay: Make this depend on SANDBOX"
Tom Rini <trini@konsulko.com> says:

Update a few things so that CONFIG_UNIT_TEST will compile for more
hardware platforms.
2024-08-23 15:59:44 -06:00
Tom Rini
2191c11733 test/cmd: Move wget test to under a sandbox guard
This test is sandbox-centric, so guard it so.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-08-23 15:59:39 -06:00
Tom Rini
916a4704fc test/boot: Make BOOTSTD tests depend on UT_BOOTSTD
While we have a symbol for controlling if we will be testing BOOTSTD or
not, and it depends on SANDBOX, we do not control the building of
test/boot/ content correctly. Guard the current bootstd tests with
a check for UT_BOOTSTD and leave the measurement test available.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-08-23 15:59:39 -06:00
Tom Rini
636e07915f test/overlay: Make this depend on SANDBOX
As the overlays are sandbox specific, mark the whole test as depending
on sandbox.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-08-23 15:59:39 -06:00
Tom Rini
5948fd0ae7 Merge patch series "spl: mmc: Some tweaks for SPL, particularly with MMC"
Simon Glass <sjg@chromium.org> says:

This series includes various minor fixes and tweaks found when trying
to reduce the size of MMC code in SPL.
2024-08-23 15:59:03 -06:00
Simon Glass
d938743d15 blk: Correct comment for blk_get_devnum_by_uclass_idname()
Update the comment to match the function. Fix the indentation while we
are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:42 -06:00
Simon Glass
3fd11278ff spl: Create a function to init spl_load_info
Rather than having every caller set this up individually, create a
common init function. This allows new fields to be added without the
risk of them being left uninited.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
2024-08-23 15:58:42 -06:00
Simon Glass
50a1ed4335 spl: Use unified inline functions for spl_load_info
Rather than declaring completely separate functions, put the code for
each case into the same function. This makes it easier to read.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
2a00d73d08 spl: mmc: Try to clean up raw-mode options
Make the raw-mode options depend on SPL_SYS_MMCSD_RAW_MODE in a more
direct way. This makes it easier to understand the options with
'make menuconfig'.

There are three different ways of specifying the offset:

- sector offset
- partition number
- partition type

So make these a choice, so it is more obvious what is going on.

Update existing boards to enable SPL_SYS_MMCSD_RAW_MODE where needed.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-23 15:58:41 -06:00
Simon Glass
c5cb9e5489 spl: mmc: Adjust args of spl_mmc_find_device()
At present spl_mmc_load() is the only caller of this function, passing
it a boot_device, an index into the available MMC devices. Pass the
device number instead, since it is known by the caller and simplifies
the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
8a369de6ff spl: mmc: Handle error codes consistently
Use 'ret' as the return code, since it may not be an error and this is
the common name in U-Boot. Make sure to return the error code when
given, rather than transforming it into -1 (-EPERM).

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-23 15:58:41 -06:00
Simon Glass
1847129025 spl: mmc: Drop checks for CONFIG_SPL_LIBCOMMON_SUPPORT
This check is not needed now, since printf() resolved to nothing if not
available. Drop the #ifdefs

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
dfc0acd0cc log: Avoid including function names by default
Unless function names are requested, the logging system should not
compile these into the code. Adjust the macros to handle this.

This means that turning on function names at runtime won't work unless
CONFIG_LOGF_FUNC is enabled. We could perhaps split this into a
separate option if that is a problem.

Enable CONFIG_LOGF_FUNC logging for sandbox since the tests expect the
function names to be included. Fix up the pinmux test which checks a
logging statement.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
99b23d45cb mmc: Use logging instead of pr_err()
Use the log subsystem instead of dev, to avoid including function names
in the code.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Update 'enhanced size' to use hex since this is the U-Boot default and
more natural for the large numbers involved.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
3aa8c443b2 mmc: Use logging instead of printf()
The code makes quite a few uses of __func__ which puts the function
name into the resulting SPL image. Use the log subsystem instead, to
reduce size.

The CONFIG_LOGF_FUNC option can be used to enable the function name.

Use lower-case hex for the status output in sdhci_transfer_data(), to
match sdhci_send_command()

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
bf85af66c0 spl: Remove remaining #ifdef in spl_parse_image_header()
Define spl_set_header_raw_uboot() always so we can drop the last #ifdef
in this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
af4ff286ae spl: Remove some #ifdefs in spl_parse_image_header()
This function has a number of unnecessary #ifdefs so remove them.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
5f64c0c03a spl: Correct use of CMD_BOOTI and CMD_BOOTZ
These should have a CONFIG_ prefix. Add it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 7a0d88076b ("Add in the ability to load and boot an uncompr...")
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Simon Glass
001b3109da rockchip: Move the default timer init to a common file
Rather than repeating the same code in two files (SPL and TPL), move it
to a shared filed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-08-23 15:58:41 -06:00
Tom Rini
b8f0f8db23 Merge tag 'u-boot-imx-next-20240823' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22098

- Add BOOTAUX support for apalis and colibri imx8 boards.
- Cleanup tqma6 board by removing unneeded board code.
- Add support for booting from ecspi3 via bmode command on imx6.
- Add a script to ease updating flash.bin on imx8mm phytec board.
- Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC and
  use USB SDPS as fallback option.
- Fix critical temperature on imx9.
- Add Cortex M and bootaux support for phycore-imx8mp.
2024-08-23 15:00:29 -06:00
Marek Vasut
dda8444832 ARM: imx: Enable cat and xxd commands on Data Modul i.MX8M Mini/Plus eDM SBC
Enable 'cat' command to print file from filesystem to stdout.
Enable 'xxd' command to hexdump file from filesystem to stdout.

Signed-off-by: Marek Vasut <marex@denx.de>
2024-08-23 14:53:53 -03:00
Marek Vasut
2b9e9588d0 ARM: imx: Use USB SDPS as fallback option on Data Modul i.MX8M Plus eDM SBC
The Data Modul i.MX8M Plus eDM SBC does have USB gadget capable port
accessible via USB A-A cable plugged into the bottom USB 3.0 port.
Use USB SDPS as the fallback boot device, so USB SDPS loading can
be performed using e.g. uuu tool.

Signed-off-by: Marek Vasut <marex@denx.de>
2024-08-23 14:53:27 -03:00
Yashwanth Varakala
d037ef40e9 configs: phycore-imx8mp_defconfig: Enabled bootaux command
To start the mcore binary from u-boot, bootaux command is
needed.

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
2024-08-23 14:53:07 -03:00
Yashwanth Varakala
f0f5ab50c2 board: phytec: phycore_imx8mp: Add mcore support
Added m7 core support in uboot for imx8mp by adding
the boot variable prepare_mcore.

Based on commit 0ed32cc8568a ("LF-6555 imx8m[m/n/p/q]_evk: add
bootargs to support mcore")

Signed-off-by: Yashwanth Varakala <y.varakala@phytec.de>
2024-08-23 14:53:07 -03:00
Fabio Estevam
8ad6ac9fbd mx6: Expand bmode to support ecspi3 boot
Currently, the bmode command only supports booting from ecspi1.

Expand it to also support booting from ecspi3.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Acked-by: Peng Fan <peng.fan@nxp.com>
2024-08-23 14:50:15 -03:00
Fabio Estevam
d6173d0655 gw_ventana: Remove unneeded comments
Remove several comments that do not apply anymore to
the current file content.

While at it, write 'PMIC' into a single line for consistency.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2024-08-23 14:49:57 -03:00
Fabio Estevam
3c72b81200 tqma6_mba6: Remove UART board code
With DM_SERIAL in place, there is no need to setup the UART pins
in the board code.

The UART pins are setup via devicetree, thanks to DM.

Remove the unneeded code.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2024-08-23 14:49:44 -03:00
Fabio Estevam
2798e4a5b4 tqma6_mba6: Remove unused defines
The PAD_CTRL definitions are not used anywhere.

Remove them to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2024-08-23 14:49:44 -03:00
Fabio Estevam
93552cc442 tqma6: Remove non-DM board code
CONFIG_DM_MMC and CONFIG_DM_SPI are alway selected so the mmc
and spi board code can be safely removed.

Remove it to make the code cleaner.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2024-08-23 14:49:44 -03:00