platform/kernel/u-boot.git
2 years agoMerge tag 'u-boot-amlogic-20220427' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 27 Apr 2022 13:19:17 +0000 (09:19 -0400)]
Merge tag 'u-boot-amlogic-20220427' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Add AXG support for SARADC, including minimal ao-clk driver
- Update Amlogic documentation for Matrix & Jethub D1

2 years agodoc: boards: amlogic: update jethub d1 specifications
Vyacheslav Bocharov [Tue, 26 Apr 2022 05:26:33 +0000 (08:26 +0300)]
doc: boards: amlogic: update jethub d1 specifications

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
[narmstrong: removed trailing whitespaces and fixed sphinx build error]
Link: https://lore.kernel.org/r/20220426052633.3027932-2-adeep@lexina.in
2 years agoMerge tag 'u-boot-at91-2022.07-b' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 26 Apr 2022 11:54:12 +0000 (07:54 -0400)]
Merge tag 'u-boot-at91-2022.07-b' of https://source.denx.de/u-boot/custodians/u-boot-at91

Second set of u-boot-at91 features for the 2022.07 cycle:

This feature set includes the new driver for the AT91 reset controller,
a new board called sam9x60 curiosity, and several other fixes and
clean-ups (sama7g5ek qspi clock, impedance; remove unused code,
introduce Kconfig symbols for SPL timers)

2 years agodoc: boards: amlogic: update documentation for ADC support for AXG
Vyacheslav Bocharov [Tue, 26 Apr 2022 05:26:32 +0000 (08:26 +0300)]
doc: boards: amlogic: update documentation for ADC support for AXG

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220426052633.3027932-1-adeep@lexina.in
2 years agoARM: dts: at91: sama7g5ek: Align the impedance of the QSPI0's HSIO and PCB lines
Tudor Ambarus [Fri, 8 Apr 2022 09:10:36 +0000 (12:10 +0300)]
ARM: dts: at91: sama7g5ek: Align the impedance of the QSPI0's HSIO and PCB lines

The impedance of the QSPI PCB lines on the sama7g5ek is 50 Ohms.
Align the output impedance of the QSPI0 HSIOs by setting a medium drive
strength which corresponds to an impedance of 56 Ohms when VDD is in the
3.0V - 3.6V range. The high drive strength setting corresponds to an
output impedance of 42 Ohms on the QSPI0 HSIOs.
This is just a fine tunning. The memory that we have populated on sama7g5ek
works fine even with high drive strength, but it's better to adjust it and
use medium instead, in case some other flashes with higher frequencies are
tested.

Suggested-by: Mihai Sain <mihai.sain@microchip.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2 years agoARM: dts: at91: sama7g5: Fix QSPI1 clock
Tudor Ambarus [Fri, 8 Apr 2022 08:41:11 +0000 (11:41 +0300)]
ARM: dts: at91: sama7g5: Fix QSPI1 clock

QSPI1 used the clock of QSPI0, fix it.

Fixes: 5eecc37bb1 ("ARM: dts: at91: sama7g5: Add QSPI0 and OSPI1 nodes")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2 years agospi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller
Tudor Ambarus [Fri, 8 Apr 2022 08:40:26 +0000 (11:40 +0300)]
spi: atmel-quadspi: Fix the buswidth adjustment between spi-mem and controller

Use the spi_mem_default_supports_op() core helper in order to take into
account the buswidth specified by the user in device tree.

Fixes: 24c8ff4684 ("spi: Add Atmel QuadSPI driver")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
2 years agoinclude: configs: at91/sam: remove stray #ifdef/#else
Eugen Hristev [Thu, 7 Apr 2022 06:58:48 +0000 (09:58 +0300)]
include: configs: at91/sam: remove stray #ifdef/#else

With the commit that moves the BOOTCOMMAND to Kconfig:

970bf8603b ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")

some stray ifdefs have been left in the header files which
are now useless.
Clean up the include files to remove these lines.

Fixes: 970bf8603b ("Convert CONFIG_USE_BOOTCOMMAND et al to Kconfig")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2 years agoARM: dts: sam9x60: Add pit64b node
Durai Manickam KR [Mon, 4 Apr 2022 10:30:00 +0000 (16:00 +0530)]
ARM: dts: sam9x60: Add pit64b node

Add DT node for pit64b support.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agotimers: atmel_pit: introduce CONFIG_SPL_ATMEL_PIT_TIMER
Eugen Hristev [Mon, 4 Apr 2022 08:35:51 +0000 (11:35 +0300)]
timers: atmel_pit: introduce CONFIG_SPL_ATMEL_PIT_TIMER

This commit allows the ATMEL_PIT_TIMER driver to be unselected in SPL and be
selected in u-boot proper. The SPL can use a different timer.
By having a separate Kconfig for ATMEL_TCB in SPL, the size of the SPL
decreases by 0.3 KBytes.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2 years agotimers: atmel_tcb: introduce CONFIG_SPL_ATMEL_TCB
Eugen Hristev [Mon, 4 Apr 2022 08:35:50 +0000 (11:35 +0300)]
timers: atmel_tcb: introduce CONFIG_SPL_ATMEL_TCB

