Commit Graph

31 Commits (587d588fe4ccc1587a2ad189863aeb82a41e7252)

Author SHA1 Message Date
Leah Rowe 02e66ae01a U-Boot x86: Avoid clearing the VESA display
This is a patch from Simon Glass. U-Boot clears the display
when it starts up, but was asking the VESA driver to do the
same, needlessly; this patch avoids the latter.

A further patch is also included, which provides a better
message when jumping into long mode on the SPL (64-bit) target,
dumping it on the serial console instead of using printf.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-20 15:44:35 +00:00
Leah Rowe b549d1e5f3 u-boot x86 serial/ns16550: disable UART as needed
U-Boot was hanging on hardware, but not Qemu. This is because on
the machines tested, namely the X200 and E6230 laptops supported
in Libreboot, the UART was disabled from coreboot.

This U-Boot patch from Simon Glass works around the issue by
silently disabling the UART when it isn't there. Instead,
output is sent to the display and U-Boot no longer hangs.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-19 22:46:29 +00:00
Leah Rowe 6d629a8496 Update x86 U-Boot to v2024.10 (was v2024.07)
It's a new experimental payload in Libreboot, so we may aswell
start with the very latest release of U-Boot.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-19 09:52:40 +00:00
Leah Rowe 747b6514ea Add U-Boot x86_64 payload
Currently seems to stall when booted from the GRUB
payload, but works when booted from the SeaBIOS menu.

I also tested it as a standalone payload and it seems
to boot. Will test on hardware next, and start adding
it to more mainboards.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-19 02:04:50 +00:00
Leah Rowe c0017c7357 Experimental U-Boot payload (32-bit dtb, U-Boot)
NOTE: Support added for xarch target x86_64-elf,
but U-Boot failed to build with this error:

OBJCOPY lib/efi_loader/helloworld.efi
x86_64-elf-objcopy: lib/efi_loader/helloworld_efi.so: invalid bfd target
make[2]: *** [scripts/Makefile.lib:476: lib/efi_loader/helloworld.efi] Error 1

Since I'm building U-Boot for x86_64 *on* an x86-64
host, and since that is currently the recommended type
of machine to use for lbmk development, and since the
other x86 payloads currently don't cross compile anyway,
this is an acceptable compromise for now. This is because
at present, I'm not making U-Boot the primary payload on x86,
instead preferring to chain it from GRUB and SeaBIOS.

The target.cfg file for x86 u-boot shows xarch/xtree commented.
Uncomment these to compile on crossgcc instead of hostcc.

I mention 64-bit because I initially did this first, but decided
to do 32-bit first. I'll work on the 64-bit one next (SPL).

It's only enabled in QEMU for now.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-11-03 09:22:52 +00:00
Alper Nebi Yasak 708fc14c60 u-boot: Fix display initialization on gru boards
U-Boot has migrated to using upstream device-tree files for gru boards,
but the clock driver doesn't yet support setting rates for a certain
clock that upstream uses for the eDP display. It happens to work without
it, so for now remove the clock setting until the driver is fixed.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-11 23:16:42 +03:00
Alper Nebi Yasak 0cc7736b40 u-boot: Avoid breaking build for U-Boot-only binman images
Commit 46e01c0e1d ("u-boot: Avoid building U-Boot-only binman images")
added a patch that prevents an error while building U-Boot, due to some
U-Boot images needing a copy of BL31 that we are not passing in.

Removing build instructions for these images isn't really necessary,
when we can instead tell the build tool that it shouldn't exit with an
error. It checks a BINMAN_ALLOW_MISSING environment variable for this,
but just unconditionally replace the check with the argument.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-11 22:40:33 +03:00
Alper Nebi Yasak 2ecec55af7 u-boot: Update to v2024.07
Set default U-Boot revision to v2024.07 and rebase patches on top of
that. One patch that fixes drawing box characters (UTF-8 to CP437) had
an alternative merged, another hack we have to fix regulator issues is
no longer neccessary as the issue is fixed, and my QEMU patches were
merged upstream, so drop these patches. One patch we have to disable
binman images can be replaced by a simpler alternative so drop it too.

Upstream kconfig status is still unstable, so updating configs with
`make oldconfig` would miss important upstream changes, since they rely
on carrying defaults via upstream defconfigs. Update the configs as
such, like before:

