Commit graph

368 commits

Author SHA1 Message Date
Simon Glass
be5951461c command: Include a required header in command.h
This uses ARRAY_SIZE() but does not include the header file which declares
it. Fix this, so that command.h can be included without common.h

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-10-06 14:38:13 -04:00
Simon Glass
247970978d dm: core: Reverse the argument order in ofnode_copy_props()
Follow the order used by memcpy() as it may be less confusing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-10-06 14:38:12 -04:00
Tom Rini
ac897385bb Merge branch 'next'
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-10-02 10:55:44 -04:00
Simon Glass
1b1d36ec58 bootstd: Keep track of use of usb stop
When 'usb stop' is run, doing 'bootflow scan' does not run the USB hunter
again so does not see any devices. Fix this by telling bootstd about the
state of USB.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-09-22 06:05:40 +08:00
Thomas Mittelstaedt
1a075d4e0d x86: pxeboot: bugfix: Set variable for size of initrd
The problem was, that zboot() didn't work because of missing
ramdisc size.

Signed-off-by: Thomas Mittelstaedt <thomas.mittelstaedt@de.bosch.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-09-22 06:03:46 +08:00
Heinrich Schuchardt
64fd30d367 tools: mkimage: Add StarFive SPL image support
The StarFive JH7110 base boards require a header to be prefixed to the SPL
binary image. This has previously done with a vendor tool 'spl_tool'
published under a GPL-2-or-later license. Integrate this capability into
mkimage.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Milan P. Stanić <mps@arvanta.net>
2023-09-20 21:05:14 +08:00
Simon Glass
c0e5b0ebab boot: Join ARCH_FIXUP_FDT_MEMORY with related options
Move this to be with the other devicetree-fixup options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
400a6a3a1b boot: Drop CMD_MTDPARTS condition for FDT_FIXUP_PARTITIONS
This is not needed, so drop it. Also use a capital 'O' for the option,
while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
040a604880 boot: Join FDT_FIXUP_PARTITIONS with related options
Move this to be with the other devicetree-fixup options.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
4483184127 Make ARCH_FIXUP_FDT_MEMORY depend on OF_LIBFDT
We need CONFIG_OF_LIBFDT to be able to do fdt fixups, so add that
condition.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
3b58de4d0b Mark DISTRO_DEFAULTS as deprecated
Standard boot has been in place for a while now. Quite a few problems
have been found and fixed. It seems like a good time to mark the
script-based approach as deprecated and encourage people to use standard
boot.

Update the DISTRO_DEFAULTS Kconfig to encourage people to move to
standard boot, which is able to boot Linux distributions automatically.

Add a short migration guide to make this easier.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
064a57d019 Kconfig: Move TEXT_BASE et al under general setup
These don't relate to booting. Move them out of there and into the same
place as the other related settings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
4a8fcb6e0b boot: Make standard boot a menu
Collect these options into a menu for easier viewing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
4d8ea26f99 Kconfig: Move SPL_FIT under FIT
This option already depends on FIT, so put it under the same umbrella, so
that it appears in the FIT menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
815f8d3f86 spl: Drop SPL/TPL_RAM_SUPPORT option for SPL_LOAD_FIT_ADDRESS
All boards which actually define this address enable SPL_LOAD_FIT, or at
least just rely on the default value of 0. So drop the dependency.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:26 -04:00
Simon Glass
12a7ea0059 Kconfig: Create a menu for FIT
This is a major feature with a lot of options. Give it its own menu to
tidy up the 'make menuconfig' display. Drop the 'depends on FIT' pieces
which are now unnecessary, since they are now bracketed by an 'if FIT'.

Leave CONFIG_TIMESTAMP out since it affects legacy images too.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:25 -04:00
Simon Glass
47b18c0e33 boot: Rename Android-boot text
Phrases like 'Enable support for' are pointless since this is an option
which enables things. Drop that part so it is easier to follow.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:25 -04:00
Simon Glass
96095e131c boot: Move some other fdt-fixup options to the same menu
Move more options relating to fixing up a device tree into the new
devicetree-fixup menu.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:25 -04:00
Simon Glass
ddc5f9b13e Move fdt_simplefb to boot/
This relates to booting, so move it there. Create a new Kconfig menu for
things related to devicetree fixup.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:25 -04:00
Simon Glass
b1a4b46734 boot: Move fdt_support to boot/
This relates to booting since it fixes up the devicetree for the OS. Move
it into the boot/ directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2023-09-19 11:36:25 -04:00
Massimo Pegorer
a3a057f839 expo: Fix documentation reference
Fix typo: doc/develop/expo.rst instead of doc/developer/expo.rst