This commit allows the ATMEL_TCB driver to be unselected in SPL and be
selected in u-boot proper. The SPL can use a different timer.
By having a separate Kconfig for ATMEL_TCB in SPL, the size of the SPL
decreases by 1 KByte.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
2 years agoARM: mach-at91: armv7: Remove default reset driver
Sergiu Moga [Fri, 1 Apr 2022 09:27:27 +0000 (12:27 +0300)]
ARM: mach-at91: armv7: Remove default reset driver

This commit removes the default reset driver for armv7, since
it is no longer needed due to the presence of the SYSRESET driver.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoARM: mach-at91: arm926ejs: Add SYSRESET conditional
Sergiu Moga [Fri, 1 Apr 2022 09:27:26 +0000 (12:27 +0300)]
ARM: mach-at91: arm926ejs: Add SYSRESET conditional

This commit adds a condition to the Makefile so that whenever the SYSRESET
option is chosen in the configuration, the default reset driver is ignored.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoconfigs: at91: Enable SYSRESET for Atmel/Microchip's platforms
Sergiu Moga [Fri, 1 Apr 2022 09:27:25 +0000 (12:27 +0300)]
configs: at91: Enable SYSRESET for Atmel/Microchip's platforms

This commit enables SYSRESET in the defconfigs for the
Atmel/Microchip platforms.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agosysreset: Add Atmel/Microchip sysreset driver
Sergiu Moga [Fri, 1 Apr 2022 09:27:24 +0000 (12:27 +0300)]
sysreset: Add Atmel/Microchip sysreset driver

This patch adds a sysreset driver for Atmel/Microchip platforms.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
2 years agoARM: dts: at91: Add RSTC node
Sergiu Moga [Fri, 1 Apr 2022 09:27:23 +0000 (12:27 +0300)]
ARM: dts: at91: Add RSTC node

Add node for RSTC.

Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
2 years agoconfigs: Add sam9x60_curiosity_mmc_defconfig
Durai Manickam KR [Mon, 4 Apr 2022 05:53:20 +0000 (11:23 +0530)]
configs: Add sam9x60_curiosity_mmc_defconfig

Add boot from SDMMC (sdcard) support for sam9x60_curiosity.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agoARM: dts: Add device tree files for sam9x60_curiosity
Durai Manickam KR [Mon, 4 Apr 2022 05:53:19 +0000 (11:23 +0530)]
ARM: dts: Add device tree files for sam9x60_curiosity

Add dts and dtsi files.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agoboard: Add sam9x60_curiosity support
Durai Manickam KR [Mon, 4 Apr 2022 05:53:18 +0000 (11:23 +0530)]
board: Add sam9x60_curiosity support

Add board files, Kconfig, Makefile and MAINTAINERS.

Signed-off-by: Durai Manickam KR <durai.manickamkr@microchip.com>
2 years agoPrepare v2022.07-rc1
Tom Rini [Mon, 25 Apr 2022 23:26:07 +0000 (19:26 -0400)]
Prepare v2022.07-rc1

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Mon, 25 Apr 2022 22:53:54 +0000 (18:53 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonds32: Remove the architecture
Tom Rini [Wed, 6 Apr 2022 13:21:25 +0000 (09:21 -0400)]
nds32: Remove the architecture

As removal of nds32 has been ack'd for the Linux kernel, remove support
here as well.

Cc: Rick Chen <rick@andestech.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Rick Chen <rick@andestech.com>
2 years agoMerge branch '2022-04-25-initial-implementation-of-stdboot'
Tom Rini [Mon, 25 Apr 2022 20:02:27 +0000 (16:02 -0400)]
Merge branch '2022-04-25-initial-implementation-of-stdboot'

To quote the author:
The bootflow feature provide a built-in way for U-Boot to automatically
boot an Operating System without custom scripting and other customisation.
This is called 'standard boot' since it provides a standard way for
U-Boot to boot a distro, without scripting.

It introduces the following concepts:

   - bootdev - a device which can hold a distro
   - bootmeth - a method to scan a bootdev to find bootflows (owned by
                U-Boot)
   - bootflow - a description of how to boot (owned by the distro)

This series provides an implementation of these, enabled to scan for
bootflows from MMC, USB and Ethernet. It supports the existing distro
boot as well as the EFI loader flow (bootefi/bootmgr). It works
similiarly to the existing script-based approach, but is native to
U-Boot.

With this we can boot on a Raspberry Pi 3 with just one command:

   bootflow scan -lb

which means to scan, listing (-l) each bootflow and trying to boot each
one (-b). The final patch shows this.

With a standard way to identify boot devices, booting become easier. It
also should be possible to support U-Boot scripts, for backwards
compatibility only.

...

The design is described in these two documents:

https://drive.google.com/file/d/1ggW0KJpUOR__vBkj3l61L2dav4ZkNC12/view?usp=sharing

https://drive.google.com/file/d/1kTrflO9vvGlKp-ZH_jlgb9TY3WYG6FF9/view?usp=sharing

2 years agoMerge branch '2022-04-23-binman-updates'
Tom Rini [Mon, 25 Apr 2022 20:02:03 +0000 (16:02 -0400)]
Merge branch '2022-04-23-binman-updates'

- Assorted binman updates, and add Alper as a maintainer, after talking
  with Simon.

2 years agobinman: don't import deprecated distutils package
Heinrich Schuchardt [Sat, 9 Apr 2022 12:53:18 +0000 (14:53 +0200)]
binman: don't import deprecated distutils package

'make tests' fails on Ubuntu 22.04 with:

binman: ./tools/binman/binman:12: DeprecationWarning:
The distutils package is deprecated and slated for removal in Python 3.12.
Use setuptools or check PEP 632 for potential alternatives
  from distutils.sysconfig import get_python_lib
./tools/binman/binman:12: DeprecationWarning:
The distutils.sysconfig module is deprecated, use sysconfig instead
  from distutils.sysconfig import get_python_lib
<unittest.result.TestResult run=428 errors=0 failures=4>
AssertionError: 0 != 468

As we don't use Ubuntu 16.04 for our CI anymore drop the import.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2 years agoMAINTAINERS: Add Alper as a binman maintainer
Alper Nebi Yasak [Fri, 22 Apr 2022 15:25:47 +0000 (18:25 +0300)]
MAINTAINERS: Add Alper as a binman maintainer

I ended up learning most of binman internals while trying to add a few
features to it, and I recently started reviewing binman series that
would not affect me personally. I'll keep working on it and try to do
more reviews.

Add myself as a maintainer for binman.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Acked-by: Tom Rini <trini@konsulko.com>
2 years agobinman: Refuse to replace sections for now
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:50 +0000 (18:31 +0300)]
binman: Refuse to replace sections for now

