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