Signed-off-by: Massimo Pegorer <massimo.pegorer+oss@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-09-16 18:17:25 +02:00
Marek Vasut
ba377a6c2c image: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Marek Vasut
446d664303 boot: Remove unused NEEDS_MANUAL_RELOC code bits
The last user of the NEEDS_MANUAL_RELOC has been removed in commit
26af162ac8 ("arch: m68k: Implement relocation")
Remove now unused NEEDS_MANUAL_RELOC code.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-09-14 10:42:24 -04:00
Tom Rini
ddec4cae62 Prepare v2023.10-rc4
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmT17FsACgkQFHw5/5Y0
 tywn0gwAlRs5NZ4ierzvDiLQEvYgV6E+lLccwyf8mMfJVHicrrW/ckxqJGS2mrLz
 IoA0pO1oF/HFfR/0pgx9Pb2kuIK1tkCeVNYW6t9EDbEJzrbfdvykBcSB4wgKYpgB
 ZgCga0jsPNM951Y3a3TElNEet4pVTZrDLu0E2UR6zNzr5hpKnfoQTZRfBI1MyCq4
 w4/Eo2wAnnaV1lcobg9LzM6uyDnETxWyTI7DIJYSqkEgT0WcF6zrdW55MaXtrPo5
 RZ4q5MTJQwqnTV5awsmgEt8PSC+XQcPHMPrVCwoOZAdru+5zO3AWpbqq1q6K+y9U
 FEsaJ6HGn5BdITgmIK/lb8oTekfOkDPFF3WuFp5bZ6L0A63ANu/MMWHELyyt5+0z
 TlnU94PVxiLnPMzZtfBPWRQ3jIU5qltJaoW0pKwsoa7P8iUd1WZgYyN+G9WPgwFr
 XUemGRNkgnWfRoxcKGbaYDSB0Llp6m/zqPlGfhlt0ZKXc6igLu3/egRh7/8zLR0i
 y9uBKG45
 =s9vZ
 -----END PGP SIGNATURE-----

Merge tag 'v2023.10-rc4' into next

Prepare v2023.10-rc4
2023-09-04 10:51:58 -04:00
Simon Glass
6c4cad7438 event: Rename EVENT_SPY to EVENT_SPY_FULL
The new name makes it clearer that this is for a full spy, with access to
the context and the event data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31 13:16:54 -04:00
Simon Glass
5986d46f8e bootstd: Adjust the default bootmeth order
The existing distro scripts check extlinux and scripts before EFI. Adjust
the default ordering to do the same, to avoid breaking existing flows.

Add some documentation, mentioning that this order will likely change in
future.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Da Xue <da@libre.computer>
2023-08-28 15:59:22 -04:00
Peter Robinson
d167062c48 boot: Fix reference to bootmenu doc
The Kconfig references a readme file that's moved and
converted to rst so update the reference.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-28 15:59:22 -04:00
Simon Glass
71f634b822 bootstd: cros: Allow detection of any kernel partition
The existing ChromiumOS bootmeth only supports reading a single kernel
partition, either 2 or 4. In fact there are normally two options
available.

Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART
flag, so that bootstd does not require a valid filesystem before calling
the bootmeth.

Tidy up and improve the logging while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
[trini: Add missing select of PARTITION_TYPE_GUID]
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-26 10:07:32 -04:00
Simon Glass
831405f41d bootstd: Support bootmeths which can scan any partition
Some bootmeths support scanning a partition without a filesystem on it.
Add a flag to support this.

This will allow the ChromiumOS bootmeth to find kernel partition, which
are stored in a special format, without a filesystem.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:19 -04:00
Simon Glass
b2b7e6c181 part: Add an accessor for struct disk_partition sys_ind
This field is only present when a CONFIG is set. To avoid annoying #ifdefs
in the source code, add an accessor. Update the only usage.