Binman interfaces allow attempts to replace any entry in the image with
arbitrary data. When trying to replace sections, the changes in the
section entry's data are not propagated to its child entries. This,
combined with how sections rebuild their contents from its children,
eventually causes the replaced contents to be silently overwritten by
rebuilt contents equivalent to the original data.

Add a simple test for replacing a section that is currently failing due
to this behaviour, and mark it as an expected failure. Also, raise an
error when replacing a section instead of silently pretending it was
replaced.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Test replacing non-section entries in FIT subsections
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:49 +0000 (18:31 +0300)]
binman: Test replacing non-section entries in FIT subsections

A previous patch fixes binman to correctly extract FIT subentries. This
makes it easier to test replacing these entries as we can write tests
using an existing helper function that relies on extracting the replaced
entry.

Add tests that replace leaf entries in FIT subsections with data of
various sizes. Replacing the subsections or the whole FIT section does
not work yet due to the section contents being re-built from unreplaced
subentries' data.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Create FIT subentries in the FIT section, not its parent
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:48 +0000 (18:31 +0300)]
binman: Create FIT subentries in the FIT section, not its parent

When reading images from a file, each entry's data is read from its
parent section as specified in the Entry.Create() call that created it.
The FIT entry type has been creating its subentries under its parent
(their grandparent), as creating them under the FIT entry resulted in an
error until FIT was converted into a proper section.

FIT subentries have their offsets relative to the FIT section, and
reading those offsets in the parent section results in wrong data. The
subentries rightfully belong under the FIT entries, so create them
there. Add tests checking that we can extract the correct data for a FIT
entry and its subentries.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Remove '/images/' fragment from FIT subentry paths
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:47 +0000 (18:31 +0300)]
binman: Remove '/images/' fragment from FIT subentry paths

Binman FIT entry nodes describe their subentries in an 'images' subnode,
same as how they would be written for the mkimage executable. The entry
type initially manually managed its subentries keyed by their node paths
relative to its base node. It was later converted to a proper section
while still keeping the same keys for subentries.

These subentry keys of sections are used as path fragments, so they must
not contain the path separator character '/'. Otherwise, they won't be
addressable by binman extract/replace commands. Change these keys from
the '/images/foo' forms to the subentry node names. Extend the simple
FIT tests to check for this.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
2 years agobinman: Don't reset offset/size if image doesn't allow repacking
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:46 +0000 (18:31 +0300)]
binman: Don't reset offset/size if image doesn't allow repacking

When an image has the 'allow-repack' property, binman includes the
original offset and size properties from the image description in the
fdtmap. These are later used as the packing constraints when replacing
entries in an image, so other unconstrained entries can be freely
positioned.

Replacing an entry in an image without 'allow-repack' (and therefore the
original offsets) follows the same logic and results in entries being
merely concatenated. Instead, skip resetting the calculated offsets and
sizes to the missing originals for these images so that every entry is
constrained to its existing offset/size.

Add tests that replace an entry with smaller or equal-sized data, in an
image that doesn't allow repacking. Attempting to do so with bigger-size
data is already an error that is already being tested.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Collect bintools for images when replacing entries
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:45 +0000 (18:31 +0300)]
binman: Collect bintools for images when replacing entries

Binman entries can use other executables to compute their data, usually
in their ObtainContents() methods. Subclasses of Entry_section would use
bintools in their BuildSectionData() method instead, which is called
from several places including their Pack().

These binary tools are resolved correctly while building an image from a
device-tree description so that they can be used from these methods.
However, this is not being done when replacing entries in an image,
which can result in an error as the Pack() methods attempt to use them.

Collect and resolve entries' bintools also when replacing entries to fix
Pack() errors. Add a way to mock bintool usage in the testing entry type
and tests that check bintools are being resolved for such an entry.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Fix unique names having '/.' for images read from files
Alper Nebi Yasak [Sun, 27 Mar 2022 15:31:44 +0000 (18:31 +0300)]
binman: Fix unique names having '/.' for images read from files

Binman can embed a copy of the image description into the images it
builds as a fdtmap entry, but it omits the /binman/<image-name> prefix
from the node paths while doing so. When reading an already-built image
file, entries are reconstructed using this fdtmap and their associated
nodes still lack that prefix.

