Commit Graph

98830 Commits

Author SHA1 Message Date
Simon Glass
22f87ef530 malloc: Avoid defining calloc()
The C runtime calls malloc() before starting main(), e.g. to get some
memory to use for dynamic linking.

If CONFIG_TPL_SYS_MALLOC_SIMPLE is enabled, the calloc() symbol is
defined within U-Boot. The C runtime may call that too.

Use the same #define technique as for malloc_simple(), to fix a crash
on my machine when running:

   /tmp/b/sandbox_vpl/tpl/u-boot-tpl -D

This does not happen in CI, perhaps because the C runtime uses malloc()
instead of calloc().

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
9d449d63ed lwip: Fix some unicode warnings from pytest
Fix various warnings of the form:

   Skipping file '[..]/lib/lwip/lwip/contrib/ports/unix/posixlib/
      include/posix/inet.h' due to unicode error

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
5e8b30cd4c patman: Handle invalid characters in patch files
In some cases latin1 encoding may be used in source files. If
'high-ascii' are used, patman may report an error:

   UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf3 in
      position 1051: invalid continuation byte

Fix this by replacing these characters. This may cause the patch to fail
to apply, but at least it can be checked.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:19 -06:00
Simon Glass
f387937b46 patman: Drop hard-coded patchwork server
Since there is now a new server at patchwork.u-boot.org allow using this
if selected in the ~/.patman file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-20 07:41:17 -06:00
Simon Glass
5659b7adcb Merge branch 'loadp2' into 'master'
efi: Improvements for the EFI app on ARM

See merge request u-boot/u-boot!156
2025-08-20 00:09:19 +00:00
Simon Glass
3a4d62c254 efi: app: Enable the cat command
This can be handy for looking at extlinux.conf files, so enable it for
the app.

Series-to: concept
Series-version: 2
Cover-letter:
efi: Improvements for the EFI app on ARM
This series provides a number of minor improvements for the EFI app when
running on ARM machines (on top of Tianocore, for example):

- Tidy up various comments
- Show the ARM exception level in bdinfo
- Tidy up the output of 'meminfo'
- Get the addr_find command running
- Reduce verbosity when not debugging
- Show the model at the top of the diplay when using vidconsole
- Allow faking the boot right into the actual OS jump (for debugging)
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
d91a019a49 efi: app: Show the model when the vidconsole starts
When running with a vidconsole we only see the prompt at the top of
the display. Set the option to show the model as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
ef42f4eb92 efi: arm: Increase the cyclic timeout again
The video sync sometimes takes 20ms on this board when running under
emulation, so increase the limit to 50ms.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
c0e80e8d76 efi: app: Add a simplefb node to the devicetree
Use simplefb on ARM devices so that we see a console earlier, assuming
that 'console=tty0' is passed to Linux.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
a1f2aa6d5f efi: app: Only show the memory map when debugging
This is quite a long dump and is only useful when debugging. Show it
only if LOG_DEBUG is defined in this file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
043c879dd1 efi: app: Use the relocated global_data
The new global_data is set up by the app but it never uses it. Switch to
the new value after board_init_f(), so that the output of the 'meminfo'
command is more contiguous.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
70139c8226 efi: app: Print the final message before freeing memory
Printing may make use of tables which could go away when freed, so do
the free as the last thing before exiting the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
9bb839094e efi: app: Use EFI_PAGE_SHIFT instead of 12 in free_memory()
Use the constant intended for this purpose, instead of open-coding the
value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
6428b7ffd8 efi: app: Pick up the SMBIOS table
If an SMBIOS table is available, pick it up so that it can be parsed, or
examined with the 'smbios' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
f7c25b1735 efi: app: Allocate pages in any region
Rather than immediately falling back to the pool allocator when we
cannot get enough memory below 4GB, try the page allocator first. This
provides 4K-aligned memory, which is nicer to look at when debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
968ee73c16 efi: app: Tidy up some stale comments in setup_memory()
A few comments are out of date. Drop the one about global_data_ptr and
reword the one about memory above 4GB.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
6cbd0a844c efi: Fix up the addr_find command
This command was written before the lmb unification, so does not
currently build. Tidy it up and enable it for the EFI app, by default.

Also allow it to search any partition, not just a FAT one, since we may
have the kernel on ext4

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
50ac26d13c efi: app: Show only a summary of disks and partitions
The EFI app shows a list of every disk and partition it can find. On
Qualcomm x1e laptops this can fill the screen. The information is not
that useful, so just show a summary.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
4e0efad3c5 fdt: Add debugging for fdt_simplefb
Add some simple debug output to see what it is doing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
ddb78711fd boot: Pass flags to the bootm_final event
For a fake go, we should tell the event not to actually do anything
irreversable, so pass the flag along.

Move the enum into a separate event_decl.h header file since otherwise
we must include bootm.h which causes a breakage with qemu-ppce500

We also don't want to pull event.h into the tools build, since it uses
types like u8 which are not available outside U-Boot

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
cc6a9fe314 boot: Improve debugging in bootm_load_os()
This shows an image type as an OS, which is not correct. Fix it up to
show both.

Series-changes: 2
- Add a colon so it is clear that 'load_os type' is not a compound term

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
1058763883 event: Add a dummy function for event_notify()
When CONFIG_EVENT is disabled, we should not try to send an event. This
is already handled for events without parameters, so handle it for
events that do have parameters, too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
f6acb6e003 meminfo: Allow for up to 10 hex digits
On platforms where most of the memory is above 4GB, the EFI app may find
itself using addresses with 9 or even 10 digits. Expand the width of the
columns to cope with this.