- Turn old configs into defconfigs (./update trees -s u-boot)
- Save the diff from old upstream defconfig (diffconfig $theirs $ours)
- Update U-Boot revision, rebase patches, and clean old trees
- Prepare new U-Boot tree (./update trees -f u-boot)
- Review the diffconfigs to see if any options were renamed upstream
- Copy over the new upstream defconfigs and apply earlier diff
- Turn new defconfigs into configs (./update trees -l u-boot)

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2024-07-11 22:29:58 +03:00
Leah Rowe ba36f26d62 handle build.list from config/data/, not config/
certain code checks for build.list, to skip it, for
example in items()

we already use config/data/grub to store grub config data
that applied to all trees

create these directories too:

config/data/coreboot
config/data/u-boot
config/data/seabios

move the respective build.list files in here, and also
to config/data/grub

now multi-tree projects contain, per directory, just the
target.cfg file and the patches directory. this is much
cleaner, because some of the logic can be simplified more

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-06 02:35:36 +01:00
Leah Rowe 9daf7f05f1 u-boot on qemu: remove currently unused x86 target
it doesn't build, at present, but isn't used by any
coreboot targets, so the build issue does not come up
during release builds, but i did find it laying around
during my audits.

x86 qemu is on todo for libreboot, on all x86 boards,
but the current config is broken, so: remove it.

it's very much a requirement that anything in lbmk should
work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-01 22:55:19 +01:00
Leah Rowe 13d4b6d3c7 delete u-boot test/lib/strlcat.c using nuke()
we don't need to do it in the release function

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-30 07:37:19 +01:00
Leah Rowe 8a9c70f2f6 allow multitree projects to define xgcc tree
let them specific it, rather than falling back
to coreboot/default (can also be used for coreboot boards)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-21 05:59:37 +00:00
Leah Rowe c6d243af93 u-boot: don't define xarch in default
it's only needed for each board

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-01-21 05:55:54 +00:00
Leah Rowe eff9130b7a update/trees: further simplify crossgcc handling
arch no longer needs to be set, on multi-tree projects,
and it has been renamed to xarch

the new behaviour is: if xarch is set, treat it as a
list of crossgcc targets and go through the list. set
the first one as the target, for what lbmk builds, but
build all of the defined crossgccc targets

crossgcc_ada is now xlang, and defines which languages
to build, rather than whether to build gcc-gnat

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-27 16:07:32 +00:00
Leah Rowe 90ac30b163 update/trees: simplified crossgcc handling
only call crossgcc for coreboot and u-boot, but use
hostcc for everything else. simplify the checking of
which architecture to compile for. "arch" in target.cfg
files has been modified, to allow further simplification.

without this patch, the logic currently only *barely* avoids
using crossgcc on things like utils, and only works in practise
because, in practise, lbmk only works on x86_64 anyway.