Some entries like fit and vblock create intermediate files whose names
are based on an entry unique name. This name is constructed from their
node's path by concatenating the parents with dots up to the binman
node, e.g. /binman/image/foo/bar becomes 'image.foo.bar'.

However, we don't have this /binman/image prefix when replacing entries
in such an image. The /foo/bar entry we read when doing so erroneously
has the unique name of '/.foo.bar', causing permission errors when the
entry attempts to create files based on that.

Fix the unique-name generation by stopping at the '/' node like how it
stops at the binman node. As the unique names are used as filenames, add
tests that check if they're safe to use as filenames.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: doc: Add documentation
Simon Glass [Mon, 25 Apr 2022 05:31:26 +0000 (23:31 -0600)]
bootstd: doc: Add documentation

Add documentation for this feature, including the commands and full
devicetree bindings.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Provide a default command
Simon Glass [Mon, 25 Apr 2022 05:31:27 +0000 (23:31 -0600)]
bootstd: Provide a default command

We would like to use bootstd by default when EFI boot manager is not
enabled. But so far bootstd does not support all the of distro-boot
fetures. So for now, add an option to select this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add setup for the bootflow tests
Simon Glass [Mon, 25 Apr 2022 05:31:25 +0000 (23:31 -0600)]
bootstd: Add setup for the bootflow tests

We need to create a disk image with a partition table and a DOS-format
filesystem containing a few files. Provide a fallback binary for CI since
it does not seem able to detect the loopback partitions.

Add this to a dm_init test so that it happens when needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add tests for bootstd including all uclasses
Simon Glass [Mon, 25 Apr 2022 05:31:24 +0000 (23:31 -0600)]
bootstd: Add tests for bootstd including all uclasses

Add a set of combined tests for the bootdev, bootflow and bootmeth
commands, along with associated functionality.

Expand the sandbox console-recording limit so that these can work.

These tests rely on a filesystem script which is not yet added to the
Python tests. It is included here as a shell script.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: usb: Add a bootdev driver
Simon Glass [Mon, 25 Apr 2022 05:31:23 +0000 (23:31 -0600)]
bootstd: usb: Add a bootdev driver

Add a bootdev driver for USB host. It can use the distro boot mechanism to
locate a file, or any other available bootmeth.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of script boot
Simon Glass [Mon, 25 Apr 2022 05:31:22 +0000 (23:31 -0600)]
bootstd: Add an implementation of script boot

Add a bootmeth driver which handles distro boot from a disk via a U-Boot
script, so we can boot a bootflow using this commonly used mechanism. This
is required by Armbian, for example.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: sandbox: Add a hostfs bootdev
Simon Glass [Mon, 25 Apr 2022 05:31:21 +0000 (23:31 -0600)]
bootstd: sandbox: Add a hostfs bootdev

It is helpful to be able to try out bootstd on sandbox, using host files.
This is easier than using a block device, which must have a filesystem,
partition table, etc.

Add a new driver which provides this feature. For now it is not used in
tests, but it is likely to be useful.

Add notes in the devicetree also, but don't disturb the tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a sandbox bootmeth driver
Simon Glass [Mon, 25 Apr 2022 05:31:20 +0000 (23:31 -0600)]
bootstd: Add a sandbox bootmeth driver

Add a bootmeth driver for sandbox, used for testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of EFI bootmgr
Simon Glass [Mon, 25 Apr 2022 05:31:19 +0000 (23:31 -0600)]
bootstd: Add an implementation of EFI bootmgr

Add a bootmeth driver which handles EFI boot manager, using EFI_LOADER.

In effect, this provides the same functionality as the 'bootefi bootmgr'
command and shares the same code. But the interface into it is via a
bootmeth, so it does not require any special scripts, etc.

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

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a system bootdev for strange boot methods
Simon Glass [Mon, 25 Apr 2022 05:31:18 +0000 (23:31 -0600)]
bootstd: Add a system bootdev for strange boot methods

Some boot methods don't act on a single bootdev but instead do their own
thing. An example is EFI bootmgr which scan various devices using its own
logic. Add a bootdev to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of EFI boot
Simon Glass [Mon, 25 Apr 2022 05:31:17 +0000 (23:31 -0600)]
bootstd: Add an implementation of EFI boot

Add a bootmeth driver which handles EFI boot, using EFI_LOADER.

In effect, this provides the same functionality as the 'bootefi' command
and shares the same code. But the interface into it is via a bootmeth,
so it does not require any special scripts, etc.

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

There was much discussion about whether this is needed, but it seems
that it is, at least for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of distro PXE boot
Simon Glass [Mon, 25 Apr 2022 05:31:16 +0000 (23:31 -0600)]
bootstd: Add an implementation of distro PXE boot

Add a bootmeth driver which handles distro boot from a network device, so
we can boot a bootflow using this commonly used mechanism.

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

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

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: ethernet: Add a bootdev driver
Simon Glass [Mon, 25 Apr 2022 05:31:15 +0000 (23:31 -0600)]
bootstd: ethernet: Add a bootdev driver

Add a bootdev driver for Ethernet. It can use the PXE boot mechanism to
locate a file, added later.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: mmc: Add a bootdev driver
Simon Glass [Mon, 25 Apr 2022 05:31:14 +0000 (23:31 -0600)]
bootstd: mmc: Add a bootdev driver

