28 Commits

Author SHA1 Message Date
Simon Glass
5ead77edd5 boot: Update pxe_getfile_func() to support reservation
In some cases we don't have a particular address to read into so would
like one reserved. Adjust this function to support that.

For now, sysbot_read_file() fails if the address is not provided. This
will be resolved in a later patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-09 12:04:30 -06:00
Simon Glass
c545f0762b boot: Update bootmeth read_file() to support reservation
In some cases we don't have a particular address to read into so would
like one reserved. Adjust the read_file() method to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-09 12:04:29 -06:00
Simon Glass
53b02e1015 boot: Support restarting a bootm sequence from PXE
If a load-only FIT has already provided a devicetree, PXE boot may need
to restart the bootm sequence, rather than starting an entirely new one,
so that the devicetree is preserved and used for booting.

Add support for this by adding a new field in the context and updating
extlinux_boot() to receive the value as a new parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
684fc8c4d7 Revert "Merge branch 'loadg' into 'master'"
This reverts merge request !141
2025-08-02 19:50:30 +00:00
Simon Glass
87c3760161 boot: Support restarting a bootm sequence from PXE
If a load-only FIT has already provided a devicetree, PXE boot may need
to restart the bootm sequence, rather than starting an entirely new one,
so that the devicetree is preserved and used for booting.

Add support for this by adding a new field in the context and updating
extlinux_boot() to receive the value as a new parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-02 12:29:35 -06:00
Simon Glass
8a698cf850 fs: Rename fs.h to fs_legacy.h
A new filesystem interface is coming, so rename the current header to
indicate that it is the old one.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-06-28 07:53:25 -06:00
Simon Glass
2283ab0538 bootstd: Update extlinux and pxe to allow boot interruption
It is useful to be able to inspect things before the OS is actually
booted, perhaps to check that all is well or to adjust the kernel
command-line. Implement the 'read_all()' method to allow this.

Provide a simple test to check that the images are found.

For now it is not possible to actually continue the uninterrupted boot,
without re-reading all the images.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
2d7ae1a1b5 bootmeth_extlinux: Move boot code into common file
The extlinux and PXE code for booting is almost the same. Move it into
the common file so it is easier to keep it in sync.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
c4ec5afb7b bootmeth_pxe: Drop the driver-private data
Since this driver's plat-data already contains a PXE context, use that.
Drop the priv-data. Use the extlinux_info which is in there, as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
178bfbad7f bootmeth_pxe: Implement the fallback option
Provide this feature in PXE, so that it matches extlinux. Use plat data
for this, just like extlinux.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
35dea9df30 pxe: Record the bootflow in the PXE context
At present the only option with PXE is to boot it and see what happens.

Provide a bootflow, when available, so that PXE will eventually be able
to add some useful information to it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
70d37cbab9 pxe: Drop the cmdline parameter
Now that PXE can operate without the command line, drop the parameter
throughout the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
c4da3552b2 boot: Avoid using the cmdline in bootmeth_pxe and pxe cmd
Use the new netboot_run() function to avoid building a command line,
when running these network operations.

For the one board which uses lwip, it is not quite clear how to avoid
using the cmdline interface, so produce an error, for now. This can be
figured out later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-19 05:55:32 -07:00
Simon Glass
74a1478900 boot: Update pxe bootmeth to record images
Record images loaded by this bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-05 11:00:23 -07:00
Simon Glass
b67f66ed57 boot: Update extlinux pxe_getfile_func() to include type
Add a file-type parameter to this function and update all users. Add a
proper comment to the function which we are here.

This will allow tracking of the file types loaded by the extlinux
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-12-05 11:00:22 -07:00
Simon Glass
114dd14e38 bootmeth: Update the read_file() method to include a type
We want to record the type of each file which is loaded. Add an new
parameter for this, to the read_file() method. Update all users.