the new logic, as per this patch, is simpler and more robust.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-21 14:18:51 +00:00
Leah Rowe f1785c3f43 Merge pull request 'u-boot: Add qemu_x86_12mb build again' (#143) from alpernebbi/lbmk:uboot-qemu-x86 into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/143
2023-10-23 22:42:35 +00:00
Alper Nebi Yasak 03c830b2e9 u-boot: Add qemu_x86_12mb build again
Add a U-Boot build for the qemu_x86_12mb board. The config is a copy of
the upstream "coreboot" defconfig, but with OF_EMBED=y.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-23 20:15:19 +03:00
Alper Nebi Yasak 444f2899e6 u-boot: qemu_arm64_12mb: Enable video console
Add my upstream U-Boot series enabling video console support by default
for QEMU ARM virtual machines. Similarly, enable the related config
options for our builds using savedefconfig and olddefconfig.

The resulting ROM can be booted with a command line like:

    qemu-system-aarch64 \
        -machine virt,secure=on,virtualization=on \
        -cpu cortex-a72 -m 1G \
        -serial stdio -device VGA \
        -device qemu-xhci \
        -device usb-kbd -device usb-mouse \
        -bios bin/qemu_arm64_12mb/*.rom

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-23 19:18:14 +03:00
Alper Nebi Yasak 6e65595da5 u-boot: gru: Do not persist EFI variables
By default U-Boot stores EFI variables in a ubootefi.var file in
whatever EFI System Partition it finds, which would be a FAT filesystem.
I'm occasionally finding out while testing that my ESPs somehow end up
with a corrupted filesystem, and I'm suspecting it's this.

For now, disable storing EFI environment variables on disk so that
U-Boot doesn't try to manipulate the filesystem.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 4e7e476191 u-boot: gru: Enable more EFI commands
Enable U-Boot commands to manipulate EFI environment storage, to
self-test EFI implementation, and to run a basic EFI test application.
These are so that we can test and debug EFI functionality easier.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f08102a227 u-boot: gru: Enable more bootstd features
U-Boot upstream is switching to a new code framework for discovering and
booting OSes ("Standard Boot", or "bootstd"). Enable more features for
it, including commands we can use for introspection and debugging.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak fea0cec24a u-boot: gru: Do not reset on panic
Normally U-Boot immediately resets the board on a panic. I had run into
"Synchronous Abort"s from shim and rEFInd, and having a traceback in
those cases can be useful. Hang instead of resetting, so the panic
reason stays on the screen.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f9bad4449a u-boot: gru: Enable poweroff command
We should be able to power the board off from U-Boot command line.
Enable the "poweroff" command for gru boards so we can.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f7db91c848 u-boot: gru: Disable VIDEO_COPY
U-Boot can keep a "copy" framebuffer to read from, for devices where
reading from hardware framebuffer is expensive. This needs the video
driver to support it. The Rockchip video driver doesn't need or support
it, so this option does nothing on gru boards. Disable it.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 7afe2f3918 u-boot: Set EFI variable buffer size to upstream value
U-Boot upstream used to have 16KB for EFI variables, and this was
causing problems with shim. Commit f0236acbc6 ("u-boot: Increase EFI
variable buffer size") fixed this by raising it to 32KB in our builds.
It has now been raised to 64K upstream, so raise it here as well.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 46e01c0e1d u-boot: Avoid building U-Boot-only binman images
For Rockchip boards U-Boot tries to build SPI and MMC images that
require an externally built BL31 file to be provided, and the build
fails otherwise. This is not really as configurable as it should be.

In Libreboot, we only care about the build outputs for U-Boot proper.
There is a BL31 built during our coreboot builds, but using that in
U-Boot builds is a chicken-and-egg problem. Building BL31 outside the
coreboot build and passing it to both projects is possible, but needs
work.

For now, stop trying to build these U-Boot-only images as a workaround,
by removing the binman image descriptions from the device-tree sources.
Additionally, disable in our configs the BINMAN_FDT functionality that
allows using these at runtime as it requires them to be present.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 5b4ced3329 u-boot: Add patch to avoid regulator errors
U-Boot upstream has added a reference counting for regulator enable
actions which somehow makes gru-kevin unbootable. Add a workaround
that makes it work again.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak f459e05ecd u-boot: Update to v2023.10
Set default U-Boot revision to v2023.01 and rebase patches on top of
that. Another series about 16x32 fonts was merged upstream, so drop some
now-unnecessary patches we had for that. For the video damage tracking
series, switch to the version I'm trying to upstream.

Upstream kconfig status is a bit unstable, so updating configs with
`make oldconfig` would miss important upstream changes, since they rely
on carrying defaults via upstream defconfigs. Update the configs as
such:

- Turn old configs into defconfigs (./update project trees -s u-boot)
- Save the diff from old upstream defconfig (diffconfig $theirs $ours)
- Update U-Boot revision, rebase patches, and clean old trees
- Prepare new U-Boot tree (./update project trees -f u-boot)
- Review the diffconfigs to see if any options were renamed upstream
- Copy over the new upstream defconfigs and apply earlier diff
- Turn new defconfigs into configs (./update project trees -l u-boot)

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak 8b411963b7 u-boot: qemu_arm64_12mb: Remove misleading rev field
The U-Boot build for qemu_arm64_12mb board refers to a code revision
whereas it uses the common "default" tree, remove the bad reference.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Alper Nebi Yasak eb267733fa build/fw/coreboot: Fix misuse of raw u-boot.bin as payload
The "u-boot.bin" file generated by U-Boot builds is a raw binary. When
adding payloads to a CBFS, we need to use ELF files with add-payload
or manually pass the entry point and load address of the payload binary
with add-flat-binary.

We primarily use the "u-boot.elf" which gets build with the REMAKE_ELF
option, as it also has the necessary device-tree binary that U-Boot
usually needs to work. When the option is not set (e.g. for QEMU), we
need to use the "u-boot" file which is an ELF.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2023-10-14 16:48:41 +03:00
Leah Rowe da3c9bb3c5 merge config/ and resources/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-09-04 02:47:25 +01:00