Add a bootdev driver for MMC. It mostly just calls the bootdev helper
function.

Add a function to obtain the block device for an MMC controller.

Fix up the comment for mmc_get_blk_desc() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add an implementation of distro boot
Simon Glass [Mon, 25 Apr 2022 05:31:13 +0000 (23:31 -0600)]
bootstd: Add an implementation of distro boot

Add a bootmeth driver which handles distro boot from a disk, so we can
boot a bootflow using this commonly used mechanism.

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

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

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootmeth command
Simon Glass [Mon, 25 Apr 2022 05:31:12 +0000 (23:31 -0600)]
bootstd: Add a bootmeth command

Add a 'bootmeth' command to handle listing and ordering of boot methods.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootflow command
Simon Glass [Mon, 25 Apr 2022 05:31:11 +0000 (23:31 -0600)]
bootstd: Add a bootflow command

Add a 'bootflow' command to handle listing and selection of bootflow.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add a bootdev command
Simon Glass [Mon, 25 Apr 2022 05:31:10 +0000 (23:31 -0600)]
bootstd: Add a bootdev command

Add a 'bootdev' command to handle listing and selection of bootdevs.

Disable standard boot for a few boards which otherwise run out of space.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add support for bootflows
Simon Glass [Mon, 25 Apr 2022 05:31:09 +0000 (23:31 -0600)]
bootstd: Add support for bootflows

Add support for bootflows, including maintaining a list of them and
iterating to find them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootmeth uclass and helpers
Simon Glass [Mon, 25 Apr 2022 05:31:08 +0000 (23:31 -0600)]
bootstd: Add the bootmeth uclass and helpers

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

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

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootdev uclass
Simon Glass [Mon, 25 Apr 2022 05:31:07 +0000 (23:31 -0600)]
bootstd: Add the bootdev uclass

A 'bootdev' is a device which can be used to boot an operating system.
It is a child of the media device (e.g. MMC) which handles reading files
from that device, such as a bootflow file.

Add a uclass for bootdev and the various helpers needed to make it
work. Also add a binding file, empty for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the bootstd uclass and core implementation
Simon Glass [Mon, 25 Apr 2022 05:31:06 +0000 (23:31 -0600)]
bootstd: Add the bootstd uclass and core implementation

The 'bootstd' device provides the central information about U-Boot
standard boot.

Add a uclass for bootstd and the various helpers needed to make it
work. Also add a binding file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobootstd: Add the concept of a bootflow
Simon Glass [Mon, 25 Apr 2022 05:31:05 +0000 (23:31 -0600)]
bootstd: Add the concept of a bootflow

A bootflow encapsulates the process used to boot an operating system.
It typically has a control file (such as extlinux.conf) and information
about which 'bootdev' it came from.

Add the header file for this first, since it is needed by all other
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agofs: Add a function to set the filesystem type
Simon Glass [Mon, 25 Apr 2022 05:31:04 +0000 (23:31 -0600)]
fs: Add a function to set the filesystem type

When sandbox is used with hostfs we won't have a block device, but still
must set up the filesystem type before any filesystem operation, such as
loading a file. Add a function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: blk: Add a function to return the device type
Simon Glass [Mon, 25 Apr 2022 05:31:03 +0000 (23:31 -0600)]
dm: blk: Add a function to return the device type

Use the uclass name to get the device type for a block device.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: dm: Restart USB before assuming it is stopped
Simon Glass [Mon, 25 Apr 2022 05:31:02 +0000 (23:31 -0600)]
test: dm: Restart USB before assuming it is stopped

Update the blk test to stop USB first, in case another test has started
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: fastboot: Avoid using mmc1
Simon Glass [Mon, 25 Apr 2022 05:31:01 +0000 (23:31 -0600)]
test: fastboot: Avoid using mmc1

The bootflow tests need to use an MMC with an associated backing file
containing a filesystem. Update the fastboot tests to cope with this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Allow finding a uclass device by partial name
Simon Glass [Mon, 25 Apr 2022 05:31:00 +0000 (23:31 -0600)]
dm: core: Allow finding a uclass device by partial name

In some cases two devices are related and the only way to tell is to
check that the names partially patch. Add a way to check this without
needing to create a new string for the comparison.

Fix the comment for device_find_child_by_namelen() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agodm: core: Rename and fix uclass_get_by_name_len()
Simon Glass [Mon, 25 Apr 2022 05:30:59 +0000 (23:30 -0600)]
dm: core: Rename and fix uclass_get_by_name_len()

It seems that namelen is more common in U-Boot. Rename this function to
fit in better. Also fix a bug where it breaks the operation of
uclass_get_by_name() and add a test.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reported-by: Tim Harvey <tharvey@gateworks.com>
2 years agolib: Add a way to find the postiion of a trailing number
Simon Glass [Mon, 25 Apr 2022 05:30:58 +0000 (23:30 -0600)]
lib: Add a way to find the postiion of a trailing number

At present it is not possible to find out which part of the string is the
number part and which is before it. Add a new variant which provides this
feature, so we can separate the two in the caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Fix a few bugs in trailing_strtoln()
Simon Glass [Mon, 25 Apr 2022 05:30:57 +0000 (23:30 -0600)]
lib: Fix a few bugs in trailing_strtoln()

At present this has a minor bug in that it reads the byte before the
start of the string, if it is empty. Also it doesn't handle a
non-numeric prefix which is only one character long.