Note that the accessor is optional. It can be omitted if it is known that
the option is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 17:55:18 -04:00
Simon Glass
cfc402db39 expo: cedit: Support reading settings from CMOS RAM
Add a command to read edit settings from CMOS RAM, using the cedit
definition to indicate which registers and bits are used.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
eb6c71b562 expo: cedit: Support writing settings to CMOS RAM
Add a command to write cedit settings to CMOS RAM so that it can be
preserved across a reboot. This uses a simple bit-encoding, where each
field has a 'bit position' and a 'bit length' in the schema.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
bcf2b7202e expo: cedit: Support reading settings from environment vars
Add a command to read cedit settings from environment variables so that
they can be restored as part of the environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
fc9c0e0771 expo: cedit: Support writing settings to environment vars
Add a command to write cedit settings to environment variables so that
they can be stored with 'saveenv'.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
472317cb12 expo: cedit: Support reading settings from a file
Add a command to read cedit settings from a devicetree file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
2dee81fe5f expo: cedit: Support writing settings to a file
Support writing settings from an expo into a file in FDT format. It
consists of a single node with a two properties for each sceneitem,
one with tag ID chosen by the user and another for its text value.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
6e648fa781 expo: Export scene_menuitem_find() for use in internal code
Make this function available to other expo code so we can use it to look
up a menu item.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
8d0f890a0b expo: Add a function to prepare a cedit
Split out the code which prepares the cedit for use, so we can call it
from a test.

Add a log category while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
040b04685e expo: Split out cedit into its own header
Before adding more functions to this interface, create a new header for
the configuration editor.

Fix up the expo header guard while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
431b21fd40 expo: Refactor menu_build() to return the object created
The caller reads the ID but menu_build() does this again. Add the ID as
a parameter to avoid this. Return the object created so that the caller
can adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
f2eb6ad50a expo: Provide a way to iterate through all scene objects
For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Simon Glass
633b3dc755 expo: Make scene_obj_find() take a const scene
This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25 13:54:33 -04:00
Tom Rini
7e6e40c572 Prepare v2023.10-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmTjxwsACgkQFHw5/5Y0
 tyz4TAwAtVgllQGPVNIVDaEBdG93htm1DoZPc4EMZ4L5rf0nT0yJPeOhRCGygYY+
 zYL1ueleBZtpJhYOuHGetSns0B/M5Wx7gu1eGHNGrMNHH7zCV5Ynjjee2IaqKgbU
 tdSSc8XQpJ3PJY6rhJ6qZ7pO/EcUlQEdqplEUGFmA4JObx43j1+bmqyGTJA57vEw
 rrr+tyUVlr+Wv4lqlX/YJWzAB6IoSMUStv34M2lmiZvZoTYHezvIqBK33GrQ4Cwl
 hQ8nP7ymBXdA5GoMFBpfaBCA7aX3esx4yYN3JIRNRjNmnITJHYs0G8oIh8R5iNnJ
 psroU7GRPu3MmXfOnHlRfA/v0mo8xQGc2RQHyZUGXuApTI8+SFK/4WJPBny/IYse
 ggcVCHoI57dx1+j4+JHYhh61bMR1JUwARs4/UU4dKT3MRZM8Gb99OvbXO3+switZ
 R0YHSnDP///MTC7/MzbOPWzsJiTn9gkZd8nFVTXoncrVI8F3OtCc89G4HBruBSj7
 ptfylxqH
 =VlzD
 -----END PGP SIGNATURE-----

Merge tag 'v2023.10-rc3' into next

Prepare v2023.10-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-21 17:32:17 -04:00
Bin Meng
6072703dc9 bootmeth: efi: Make distro_efi_boot() static
As it is only called in bootmeth_efi.c

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-08-15 18:21:17 +02:00
Simon Glass
daffb0be2c bootstd: cros: Add ARM support
Support booting ChromiumOS on ARM devices using FIT. Add an entry into the
boot implementation which does not require a command line. This can be
expanded over time as the bootm code is refactored.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-11 07:33:40 -06:00
Simon Glass
c279224ea6 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>
2023-08-11 07:33:38 -06:00
Simon Glass
598dea978d bootstd: cros: Split up reading info and kernel
Use the two new functions to separate reading of the ChromiumOS info from
the partition from actually reading the kernel and booting it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10 18:34:54 -06:00
Simon Glass
074503c40a bootstd: cros: Add a function to read a kernel
The code to read the ChromiumOS information from the partition is
currently all in one function.

Create a new function which reads the kernel, assuming that the metadata
has been parsed.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10 18:34:54 -06:00
Simon Glass
f861b1ee70 bootstd: cros: Add a function to read info from partition
The code to read the ChromiumOS information from the partition is
currently all in one function. It reads the entire kernel, which is
unnecessary unless it is to be booted.

Create a new function which reads just the minimum required data from the
disk, then obtains what it needs from there.

For now this function is not used. Future work will plumb it in.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10 18:34:54 -06:00
Simon Glass
76bd6844dc bootstd: Add private bootmeth data to the bootflow
Some bootmeths need to store their own information related to the
bootflow, in addition to the generic information in struct bootflow.
Add a pointer for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-10 18:34:54 -06:00