History log of /u-boot/boot/bootmeth-uclass.c
Revision Date Author Comments
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

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 c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

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 c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

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>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c279224e 10-Aug-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a command to read all files for a bootflow

Some bootflows (such as EFI and ChromiumOS) delay reading the kernel until
it is needed to boot. This saves time when scanning and avoids needing to
allocate memory for something that may never be used.

To permit reading of these files, add a new 'bootflow read' command.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 0c0c82b5 26-Jul-2023 Simon Glass <sjg@chromium.org>

bootflow: Export setup_fs()

This function is used in some bootmeth implementations. Export it.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 2270c363 12-Jul-2023 Simon Glass <sjg@chromium.org>

bootstd: Correct baudrate typo

This is a copy error. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# de7b5a8a 01-Jun-2023 Simon Glass <sjg@chromium.org>

fs: Create functions to load and allocate a file

This functionality current sits in bootstd, but it is more generally
useful. Add a function to load a file into memory, allocating it as
needed. Adjust bootstd to use this version.

Note: Tests are added in the subsequent patch which converts the 'cat'
command to use this function.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c8894348 10-May-2023 Simon Glass <sjg@chromium.org>

bootstd: Tidy up reporting of errors

In a few cases the error handling is not quite right. Make sure we
return the actual error in distro_efi_read_bootflow_file() rather than
-EINVAL. Return -IO when a file cannot be read. Also show the error name
if available.

This does not change operation, but does make it easier to diagnose
problems.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 22061d3d 17-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a new bootmeth method to set the bootflow

Normally the bootmeth driver reads the bootflow from the bootdev, since
it knows the correct way to do it.

However it is easier for some bootdevs to handle this themselves. For
example, reading from SPI flash is quite different from other devices.

Add a way for the bootdev to pass a bootflow to the bootmeth, so that
this can be supported.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 24d8e1b3 06-Jan-2023 Simon Glass <sjg@chromium.org>

bootstd: Allow reading a logo for the OS

Some operating systems provide a logo in bmp format. Read this in if
present so it can be displayed in the menu.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# b190deb8 20-Oct-2022 Simon Glass <sjg@chromium.org>

bootstd: Add a way to set up a bootflow

Add a function to init a bootflow, to reduce code duplication.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# c627cfc1 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow scanning for global bootmeths separately

Typically we want to find and use global bootmeths first, since they have
the best idea of how the system should boot. We then use normal bootmeths
as a fallback.

Add the logic for this, putting global bootmeths at the end of the
ordering. We can then easily scan the global bootmeths first, then drop
them from the list for subsequent bootdev-centric scans.

This changes the ordering of global bootmeths, so update the
bootflow_system() accordingly.

Drop the comment from bootmeth_setup_iter_order() since this is an
exported function and it should be in the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# bc06aa03 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Allow bootmeths to be marked as global

The current way of handling things like EFI bootmgr is a bit odd, since
that bootmeth handles selection of the bootdev itself. VBE needs to work
the same way, so we should support it properly.

Add a flag that indicates that the bootmeth is global, rather than being
invoked on each bootdev. Provide a helper to read a bootflow from the
bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 988cacae 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Provide a bootmeth method to obtain state info

Some bootmeths can provide information about what is available to boot.
For example, VBE simple provides access to the firmware state.

Add a new method for this, along with a sandbox test.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 10d16faa 30-Jul-2022 Simon Glass <sjg@chromium.org>

bootstd: Detect empty bootmeth ordering

If the ordering produces no entries, this is an error. Report it, so that
the caller doesn't try to continue with a NULL bootmeth.

This fixes a crash in the bootflow_iter test when running with the sandbox
'default' device tree, instead of the required 'test' one.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>


# a950d31a 24-Apr-2022 Simon Glass <sjg@chromium.org>

bootstd: Add the bootmeth uclass and helpers

A bootmeth is a method of locating an operating system. For now, just
add the uclass itself. Drivers for particular bootmeths are added later.

If no bootmeths devices are included in the devicetree, create them
automatically. This avoids the need for boilerplate in the devicetree
files.

Signed-off-by: Simon Glass <sjg@chromium.org>