Fix these bugs with a reworked implementation. Add a test for the second
case. The first one is hard to test.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Correct comment formatting to avoid sphinx problems
Simon Glass [Mon, 25 Apr 2022 05:30:56 +0000 (23:30 -0600)]
lib: Correct comment formatting to avoid sphinx problems

Tweak a few comments to kep sphinx happy, in case we want to include this
file one day.

Also fix the 'exxamine' typo.

Patch-notes:
This uses:

   sed -i 's/@param \(\S*\)\s*/@\1: /' include/vsprintf.h

to convert the @param to the new format.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agotest: Add tests for trailing_strtol()
Simon Glass [Mon, 25 Apr 2022 05:30:55 +0000 (23:30 -0600)]
test: Add tests for trailing_strtol()

This function currently has no tests. Add some.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agolib: Move string tests to the string module
Simon Glass [Mon, 25 Apr 2022 05:30:54 +0000 (23:30 -0600)]
lib: Move string tests to the string module

A few string tests were added to the print module by mistake. Move them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoboard: amlogic: jethub j100: enable saradc in config
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:59 +0000 (11:21 +0300)]
board: amlogic: jethub j100: enable saradc in config

Enable ADC in board config file

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-7-adeep@lexina.in
2 years agoboard: amlogic: jethub j100: enable saradc in dts
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:58 +0000 (11:21 +0300)]
board: amlogic: jethub j100: enable saradc in dts

Prepare to use ADC channel 1 to check the hardware revision of the board:
- add u-boot dts include with saradc node

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-6-adeep@lexina.in
2 years agoadc: meson-saradc: add AXG variant
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:57 +0000 (11:21 +0300)]
adc: meson-saradc: add AXG variant

Add support for the SARADC variant found on the AXG SoCs family.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-5-adeep@lexina.in
2 years agoclk: meson: update driver for g12a-ao clocks
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:56 +0000 (11:21 +0300)]
clk: meson: update driver for g12a-ao clocks

Update g12a-ao clk driver:
- move clk->id check to .request function
- remove unnecessary check (gate->reg == 0)

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-4-adeep@lexina.in
2 years agoclk: meson: fix driver name for g12a-ao clocks
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:55 +0000 (11:21 +0300)]
clk: meson: fix driver name for g12a-ao clocks

Update the clk-g12a-ao driver from "axg" to "g12a"

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Acked-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-3-adeep@lexina.in
2 years agoclk: meson: add minimal driver for axg-ao clocks
Vyacheslav Bocharov [Sun, 24 Apr 2022 08:21:54 +0000 (11:21 +0300)]
clk: meson: add minimal driver for axg-ao clocks

Add minimal driver AO clocks on meson AXG family. Only ADC related clocks
are supported.

Signed-off-by: Vyacheslav Bocharov <adeep@lexina.in>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Link: https://lore.kernel.org/r/20220424082159.757622-2-adeep@lexina.in
2 years agocmd: part: add explicit dependency on PARTITIONS
AKASHI Takahiro [Fri, 22 Apr 2022 01:44:30 +0000 (10:44 +0900)]
cmd: part: add explicit dependency on PARTITIONS

This is a follow-up patch for my "disk: don't compile in partition
support for spl/tpl if not really necessary".

"part" command is useful only if, at least, one of partition table types
is selected. So it should have a dependency on PARTITIONS which is now
automatically selected if one of partition table types is enabled.

With this change, *_defconfig which explicitly selects CMD_PART but
has no partition table types enabled should also be fixed.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agoMerge tag 'efi-2022-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 23 Apr 2022 22:42:00 +0000 (18:42 -0400)]
Merge tag 'efi-2022-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-07-rc1-3

Documentation:

* Document image size parameter of bootefi command

UEFI:

* avoid building partition support in SPL/TPL where not required
* improve integration of EFI subsystem and driver model
* restore ability to boot arbitrary blob

2 years agoefi_loader: disk: use udevice instead of blk_desc
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:17 +0000 (10:05 +0900)]
efi_loader: disk: use udevice instead of blk_desc

In most of all cases, we can avoid using blk_desc which is expected
to be private to udevice(UCLASS_BLK), that is, the data should not
be manipulated outside the device driver unless really needed.

Now efi_disk's internally use dev_read/write() interfaces
if CONFIG_PARTITIONS is enabled.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: disk: add read/write interfaces with udevice
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:16 +0000 (10:05 +0900)]
dm: disk: add read/write interfaces with udevice

In include/blk.h, Simon suggested:
===>
/*
 * These functions should take struct udevice instead of struct blk_desc,
 * but this is convenient for migration to driver model. Add a 'd' prefix
 * to the function operations, so that blk_read(), etc. can be reserved for
 * functions with the correct arguments.
 */
unsigned long blk_dread(struct blk_desc *block_dev, lbaint_t start,
                        lbaint_t blkcnt, void *buffer);
unsigned long blk_dwrite(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt, const void *buffer);
unsigned long blk_derase(struct blk_desc *block_dev, lbaint_t start,
                         lbaint_t blkcnt);
<===

So new interfaces are provided with this patch.

They are expected to be used everywhere in U-Boot at the end.
The exceptions are block device drivers, partition drivers and efi_disk
which should know details of blk_desc structure.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoefi_loader: disk: not delete BLK device for BLK(IF_TYPE_EFI_LOADER) devices
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:15 +0000 (10:05 +0900)]
efi_loader: disk: not delete BLK device for BLK(IF_TYPE_EFI_LOADER) devices