Make bootmeth_common_read_file() store information about the image that
is read.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-12-05 11:00:22 -07:00
Martyn Welch
8ba82a91b3 boot: Add logic to enable booting from fallback option
The "fallback" extlinux config option allows us to set an alternative
default boot option for when it has been detected that the default is
failing. Implement the logic required to boot from this option when
desired.

Signed-off-by: Martyn Welch <martyn.welch@collabora.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-10-15 10:24:27 -06:00
Tom Rini
03de305ec4 Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"
As part of bringing the master branch back in to next, we need to allow
for all of these changes to exist here.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-20 13:35:03 -06:00
Tom Rini
d678a59d2d Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d, reversing
changes made to 2ee6f3a5f7.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19 08:16:36 -06:00
Tom Rini
c4b646d436 boot: Remove <common.h> and add needed includes
Remove <common.h> from all "boot/" files and when needed add
missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06 15:05:04 -06:00
Heinrich Schuchardt
08c51a715a boot: correct the default sequence of boot methods
The default sequence of boot methods is determined by alphabetical sorting
during linkage.

* efi_mgr must run before efi to be UEFI compliant
* pxe should run as last resort

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-04-08 13:03:40 +02:00
Simon Glass
11158aef89 bootstd: Init the size before reading extlinux file
The implementation in extlinux_pxe_getfile() does not pass a valid size
to bootmeth_read_file(), so this can fail if the uninited value happens to
be too small.

Fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-03 15:30:54 -04:00
Simon Glass
79f663515a bootstd: Rename distro and syslinux to extlinux
We use the terms 'distro' to mean extlinux but they are not really the
same. 'Distro' could refer to any method of booting a distribution,
whereas extlinux is a particular method.

Also we sometimes use syslinux, but it is better to use the same term in
all cases.

Rename distro to syslinux and also update bootstd uses of syslinux to use
extlinux instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-05-13 09:52:32 -04:00
Sean Edmond
7d0188927b net: dhcp6: pxe: Add DHCP/PXE commands for IPv6
Adds commands to support DHCP and PXE with IPv6.

New configs added:
- CMD_DHCP6
- DHCP6_PXE_CLIENTARCH
- DHCP6_PXE_DHCP_OPTION
- DHCP6_ENTERPRISE_ID

New commands added (when IPv6 is enabled):
- dhcp6
- pxe get -ipv6
- pxe boot -ipv6

Signed-off-by: Sean Edmond <seanedmond@microsoft.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2023-05-05 17:48:44 -04:00
Simon Glass
d9f48579dc bootstd: Treat DHCP and PXE as bootdev labels
These are associated with the ethernet boot device but do not match its
uclass name, so handle them as special cases.

Provide a way to pass flags through with the bootdev so that we know
how to process it. The flags are checked by the bootmeths, to ensure that
only the selected bootmeth is used.

While these both use the network device, they work quite differently. It
is common to run only one of these, or to run PXE before DHCP. Provide
bootflow flags to control which methods are used. Check these in the two
bootmeths so that only the chosen one is used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:41 -05:00
Simon Glass
865328c314 bootstd: Rename bootdev checkers
These functions return 0 if the check passes, so the names are somewhat
confusing. Rename them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-01-23 18:11:40 -05:00
Dario Binacchi
c2ee5ee7b3 Rename disto_[pxe_]getfile to distro_[pxe_]getfile
Replace 'disto' with 'distro' since they are all functions about distro
booting.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
2022-08-26 16:33:48 -06:00
Simon Glass
dab2c2859b bootstd: Add an implementation of distro PXE boot
Add a bootmeth driver which handles distro boot from a network device, so
we can boot a bootflow using this commonly used mechanism.

In effect, this provides the same functionality as the 'pxe' command
and shares the same code. But the interface into it is via a bootmeth.

For now this requires the 'pxe' command be enabled. Future work may tidy
this up so that it can be used without CONFIG_CMDLINE being enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2022-04-25 10:00:04 -04:00