Add some double bars across digits 9 and 8 so that it is easier to make
the value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
f1f8a0c61b arm: Drop kernel_entry for arm64
This variable is tricky to set up and is only used to show an address.
Drop it and use the source variable instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
2a4621c6e4 arm: Show the exception level with bdinfo
Some machines start U-Boot in a different exception level, so provide a
way to view it.

Series-changes: 2
- Use the existing current_el() function

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:44 -06:00
Simon Glass
9da0efb722 arm: Fix swtiching typo
This should say 'switching', so fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2025-08-19 17:36:43 -06:00
Simon Glass
81113babfc arm: bootm: Add some debugging
Provides some debugging info while doing bootm processing.

Series-changes: 2
- Make the messages longer and more explanatory

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-19 17:36:43 -06:00
Simon Glass
083a355fa2 Merge branch 'loado2' into 'master'
smbios: Refactor the smbios command and parser

See merge request u-boot/u-boot!155
2025-08-19 21:28:37 +00:00
Simon Glass
12f3fc10fd smbios: Add support for showing table types 16 and 19
In some cases it is useful to find out the location of physical memory,
e.g. so that the memory@ nodes can be correctly set up in the
devicetree. Add support for parsing this information from the SMBIOS
tables.

Series-to: concept
Series-cc: heinrich
Series-version: 2
Cover-letter:
smbios: Refactor the smbios command and parser
The 'smbios' command has its own code for parsing SMBIOS tables. There
in also lib/smbios-parser.c which parses tables, although only
version 2.

This series moved parsing to lib/ and rationalises the code a little. It
also adds support for a few more tables.

Finally, a hook is added so operation from coreboot can be tested on
ellesmere.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:19 -06:00
Simon Glass
a68c0625aa smbios: coreboot: Update smbios_get_header() to use smbios_info
Use the smbios_info struct in this function, so it can deal with any
version of SMBIOS table.

Also update smbios_update_version_full() to work the same way.

Drop find_next_header() which is now unused.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:19 -06:00
Simon Glass
8de843271f smbios: Pass smbios_info to smbios_next_table()
At present smbios_next_table() does not support SMBIOS v2 tables. Pass
in the info struct so that it can check for the end of the tables.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:19 -06:00
Simon Glass
40453163c8 smbios: Create a function to locate the tables
The code in the smbios command is a nice implementation of finding the
tables. It supports both SMBIOS2 and SMBIOS3, which smbios-parser.c does
not.

Move this code over to the library, creating a struct to hold the
result.

Series-changes: 2
- Fix the return values on error

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 14:00:17 -06:00
Simon Glass
0ee25282d8 smbios: Move some parsing code to smbios-parser.c
The 'smbios' command has some parsing code, as does the SMBIOS parser
in the lib/ directory. Start to unify these by moving over a few
functions.

Require CONFIG_SMBIOS_PARSER to be enabled when using the command.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
843c10a93e smbios: Rename smbios_header()
This function has the same name as the struct, which is confusing.
Rename it to smbios_get_header() and update the function comment a
little.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
aaf1ab294c smbios: x86: Enable command by default
If SMBIOS is enabled on x86, enable the 'smbios' command by default,
so that the tables can be examined.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
6f8274ed68 coreboot: Increase the cyclic limit
This fails in CI sometimes, so increase the limit to 50ms:

 cyclic_run() cyclic function video_init took too long: 20725us vs 5000us max

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
878b4a0842 hooks: Add ellesmere riscv64_spl board
Add a symlink for this board to the travis-ci board.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
b7fe69a08f hooks: ellesmere: Add a coreboot board
Add a coreboot board which can run under QEMU on ellesmere.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-18 13:56:05 -06:00
Simon Glass
711a77d573 Merge branch 'makeb' into 'master'
test: Split up the image-creation code

See merge request u-boot/u-boot!154
2025-08-17 22:22:35 +00:00
Simon Glass
b351843588 test: Move localboot image-creation to its own file
Move setup_localboot_image() to a new module

Series-to: concept
Cover-letter:
test: Split up the image-creation code
This series moves the image-creation code into separate files so it is
easier to find and maintain.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
91d376de6e test: Move the configuration-editor setup to its own file
Move setup_cedit_file() to its own module.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
8270d6d201 test: Move EFI image-creation to its own file
Move setup_efi_image() to its own module.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
b20c043f8b test: Move Android image-creation to its own file
Move setup_android_image() function to its own module.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
c1d531e19c test: Move ChromeOS image-creation to its own file
Move setup_cros_image() to its own module. This function creates disk
images with a ChromiumOS partition layout.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
6543dc4540 test: Move Armbian image-creation to its own file
Move setup_bootmenu_image() to its own module. This function creates an
image styled on Armbian 22.08 Jammy with a boot menu.

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
0d29222435 test: Move Ubuntu image-creation to its own file
Move setup_ubuntu_image() to its own module.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
b3596d6474 test: Move Fedora image-creation to its own file
Move setup_fedora_image() to its own module.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
ceb47ebdd4 test: Create a common file for image utilities
Move mkdir_cond(), copy_partition(), and setup_extlinux_image() to a
common module which can be used by the rest of the image-creation code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:32:25 -06:00
Simon Glass
dfa072fd07 test: Move image creation to test/py/img
Rather than having this code mixed with the tests, it seems better to
put it up one level. Move the directory and tidy up references.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-17 15:32:25 -06:00
Simon Glass
244f7436ce Merge branch 'maked' into 'master'
sandbox: Fix memory corruption around 1MB

See merge request u-boot/u-boot!153
2025-08-17 21:14:40 +00:00