When we create an efi_disk device with an UEFI application using driver
binding protocol, the 'efi_driver' framework tries to create
a corresponding block device(UCLASS_BLK/IF_TYPE_EFI). This will lead to
calling a PROBE callback, efi_disk_probe().
In this case, however, we don't need to create another "efi_disk" device
as we already have this device instance.

So we should avoid recursively invoke further processing in the callback
function.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoefi_loader: disk: a helper function to delete efi_disk objects
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:14 +0000 (10:05 +0900)]
efi_loader: disk: a helper function to delete efi_disk objects

This function is expected to be called, in particular from dm's pre_remove
hook, when associated block devices no longer exist.

Add efi_disk_remove() function.
This function removes an efi_disk object for a raw disk device (UCLASS_BLK)
and related objects for its partitions (UCLASS_PARTITION).

So this function is expected to be called through driver model's "remove"
interface every time a raw disk device is to be disconnected.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoefi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI_LOADER) devices
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:13 +0000 (10:05 +0900)]
efi_loader: disk: not create BLK device for BLK(IF_TYPE_EFI_LOADER) devices

When we create an efi_disk device with an UEFI application using driver
binding protocol, the 'efi_driver' framework tries to create
a corresponding block device(UCLASS_BLK/IF_TYPE_EFI). This will lead to
calling a PROBE callback, efi_disk_probe().
In this case, however, we don't need to create another "efi_disk" device
as we already have this device instance.

So we should avoid recursively invoke further processing in the callback
function.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoefi_loader: disk: a helper function to create efi_disk objects from udevice
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:12 +0000 (10:05 +0900)]
efi_loader: disk: a helper function to create efi_disk objects from udevice

Add efi_disk_probe() function.
This function creates an efi_disk object for a raw disk device (UCLASS_BLK)
and additional objects for related partitions (UCLASS_PARTITION).

So this function is expected to be called through driver model's "probe"
interface every time one raw disk device is detected and activated.
We assume that partition devices (UCLASS_PARTITION) have been created
when this function is invoked.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoefi_loader: split efi_init_obj_list() into two stages
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:11 +0000 (10:05 +0900)]
efi_loader: split efi_init_obj_list() into two stages

In the next commit, CONFIG_EFI_SETUP_EARLY will become mandated
in order to support dynamic enumeration of efi_disk objects.

This can, however, be problematic particularly in case of file-based
variable storage (efi_variable.c, default).
Non-volatile variables are to be restored from EFI system partition
by efi_init_variables() in efi_init_obj_list(). When efi_init_obj_list()
is called in board_init_r(), we don't know yet what disk devices
we have since none of device probing commands (say, scsi rescan) has not
been executed at that stage.

So in this commit, a preparatory change is made; efi_init_obj_list() is
broken into the two functions;
   * efi_init_early(), and
   * new efi_init_obj_list()

Only efi_init_early() will be called in board_init_r(), which allows
us to execute any of device probing commands, either though "preboot"
variable or normal command line, before calling efi_init_obj_list() which
is to be invoked at the first execution of an efi-related command
(or at efi_launch_capsules()) as used to be.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agodm: blk: add a device-probe hook for scanning disk partitions
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:10 +0000 (10:05 +0900)]
dm: blk: add a device-probe hook for scanning disk partitions

Now that all the block device drivers have enable a probe hook, we will
call part_create_block_devices() to enumerate all the partitions and
create associated udevices when a block device is detected.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: disk: add UCLASS_PARTITION
AKASHI Takahiro [Tue, 19 Apr 2022 01:05:09 +0000 (10:05 +0900)]
dm: disk: add UCLASS_PARTITION

NOTE: probably we have to update config dependencies,
in particular, SPL/TPL_PRINTF?

With this new function, UCLASS_PARTITION devices will be created as
child nodes of UCLASS_BLK device.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agotest: dm: add tests for tag support
AKASHI Takahiro [Fri, 15 Apr 2022 07:15:37 +0000 (16:15 +0900)]
test: dm: add tests for tag support

The new test covers all tag-related interfaces.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: tag: add some document
AKASHI Takahiro [Fri, 15 Apr 2022 07:15:36 +0000 (16:15 +0900)]
dm: tag: add some document

Some basic stuff about tag support is explained under
doc/devlop/driver-model.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agodm: tag: change ENOSPC to ENOMEM
AKASHI Takahiro [Fri, 15 Apr 2022 07:15:35 +0000 (16:15 +0900)]
dm: tag: change ENOSPC to ENOMEM

ENOMEM is a more common error code for memory starvation.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agobootmenu: fix menu API error handling
Masahisa Kojima [Thu, 24 Mar 2022 13:54:33 +0000 (22:54 +0900)]
bootmenu: fix menu API error handling

U-Boot menu framework(common/menu.c) returns 1 if it is successful,
returns negative value if it fails.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agodisk: don't compile in partition support for spl/tpl if not really necessary
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:58 +0000 (10:01 +0900)]
disk: don't compile in partition support for spl/tpl if not really necessary

Under the current Kconfigs, disk/part.c will be compiled in even if none of
partition table types are enabled. This will lead to the size growth of SPL
/TPL code.

