When the console-record buffer overflows, show both the current buffer
size and the size needed. This helps the user know what value to set
for CONFIG_CONSOLE_RECORD_OUT_SIZE.
Add a console_out_ovf field to global_data to track the number of bytes
that could not be written due to overflow.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
The TrueType console driver calls malloc/free for every character
rendered, which causes significant memory fragmentation and allocation
traffic.
Add CONFIG_CONSOLE_TRUETYPE_GLYPH_BUF to enable a pre-allocated buffer
in the driver's private data. The buffer starts at 4KB and grows via
realloc() as needed. When rendering a glyph, use this buffer to avoid
malloc/free for normal characters.
The buffer is allocated lazily after relocation to avoid consuming
early malloc space before the full heap is available.
Add CONFIG_VIDEO_GLYPH_STATS (default y on sandbox) to track the number
of glyphs rendered. Use 'font info' to view the count.
Series-changes: 2
- Rename the Kconfig to just enable the feature: always allocate
Co-developed-by: Claude Opus 4 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
When the app is running under QEMU we may wish to do some things
differently. Add a flag for this and use the SMBIOS tables to detect it.
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
This is currently in asm-generic/u-boot.h but it is no-longer the
interface to U-Boot in any real sense. It also doesn't include assembler
so having it in asm-generic seems wrong.
Move it into its own header.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a new global_data flag GD_FLG_ULIB to indicate that U-Boot is being
used as a shared library. This allows suppressing console output that
is inappropriate for library usage while preserving normal boot messages
for standalone operation.
For now the flag must be enabled by the caller and it has no effect.
Signed-off-by: Simon Glass <sjg@chromium.org>
Show the actual value being used by the pager, if enabled.
Series-changes: 2
- Add new patch to show the pager page_len value
Signed-off-by: Simon Glass <sjg@chromium.org>
Send all console output via the pager. If it is disabled, it will do
nothing.
The pager is only supported if CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV are
enabled. This is the common case for more richly featured boards, i.e.
those that can cope with the extra code size of this feature.
Series-changes: 2
- Drop an unnecessary direct call to the pager
- Repeat the old code in console_puts_pager() to avoid 16-byte growth
Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Plumb in the ability for U-Boot proper to accept an incoming standard
passage from a previous phase, such as SPL or TF-A. This allows data to
be passed from binary to binary when firmware is booting.
Series-changes: 2
- Rebase to master
- Rework global_data for new stdpass convention
Series-changes: 3
- Move passage.h into this patch
- Add passage_valid() to decide if stdpass was provided
- Move arch_passage_entry() into this patch
- Make the global_data fields present only when needed
Signed-off-by: Simon Glass <sjg@chromium.org>
commit ddf67daac3 ("efi_capsule: Move signature from DTB to .rodata")
was reverted in
commit 47a25e81d3 ("Revert "efi_capsule: Move signature from DTB to .rodata"")
because that's what U-Boot was usually doing -- using the DT to store
configuration and data. Some of the discussions can be found here [0].
(Ab)using the device tree to store random data isn't ideal though.
On top of that with new features introduced over the years, keeping
the certificates in the DT has proven to be problematic.
One of the reasons is that platforms might send U-Boot a DTB
from the previous stage loader using a transfer list which won't contain
the signatures since other loaders are not aware of internal
U-Boot ABIs. On top of that QEMU creates the DTB on the fly, so adding
the capsule certificate there does not work and requires users to dump
it and re-create it injecting the public keys.
Now that we have proper memory permissions for arm64, move the certificate
to .rodata and read it from there.
[0] https://lore.kernel.org/u-boot/CAPnjgZ2uM=n8Qo-a=DUkx5VW5Bzp5Xy8=Wgmrw8ESqUBK00YJQ@mail.gmail.com/
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Jonathan Humphreys <j-humphreys@ti.com> # on TI sk-am62p-lp
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-A311D-CC
Tested-by: Raymond Mao <raymond.mao@linaro.org>
It is confusing to have a camel-case indentifier in the these files.
Rename them to fit with U-Boot's snake-case style.
The image_base symbol is already used in the x86 link-scripts.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rename the C and header files to use the membuf basename, to match the
functions.
Add a MAINTAINERS entry while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a linker symbol which can be used to mark relocation code, so it can
be collected by the linker and copied into a suitable place and executed
when needed.
Signed-off-by: Simon Glass <sjg@chromium.org>
While we do plan to switch to OF_SEPARATE now it is supported, it seems
worth at least showing how OF_EMBED could be used instead, just for the
record.
So make the Makefile rule conditional on OF_SEPARATE and adjust fdtdec
to avoid a build error when OF_EMBED is used.
Finally. the dtb symbol has a double underscore, so update it to avoid a
build warning.
With future patches, OF_EMBED will no-longer be used with the EFI app,
so it is expected that it will eventually stop working.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 2e7bf25f6b ("Support separate DTB files with the UEFI app")
The UEFI app is an actual executable with things like section headers,
so just gluing the DTB onto the end of it won't work. Add an additional
section to contain this and allocate some space, and then during build
copy the DTB into that section.
Signed-off-by: Matthew Garrett <mgarrett@aurora.tech>
Reviewed-by: Simon Glass <sjg@chromium.org>
This breaks chromebook_coral which says:
Video: No video mode configured in FSP!
This reverts commit 2e9313179a.
Signed-off-by: Simon Glass <sjg@chromium.org>
These fields are currently set on exactly two platforms today, and used
by only one of them. Update pic32mzdask to use CFG_SYS_SRAM* in the one
location it needs it and otherwise drop this field from the bd_info
struct.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tests which create a new bloblist overwrite the existing one in sandbox.
Provide a flag for tests to declare this behaviour. Save and restore the
bloblist pointer so that other tests remain unaffected.
Note that when sandbox is running normally, the bloblist has been
relocated to high in memory. The existing bloblist tests create a new
bloblist low in memory, so they do not conflict.
Correct a build error on coreboot by using accessors for gd->bloblist:
Signed-off-by: Simon Glass <sjg@chromium.org>
Nothing in cyclic.h is needed to define struct global_data, so do not
include that header.
If any .c file relies on getting cyclic.h through asm/global_data.h,
it needs to include it itself.
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
If the environment is not enabled we don't need these fields in
global_data. Make them conditional.
Make these fields conditional. Move env_buf up one so it can share
an #ifdef.
Signed-off-by: Simon Glass <sjg@chromium.org>
The early malloc region is normally quite small and is certainly less
than 4GB, so use a 32-bit value for the limit and pointer. Update the
comments for clarity while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Some of the logging fields are larger than they need to be. Shrink them
and adjust the ordering to improve alignment.
Signed-off-by: Simon Glass <sjg@chromium.org>
This is the length of the U-Boot binary, which is typically 200-800KB
and certainly not larger than 4GB. Use a 32-bit value to save space in
global_data and move it up to be with fields of the same alignment.
Signed-off-by: Simon Glass <sjg@chromium.org>
The bus clock and memory clock are unlikely to go above 4GHz for now, so
reduce the field size to 32 bits.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move all the fields which are always present to the top of the struct,
so we can potentially save some space by taking note of alignment.
Signed-off-by: Simon Glass <sjg@chromium.org>
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>
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>
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>
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>
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>
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>
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>
Specify the FIT and include information about each loaded image, as
required by the UPL handoff.
Write the UPL handoff into the bloblist before jumping to the next phase.
Control this using a runtime flag to avoid conflicting with other
handoff mechanisms.
Signed-off-by: Simon Glass <sjg@chromium.org>
Add a 'upl' command to work with Universal Payload features. For now it
only supports reading and writing a handoff structure.
Signed-off-by: Simon Glass <sjg@chromium.org>
The cyclic subsystem is currently enabled either in all build phases
or none. For tools this should not be enabled, but since lib/shc256.c
and other files include watchdog.h in the host build, we must make
sure that it is not enabled there.
Add an SPL symbol so that there is more control of this.
Add an include into cyclic.h so that tools can include this file.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Reviewed-by: Stefan Roese <sr@denx.de>