With this patch, CONFIG_PARTITIONS is selected only if, at least, one of
CONFIG_*_PARTITION is enabled.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoefi_loader: disk: compile efi_disk when CONFIG_BLK
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:57 +0000 (10:01 +0900)]
efi_loader: disk: compile efi_disk when CONFIG_BLK

Now we can build efi_loader with block device support (CONFIG_BLK) and
without CONFIG_PARTITIONS.
So change Makefile.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agoefi_loader: PARTITION_UUIDS should be optional
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:56 +0000 (10:01 +0900)]
efi_loader: PARTITION_UUIDS should be optional

In the current implementation, partition table support (either GPT or DOS)
is not mandatory. So CONFIG_PARTITION_UUIDS should not be enabled
(selected) unconditionally.

Fixes: commit 17f8cda505e3 ("efi_loader: set partition GUID in device path for SIG_TYPE_GUID")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agosandbox: move a function prototype
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:55 +0000 (10:01 +0900)]
sandbox: move a function prototype

Since host_get_dev_errr() is defined in drivers/block/sandbox.c,
the associated function prototype should be in a more appropriate
header file.

Fixes: commit 4101f6879256 ("dm: Drop the block_dev_desc_t typedef")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agodisk: define nullified functions for !PARTITIONS
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:54 +0000 (10:01 +0900)]
disk: define nullified functions for !PARTITIONS

Some defconfig enables CMD_PART even if none of any partition table
types (CONFIG_*_PARTITION) are enabled.
This will lead to the size growth in SPL/TPL code since disk/part.c
will be compiled in any way.
We will change disk/Kconfig later so that CONFIG_PARTITIONS is only
enabled when, at least, one of CONFIG_*_PARTITION is enabled.

To make the build work (in particular, "part" command) correctly,
a few functions should be defined as void functions in case of
!CONFIG_PARTITIONS.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agodisk: enable function prototypes in part.h for SPL/TPL
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:53 +0000 (10:01 +0900)]
disk: enable function prototypes in part.h for SPL/TPL

Since CONFIG_[SPL|TPL]_PARTITIONS were introduced, part.h has not been
updated. Due to this, while the build won't fail, some functionality may
possibly break as some partition-related functions are nullified even
though some partition table types are enabled for SPL/TPL.

Fixes: commit 88ca8e26958b ("disk: Add an option for partitions in SPL")
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agodisk: include errno.h explicitly in part.h
AKASHI Takahiro [Tue, 19 Apr 2022 01:01:52 +0000 (10:01 +0900)]
disk: include errno.h explicitly in part.h

Some errno numbers are used in defining inline functions.
So "errno.h" should be explicitly included to avoid possible build errors.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
2 years agodoc: update bootefi man-page
Heinrich Schuchardt [Mon, 11 Apr 2022 19:06:13 +0000 (21:06 +0200)]
doc: update bootefi man-page

A image_size parameter has been added to the bootefi parameter.
Describe all parameters.

Correct how the description of how the device-path in the loaded
image protocol is determined.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agocmd: bootefi: restore ability to boot arbitrary blob
Kyle Evans [Sun, 10 Apr 2022 21:05:55 +0000 (16:05 -0500)]
cmd: bootefi: restore ability to boot arbitrary blob

Up until commit 5f59518a7b1ae ("efi_loader: setting boot device"), we
could boot an arbitrary blob with bootefi. Indeed, efi_run_image() even
has a special case for missing device paths indicating a payload that
was directly loaded via JTAG, for example.

Restore the ability to inject a UEFI payload into memory and `bootefi`
it. If the address passed isn't the last PE-COFF loaded, then we'll
wipe out the pre-existing DP/Image information and let efi_run_image()
synthesize a memory device path.

An image size is required if we're booting an arbitrary payload, and
the FDT argument has been changed to accept `-`. The size could be
deduced from the image header, but it's required anyways as an explicit
acknowledgment that one's trying to boot an arbitrary payload rather
than accidentally using the wrong address in the single-addr form.

Fixes: 5f59518a7b1a ("efi_loader: setting boot device")
Signed-off-by: Kyle Evans <kevans@FreeBSD.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agotools: kwboot: Fix spelling of "followed" in kwboot.1
Vagrant Cascadian [Wed, 20 Apr 2022 00:48:27 +0000 (17:48 -0700)]
tools: kwboot: Fix spelling of "followed" in kwboot.1

Fix spelling of "followed" in kwboot.1 manpage.

Series: 2
Signed-off-by: Vagrant Cascadian <vagrant@debian.org>
Reviewed-by: Marek BehĂșn <marek.behun@nic.cz>
2 years agodoc: board: apple: Mention M1 Ultra support
Mark Kettenis [Fri, 15 Apr 2022 12:19:28 +0000 (14:19 +0200)]
doc: board: apple: Mention M1 Ultra support

U-Boot now supports the M1 Ultra SoC as found in the new Mac Studio.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoMerge branch '2022-04-22-assorted-updates'
Tom Rini [Sat, 23 Apr 2022 12:06:28 +0000 (08:06 -0400)]
Merge branch '2022-04-22-assorted-updates'

- Add "-q" to fdt addr and use it in distro_bootcmd to make the user
  experience less scary reading in normal try/fail cases.
- Let the adc update an environment variable like many other commands do
- Fix TPL SEPARATE_BSS check when locating DTB
- Allow ":" in PXE file names again
- Two Apple M1 fixes