platform/kernel/u-boot.git
2 years agonvme: Fix error in nvme_setup_prps
Jon Lin [Tue, 19 Oct 2021 02:40:54 +0000 (10:40 +0800)]
nvme: Fix error in nvme_setup_prps

Consulting to "NVM Express® Base Specification, revision 2.0".

If more PRP List pages are required, then the last entry of
the PRP List contains the Page Base Address of the next PRP
List page. The next PRP List page shall be memory page aligned.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
2 years agonvme: Enable FUA
Jon Lin [Tue, 19 Oct 2021 02:40:53 +0000 (10:40 +0800)]
nvme: Enable FUA

Most NVME devcies maintain data in internal cache for an uncertain
times, and u-boot has no method to force NVME to flush cache.
So this patch adds FUA to avoid data loss caused by power off after data
programming.

Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
Reviewed-by: Stefan Agner <stefan@agner.ch>
2 years agoRFC: arm: pci: Add PCI cam support to PCI-E ecam driver
Alistair Delva [Wed, 20 Oct 2021 21:31:34 +0000 (21:31 +0000)]
RFC: arm: pci: Add PCI cam support to PCI-E ecam driver

When booting U-Boot in crosvm, the virtual machine emulates a PCI cam
device, not the PCI-E 'ecam' device normally seen on e.g. QEMU. This
PCI device can be supported with only trivial changes to the ecam
driver.

Instead of adding a completely new driver which is identical besides the
initialization step, add support for the PCI version to the existing
driver.

Signed-off-by: Alistair Delva <adelva@google.com>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Ram Muthiah <rammuthiah@google.com>
2 years agoconfigs: ast2600: Boot kernel FIT in DRAM
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:35 +0000 (14:17 +0800)]
configs: ast2600: Boot kernel FIT in DRAM

AST2600 leverages the FIT hash/signature verification to fulfill
secure boot trust chain. To improve the performance and save SW
code size for those crypto operations, the two HW crypto engine,
HACE and ACRY, are enabled.

However, both of the engines can only access to data stored in
DRAM space. Therefore, we need to move the FIT image into DRAM
before the booting.

This patch update the CONFIG_BOOTCOMMAND to execute the pre-defined
ENV variable which consists of FIT image copy to memory and booting.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agoconfigs: aspeed: Make EXTRA_ENV_SETTINGS board specific
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:34 +0000 (14:17 +0800)]
configs: aspeed: Make EXTRA_ENV_SETTINGS board specific

Move CONFIG_EXTRA_ENV_SETTINGS to board-specific
configuration headers.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agoconfigs: ast2600-evb: Enable SPL FIT support
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:33 +0000 (14:17 +0800)]
configs: ast2600-evb: Enable SPL FIT support

Enable SPL FIT image load and verification support.
The HW accelerated SHA is also available with the
newly added support of the HACE HW hash engine.

The SPL thumb build is also enabled to keep the binary
less than 64KB to fit into the Aspeed secure boot design.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
2 years agoast2600: spl: Locate load buffer in DRAM space
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:32 +0000 (14:17 +0800)]
ast2600: spl: Locate load buffer in DRAM space

Return CONFIG_SYS_LOAD_ADDR pointing to DRAM space for
spl_get_load_buffer() to allow generic SPL image loading
code (e.g. FIT and Ymodem) to store data in DRAM.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
2 years agoARM: dts: ast2600: Add ACRY to device tree
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:31 +0000 (14:17 +0800)]
ARM: dts: ast2600: Add ACRY to device tree

Add ACRY DTS node and enable it for AST2600 EVB.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
2 years agocrypto: aspeed: Add AST2600 ACRY support
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:30 +0000 (14:17 +0800)]
crypto: aspeed: Add AST2600 ACRY support

ACRY is designed to accelerate ECC/RSA digital signature
generation and verification.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agoclk: ast2600: Add RSACLK control for ACRY
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:29 +0000 (14:17 +0800)]
clk: ast2600: Add RSACLK control for ACRY

Add RSACLK enable for ACRY, the HW RSA/ECC crypto engine
of ASPEED AST2600 SoCs.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agoARM: dts: ast2600: Add HACE to device tree
Joel Stanley [Wed, 27 Oct 2021 06:17:28 +0000 (14:17 +0800)]
ARM: dts: ast2600: Add HACE to device tree

Add HACE DTS node and enable it for AST2600 EVB.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agocrypto: aspeed: Add AST2600 HACE support
Johnny Huang [Wed, 27 Oct 2021 06:17:27 +0000 (14:17 +0800)]
crypto: aspeed: Add AST2600 HACE support

Hash and Crypto Engine (HACE) is designed to accelerate the
throughput of hash data digest, and symmetric-key encryption.

Signed-off-by: Johnny Huang <johnny_huang@aspeedtech.com>
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoclk: ast2600: Add YCLK control for HACE
Joel Stanley [Wed, 27 Oct 2021 06:17:26 +0000 (14:17 +0800)]
clk: ast2600: Add YCLK control for HACE

Add YCLK enable for HACE, the HW hash engine of
ASPEED AST2600 SoCs.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
2 years agoaspeed: ast2600: Enlarge SRAM size
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:25 +0000 (14:17 +0800)]
aspeed: ast2600: Enlarge SRAM size

The AST2600 SRAM has been extended to 88KB since A1
chip revision. This patch updates the SRAM size to
offer more space for early stack/heap use.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
2 years agoimage: fit: Fix parameter name for hash algorithm
Chia-Wei Wang [Wed, 27 Oct 2021 06:17:24 +0000 (14:17 +0800)]
image: fit: Fix parameter name for hash algorithm

Fix inconsistent function parameter name of the hash algorithm.

Signed-off-by: Chia-Wei Wang <chiawei_wang@aspeedtech.com>
Fixes: 92055e138f2 ("image: Drop if/elseif hash selection in calculate_hash()")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agommc: mtk-sd: implement waiting for DAT0 line state
Julien Masson [Fri, 5 Nov 2021 13:34:14 +0000 (14:34 +0100)]
mmc: mtk-sd: implement waiting for DAT0 line state

With the recent changes on mmc driver, we saw that the boot is ~5 secs
longer compared to v2021.07 on mediatek platforms.

This regression is seen during mmc_init and caused by the following
patch [1].

Indeed since we did not support poll dat0, we fulfilled the condition
of [1] and a delay of 500 ms was added for every __mmc_switch call.

By adding the support of wait_dat0(), we now don't need to mdelay
during mmc_init anymore.

[1]: https://patchwork.ozlabs.org/project/uboot/patch/1629192034-64056-1-git-send-email-ye.li@nxp.com/

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agork3399: Don't enable the debug UART if there is no driver
Simon Glass [Wed, 3 Nov 2021 13:16:08 +0000 (07:16 -0600)]
rk3399: Don't enable the debug UART if there is no driver

Some boards do not enable SPL_SERIAL so cannot use the debug UART. Add
this condition to the code and drop use of the preprocessor while we are
here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
2 years agoarm: qemu: Enable the debug UART
Simon Glass [Wed, 3 Nov 2021 13:16:07 +0000 (07:16 -0600)]
arm: qemu: Enable the debug UART

Enable this to permit early debugging. Due to the way qmeu works, the
input clock can be zero and things still work.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoarm: Init the debug UART
Simon Glass [Wed, 3 Nov 2021 13:16:06 +0000 (07:16 -0600)]
arm: Init the debug UART

At present we don't init the debug UART in the generic ARM code, but
instead leave it to individual machines to handle. This is not the
way it is supposed to work.

Add the required init to the crt files. This ensures that the UART
is available as early as possible and that the announcement appears
when it should, if enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoarm: Fix some inconsistent debug-UART CONFIG options
Simon Glass [Wed, 3 Nov 2021 13:16:05 +0000 (07:16 -0600)]
arm: Fix some inconsistent debug-UART CONFIG options

A few boards enable CONFIG_DEBUG_UART_BOARD_INIT but do not define the
required init function. Fix this by disabling the debug UART.

With snow the debug UART is enabled but the driver CONFIG is not. Fix this
too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopci: Add standard PCIe ECAM macros
Pali Rohár [Wed, 3 Nov 2021 00:01:05 +0000 (01:01 +0100)]
pci: Add standard PCIe ECAM macros

Lot of PCIe controllers are using ECAM addressing. So add common ECAM
macros into U-Boot's pci.h header file which can be suitable for most
PCI controller drivers.

Replace custom ECAM address macros in every PCI controller driver by new
ECAM macros from U-Boot's pci.h header file.

Similar macros are defined also in Linux kernel. There is a small
difference between Linux and these new U-Boot macros.

U-Boot's PCIE_ECAM_OFFSET() takes device and function numbers in separate
arguments. Linux's PCIE_ECAM_OFFSET() takes device and function numbers
encoded in one argument. The reason is that U-Boot's PCI_DEVFN() macro is
different than Linux's PCI_SLOT() macro. So having device and function
numbers in separate arguments makes code more straightforward.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agopinctrl: Add Apple pinctrl driver
Mark Kettenis [Tue, 2 Nov 2021 17:21:57 +0000 (18:21 +0100)]
pinctrl: Add Apple pinctrl driver

This driver supports both pin muxing and GPIO support for the
pin control logic found on Apple SoCs.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
2 years agoaspeed: AST2600 Pinctrl Driver
Ryan Chen [Tue, 2 Nov 2021 02:17:52 +0000 (10:17 +0800)]
aspeed: AST2600 Pinctrl Driver

This driver uses Pinctrl framework and is compatible with the Linux
driver for AST2600.

Signed-off-by: Ryan Chen <ryan_chen@aspeedtech.com>
Signed-off-by: Dylan Hung <dylan_hung@aspeedtech.com>
2 years agoMerge branch '2021-11-16-env-rework' into next
Tom Rini [Wed, 17 Nov 2021 01:55:12 +0000 (20:55 -0500)]
Merge branch '2021-11-16-env-rework' into next

To quote Simon:

One barrier to completing the 7-year-long Kconfig migration is that
the default environment is implemented using ad-hoc CONFIG options.
At present U-Boot environment variables, and thus scripts, are defined
by CONFIG_EXTRA_ENV_SETTINGS.

It is not really feasible to move the environment to Kconfig as it is
hundreds of lines of text in some cases.

Even considering the current situation, it is painful to add large
amounts of text to the config-header file and dealing with quoting and
newlines is harder than it should be. It would be better if we could just
type the script into a text file and have it included by U-Boot.

This is already supported by the CONFIG_USE_DEFAULT_ENV_FILE feature. But
that does not support use of CONFIG options or comments, so is best suited
for use by other build systems wanting to define the U-Boot environment.

Add a feature that brings in a .env file associated with the board
config, if present. To use it, create a file board/<vendor>/<board>.env or
use CONFIG_ENV_SOURCE_FILE to set a filename.

The environment variables should be of the form "var=value". Values can
extend to multiple lines. This series converts the existing environment
documentation to rST and updates it to explain how to use this.

2 years agobootm: Tidy up use of autostart env var
Simon Glass [Fri, 22 Oct 2021 03:08:52 +0000 (21:08 -0600)]
bootm: Tidy up use of autostart env var

This has different semantics in different places. Go with the bootm method
and put it in a common function so that the behaviour is consistent in
U-Boot. Update the docs.

To be clear, this changes the way that 'bootelf' and standalone boot
work. Before, if autostart was set to "fred" or "YES", for example, they
would consider that a "yes". This may change behaviour for some boards,
but the only in-tree boards which mention autostart use "no" to disable
it, which will still work.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Wolfgang Denk <wd@denx.de>
2 years agosandbox: Update the test MAC/IP addresses
Simon Glass [Fri, 22 Oct 2021 03:08:51 +0000 (21:08 -0600)]
sandbox: Update the test MAC/IP addresses

These conflict with real-word addresses. Use locally administered
MAC addresses and a suitable IPv4 address from 192.0.2.0/24
(TEST-NET-1).

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Alexander Dahl <ada@thorsis.com>
2 years agodoc: Improve environment documentation further
Simon Glass [Fri, 22 Oct 2021 03:08:50 +0000 (21:08 -0600)]
doc: Improve environment documentation further

Make various other updates suggested during review of the rST conversion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agodoc: Improve environment documentation
Simon Glass [Fri, 22 Oct 2021 03:08:49 +0000 (21:08 -0600)]
doc: Improve environment documentation

Make various updates suggested during review of the rST conversion.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Suggested-by: Wolfgang Denk <wd@denx.de>
2 years agodoc: Mention CONFIG_DEFAULT_ENV_FILE
Simon Glass [Fri, 22 Oct 2021 03:08:48 +0000 (21:08 -0600)]
doc: Mention CONFIG_DEFAULT_ENV_FILE

Add mention of this option since it does a similar thing to the text
environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agosandbox: Use a text-based environment
Simon Glass [Fri, 22 Oct 2021 03:08:47 +0000 (21:08 -0600)]
sandbox: Use a text-based environment

Use a text file for the environment instead of the #define settings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoenv: Allow U-Boot scripts to be placed in a .env file
Simon Glass [Fri, 22 Oct 2021 03:08:46 +0000 (21:08 -0600)]
env: Allow U-Boot scripts to be placed in a .env file

At present U-Boot environment variables, and thus scripts, are defined
by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
to this file and dealing with quoting and newlines is harder than it
should be. It would be better if we could just type the script into a
text file and have it included by U-Boot.

Add a feature that brings in a .env file associated with the board
config, if present. To use it, create a file in a board/<vendor>
directory, typically called <board>.env and controlled by the
CONFIG_ENV_SOURCE_FILE option.

The environment variables should be of the form "var=value". Values can
extend to multiple lines. See the README under 'Environment Variables:'
for more information and an example.

In many cases environment variables need access to the U-Boot CONFIG
variables to select different options. Enable this so that the environment
scripts can be as useful as the ones currently in the board config files.
This uses the C preprocessor, means that comments can be included in the
environment using /* ... */

Also support += to allow variables to be appended to. This is needed when
using the preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Tested-by: Marek Behún <marek.behun@nic.cz>
2 years agodoc: Move environment documentation to rST
Simon Glass [Fri, 22 Oct 2021 03:08:45 +0000 (21:08 -0600)]
doc: Move environment documentation to rST

Move this from the README to rST format.

Drop i2cfast since it is obviously obsolete and breaks the formatting.
Other changes and improvements are in a following patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Marek Behún <marek.behun@nic.cz>
2 years agosandbox: Drop distro_boot
Simon Glass [Fri, 22 Oct 2021 03:08:44 +0000 (21:08 -0600)]
sandbox: Drop distro_boot

This is a complicated set of #defines and it is painful to convert to a
text file. We can (once pending patches are applied) provide the same
functionality with bootmethod. Drop this for sandbox to allow conversion
to a text-file environment.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
2 years agoPrepare v2022.01-rc2
Tom Rini [Mon, 15 Nov 2021 16:58:37 +0000 (11:58 -0500)]
Prepare v2022.01-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agousb: Make USB_MUSB_PIO_ONLY selected by USB_MUSB_SUNXI
Samuel Dionne-Riel [Wed, 27 Nov 2019 19:56:02 +0000 (14:56 -0500)]
usb: Make USB_MUSB_PIO_ONLY selected by USB_MUSB_SUNXI

This ensures the USB_MUSB_PIO_ONLY config is set to an apppropriate
value from the changes enabling USB_MUSB_GADGET does.

Namely, USB_MUSB_PIO_ONLY default to =y on USB_MUSB_SUNXI being y.

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
2 years agoDockerfile, CI: Update to latest "focal" tag
Tom Rini [Sat, 13 Nov 2021 23:37:00 +0000 (18:37 -0500)]
Dockerfile, CI: Update to latest "focal" tag

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoDockerfile: build swtpm
Heinrich Schuchardt [Tue, 9 Nov 2021 18:51:20 +0000 (19:51 +0100)]
Dockerfile: build swtpm

For testing the TPM drivers and the EFI_TCG2_PROTOCOL we need the tool
swtpm.

Once we move to Ubuntu Impish we can take libtpms from package libtpms-dev.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agoMerge tag 'dm-pull-13nov21' of https://source.denx.de/u-boot/custodians/u-boot-dm
Tom Rini [Sun, 14 Nov 2021 02:14:51 +0000 (21:14 -0500)]
Merge tag 'dm-pull-13nov21' of https://source.denx.de/u-boot/custodians/u-boot-dm

env tidy-ups
test fixes
binman fixes and ELF enhancements

2 years agoMerge tag 'efi-2022-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sat, 13 Nov 2021 23:13:35 +0000 (18:13 -0500)]
Merge tag 'efi-2022-01-rc2-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-01-rc2-2

UEFI:
* fix measurement of BootOrder variable for TCG2 protocol

TPM:
* TIS mmio driver. This driver supports QEMU's emulated TPM.

2 years agobinman: Fix replace subcommand help and comments
Jan Kiszka [Thu, 11 Nov 2021 07:13:30 +0000 (08:13 +0100)]
binman: Fix replace subcommand help and comments

Fix some copy&paste artifacts.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agobootstage: Differentiate boot progress kconfig entries
Jan Kiszka [Wed, 3 Nov 2021 14:09:36 +0000 (15:09 +0100)]
bootstage: Differentiate boot progress kconfig entries

Both U-Boot proper and SPL entries were using the same description.

Fixes: b55881dd ("bootstage: Add SPL support")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosandbox: fix sandbox_wdt_expire_now()
Heinrich Schuchardt [Tue, 2 Nov 2021 18:44:30 +0000 (19:44 +0100)]
sandbox: fix sandbox_wdt_expire_now()

With CONFIG_SYSRESET_WATCHDOG=y the sandbox can use a watchdog based system
reset.

To make this work calling sandbox_wdt_expire_now() must lead to a reset.

With this change we can test the development suggested in

  [PATCH 0/4] Improved sysreset/watchdog uclass integration
  https://lists.denx.de/pipermail/u-boot/2021-August/458656.html

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agotest/dm: fix watchdog test
Heinrich Schuchardt [Tue, 2 Nov 2021 18:44:29 +0000 (19:44 +0100)]
test/dm: fix watchdog test

For successful execution of the watchdog test we need both the GPIO as well
as the SANDBOX watchdog.

Avoid a build failure for CONFIG_WDT_GPIO=n.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoMakefile: Correct TPL rule for OF_REAL
Simon Glass [Mon, 1 Nov 2021 01:17:03 +0000 (19:17 -0600)]
Makefile: Correct TPL rule for OF_REAL

Correct an error in the tpl-dtb parameter to binman. At present the TPL
rule follows SPL but this is not correct, if TPL uses of-platdata, for
example.

Fixes: f99cbe4e867 ("fdt: Update Makefile rules with the new OF_REAL Kconfig")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoenv: Simplify env_get_default()
Marek Behún [Wed, 3 Nov 2021 23:23:23 +0000 (00:23 +0100)]
env: Simplify env_get_default()

Instead of pretending that we don't have environment to force searching
default environment in env_get_default(), get the data from the
default_environment[] buffer directly.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoenv: Fix env_get() when returning empty string using env_get_f()
Marek Behún [Wed, 3 Nov 2021 23:23:22 +0000 (00:23 +0100)]
env: Fix env_get() when returning empty string using env_get_f()

The env_get_f() function returns -1 on failure. Returning 0 means that
the variable exists, and is empty string.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoenv: Don't set ready flag if import failed in env_set_default()
Marek Behún [Wed, 3 Nov 2021 23:23:21 +0000 (00:23 +0100)]
env: Don't set ready flag if import failed in env_set_default()

Do not set GD_FLG_ENV_READY nor GD_FLG_ENV_DEFAULT if failed importing
in env_set_default().

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Support updating the dtb in an ELF file
Simon Glass [Thu, 4 Nov 2021 03:09:18 +0000 (21:09 -0600)]
binman: Support updating the dtb in an ELF file

WIth EFI we must embed the devicetree in an ELF image so that it is loaded
as part of the executable file. We want it to include the binman
definition in there also, which in some cases cannot be created until the
ELF (u-boot) is built. Add an option to binman to support writing the
updated dtb to the ELF file u-boot.out

This is useful with the EFI app, which is always packaged as an ELF file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Tidy up comments on _DoTestFile()
Simon Glass [Thu, 4 Nov 2021 03:09:17 +0000 (21:09 -0600)]
binman: Tidy up comments on _DoTestFile()

The comment for this function is missing an argument and the return value.
Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Support reading the offset of an ELF-file symbol
Simon Glass [Thu, 4 Nov 2021 03:09:16 +0000 (21:09 -0600)]
binman: Support reading the offset of an ELF-file symbol

Binman needs to be able to update the contents of an ELF file after it has
been build. To support this, add a function to locate the position of a
symbol's contents within the file.

Fix the comments on bss_data.c and Symbol while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agobinman: Report an error if test files fail to compile
Simon Glass [Thu, 4 Nov 2021 03:09:15 +0000 (21:09 -0600)]
binman: Report an error if test files fail to compile

At present any error from the 'make' command is silently swallowed by the
test system. Fix this by showing it when detected.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agopatman: Use a ValueError exception if tools.Run() fails
Simon Glass [Thu, 4 Nov 2021 03:09:14 +0000 (21:09 -0600)]
patman: Use a ValueError exception if tools.Run() fails

The Exception base class is a very vague and could be confusing to the
test system. Use the more specific ValueError exception instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 12 Nov 2021 23:37:42 +0000 (23:37 +0000)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2021-11-12-Kconfig-migrations'
Tom Rini [Fri, 12 Nov 2021 23:33:12 +0000 (18:33 -0500)]
Merge branch '2021-11-12-Kconfig-migrations'

- An assortment of "finish migrating .." symbol patches.  This will help
  make it harder for migrated symbols to end up again in board config.h
  files.

2 years agoConvert CONFIG_LAST_STAGE_INIT to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:51 +0000 (22:59 -0500)]
Convert CONFIG_LAST_STAGE_INIT to Kconfig

This converts the following to Kconfig:
   CONFIG_LAST_STAGE_INIT

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoRemove CONFIG_SERIAL_MULTI
Tom Rini [Mon, 8 Nov 2021 03:59:50 +0000 (22:59 -0500)]
Remove CONFIG_SERIAL_MULTI

This symbol has been functionally dead for a long time.  Remove the last
and recent re-introductions of setting it, and update the whitelist so
it will not be re-introduced again.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_PL011_SERIAL et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:49 +0000 (22:59 -0500)]
Convert CONFIG_PL011_SERIAL et al to Kconfig

This converts the following to Kconfig:
   CONFIG_PL011_SERIAL
   CONFIG_PL01X_SERIAL

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_MACB to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:48 +0000 (22:59 -0500)]
Convert CONFIG_MACB to Kconfig

This converts the following to Kconfig:
   CONFIG_MACB

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_MD5 to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:47 +0000 (22:59 -0500)]
Convert CONFIG_MD5 to Kconfig

This converts the following to Kconfig:
   CONFIG_MD5

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_MX6 et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:46 +0000 (22:59 -0500)]
Convert CONFIG_MX6 et al to Kconfig

This converts the following to Kconfig:
   CONFIG_MX6
   CONFIG_MX7

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_IMX_BOOTAUX et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:45 +0000 (22:59 -0500)]
Convert CONFIG_IMX_BOOTAUX et al to Kconfig

This converts the following to Kconfig:
   CONFIG_IMX_BOOTAUX
   CONFIG_IMX_THERMAL

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_PROMPT et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:44 +0000 (22:59 -0500)]
Convert CONFIG_SYS_PROMPT et al to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_PROMPT
   CONFIG_SYS_PROMPT_HUSH_PS2

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_I2C_EDID et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:43 +0000 (22:59 -0500)]
Convert CONFIG_I2C_EDID et al to Kconfig

This converts the following to Kconfig:
   CONFIG_I2C_EDID
   CONFIG_I2C_EEPROM

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_PHYLIB et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:42 +0000 (22:59 -0500)]
Convert CONFIG_PHYLIB et al to Kconfig

This converts the following to Kconfig:
   CONFIG_PHYLIB
   CONFIG_PHY_ATHEROS
   CONFIG_PHY_GIGE
   CONFIG_MII

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_MISC_INIT_F et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:41 +0000 (22:59 -0500)]
Convert CONFIG_MISC_INIT_F et al to Kconfig

This converts the following to Kconfig:
   CONFIG_MISC_INIT_F
   CONFIG_MISC_INIT_R

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_TRACE et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:40 +0000 (22:59 -0500)]
Convert CONFIG_TRACE et al to Kconfig

This converts the following to Kconfig:
   CONFIG_TRACE
   CONFIG_TRACE_BUFFER_SIZE
   CONFIG_TRACE_EARLY
   CONFIG_TRACE_EARLY_ADDR
   CONFIG_TRACE_EARLY_SIZE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SYS_CONSOLE_IS_IN_ENV to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:39 +0000 (22:59 -0500)]
Convert CONFIG_SYS_CONSOLE_IS_IN_ENV to Kconfig

This converts the following to Kconfig:
   CONFIG_SYS_CONSOLE_IS_IN_ENV

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_ENV_IS_IN_SPI_FLASH et al to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:38 +0000 (22:59 -0500)]
Convert CONFIG_ENV_IS_IN_SPI_FLASH et al to Kconfig

This converts the following to Kconfig:
   CONFIG_ENV_IS_IN_SPI_FLASH
   CONFIG_ENV_IS_NOWHERE
   CONFIG_ENV_OFFSET
   CONFIG_ENV_OVERWRITE
   CONFIG_ENV_SECT_SIZE
   CONFIG_SYS_MMC_ENV_DEV
   CONFIG_SYS_MMC_ENV_PART

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_FSL_USDHC to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:37 +0000 (22:59 -0500)]
Convert CONFIG_FSL_USDHC to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_USDHC

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_FSL_LAYERSCAPE to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:36 +0000 (22:59 -0500)]
Convert CONFIG_FSL_LAYERSCAPE to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_LAYERSCAPE

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_BITBANGMII to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:35 +0000 (22:59 -0500)]
Convert CONFIG_BITBANGMII to Kconfig

This converts the following to Kconfig:
   CONFIG_BITBANGMII

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_DOS_PARTITION to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:34 +0000 (22:59 -0500)]
Convert CONFIG_DOS_PARTITION to Kconfig

This converts the following to Kconfig:
   CONFIG_DOS_PARTITION

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_E1000 to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:33 +0000 (22:59 -0500)]
Convert CONFIG_E1000 to Kconfig

This converts the following to Kconfig:
   CONFIG_E1000

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_ARCH_CPU_INIT to Kconfig
Tom Rini [Mon, 8 Nov 2021 03:59:32 +0000 (22:59 -0500)]
Convert CONFIG_ARCH_CPU_INIT to Kconfig

This converts the following to Kconfig:
   CONFIG_ARCH_CPU_INIT

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2021-11-12-assorted-updates'
Tom Rini [Fri, 12 Nov 2021 15:14:24 +0000 (10:14 -0500)]
Merge branch '2021-11-12-assorted-updates'

- A number of pxe related cleanups and related re-organization.
- A few related pxe/sysboot/extlinux improvements
- Remove some dead code.
- Update Azure to use a newer Windows build environment
- Add a .get_maintainer.conf file
- A few minor TI SoC platform updates

2 years agortc: ds1337: fix compatible string typo
Clemens Gruber [Fri, 5 Nov 2021 13:46:50 +0000 (14:46 +0100)]
rtc: ds1337: fix compatible string typo

The driver supports the ds1339 as well, which was probably intended by
the author but prevented by a typo. Fix the typo.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
2 years agoboards: siemens: iot2050: Ignore network errors during bootstage tracking
Jan Kiszka [Wed, 3 Nov 2021 14:12:30 +0000 (15:12 +0100)]
boards: siemens: iot2050: Ignore network errors during bootstage tracking

We need to filter out NET_ETH_START errors because we have to enable
networking in order to propagate the MAC addresses to the DT while there
is no network driver for the prueth in U-Boot yet.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2 years agoboards: siemens: iot2050: Re-enable bootstage reporting
Jan Kiszka [Wed, 3 Nov 2021 14:11:53 +0000 (15:11 +0100)]
boards: siemens: iot2050: Re-enable bootstage reporting

This got lost while fixing up the condition in
board/siemens/iot2050/board.c

Fixes: b55881dd ("bootstage: Add SPL support")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoARM: dts: am335x-chiliboard: add /chosen/tick-timer
Marcin Niestroj [Tue, 2 Nov 2021 13:41:06 +0000 (14:41 +0100)]
ARM: dts: am335x-chiliboard: add /chosen/tick-timer

Commit 4b2be78ab66c ("time: Fix get_ticks being non-monotonic") has
broken boot on chiliboard platform, as it requires '/chosen/tick-timer'
in device-tree. This resulted in following panic message:

  Could not initialize timer (err -19)

Provide missing chosen property in device-tree to fix chiliboard
support.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2 years agoget_maintainer.pl: add .get_maintainer.conf
Michael Walle [Sun, 31 Oct 2021 22:38:12 +0000 (23:38 +0100)]
get_maintainer.pl: add .get_maintainer.conf

Since commit e57c7c5c4282 ("get_maintainer.pl: update from Linux kernel
v5.13-rc6") only the top level MAINTAINERS file is used. This is because
this commit (accidentally) disabled the search of MAINTAINERS files
(find_maintainer_files is set to 0 again). Before that, commit
b79372ae94fb ("scripts/get_maintainer.pl: enable find_maintainer_files")
explicitly enabled that feature. Nowadays, we also have to set
maintainer_path to a directory.

To fix it and enable recursive search of MAINTAINERS, create a
configuration file to set these two variables.

Signed-off-by: Michael Walle <michael@walle.cc>
2 years agoAzure: Move to windows-2019
Tom Rini [Sun, 31 Oct 2021 17:24:42 +0000 (13:24 -0400)]
Azure: Move to windows-2019

As per https://github.com/actions/virtual-environments/issues/4312 the
Windows-2016 environments are scheduled for deprecation and removal in
early 2022.  Move to windows-2019 now to avoid this (Visual Studio 2019
is included here, hence the tag naming scheme change).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
2 years agoRemove LYNX KDI remainders
Thomas Huth [Tue, 26 Oct 2021 12:31:18 +0000 (14:31 +0200)]
Remove LYNX KDI remainders

The last board that used to set CONFIG_LYNXKDI has been removed in
commit 242836a893ae ("powerpc: ppc4xx: remove pcs440ep support"),
doc/README.lynxkdi only talks about a MPC8260 board being supported,
and the mpc8260 support has been removed four years ago in commit
2eb48ff7a210d ("powerpc, 8260: remove support for mpc8260") already,
and common/lynxkdi.c only consists of an "#error" statement these
days, so it seems like the LYNX KDI code is dead code nowadays.
Let's remove it now.

Signed-off-by: Thomas Huth <thuth@redhat.com>
2 years agopxe: Allow calling the pxe_get logic directly
Simon Glass [Thu, 14 Oct 2021 18:48:11 +0000 (12:48 -0600)]
pxe: Allow calling the pxe_get logic directly

Refactor this code so that we can call the 'pxe get' command without going
through the command-line interpreter. This makes it easier to get the
information we need, without going through environment variables.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agodoc: Move distro boot doc to rST
Simon Glass [Thu, 14 Oct 2021 18:48:10 +0000 (12:48 -0600)]
doc: Move distro boot doc to rST

Move this over to the new rST format.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Refactor sysboot to have one helper
Simon Glass [Thu, 14 Oct 2021 18:48:09 +0000 (12:48 -0600)]
pxe: Refactor sysboot to have one helper

The only difference between the three helpers is the filesystem type.
Factor this out and call the filesystem functions directly, instead of
through the command-line interpreter. This allows the file size to be
obtained directly, instead of via an environment variable.

We cannot do the same thing with PXE's tftpboot since there is no API
at present to obtain information about the file that was read. So there
is no point in changing pxe_getfile_func to use a ulong for the address,
for example.

This is as far as the refactoring can go for the present.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Return the file size from the getfile() function
Simon Glass [Thu, 14 Oct 2021 18:48:08 +0000 (12:48 -0600)]
pxe: Return the file size from the getfile() function

It is pretty strange that the pxe code uses the 'filesize' environment
variable find the size of a file it has just read.

Partly this is because it uses the command-line interpreter to parse its
request to load the file.

As a first step towards unwinding this, return it directly from the
getfile() function. This makes the code a bit longer, for now, but will be
cleaned up in future patches.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agolib: Add a function to convert a string to a hex value
Simon Glass [Thu, 14 Oct 2021 18:48:07 +0000 (12:48 -0600)]
lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
2 years agolib: Add tests for simple_itoa()
Simon Glass [Thu, 14 Oct 2021 18:48:06 +0000 (12:48 -0600)]
lib: Add tests for simple_itoa()

Add test and a comment for this function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
2 years agopxe: Drop get_bootfile_path()
Simon Glass [Thu, 14 Oct 2021 18:48:05 +0000 (12:48 -0600)]
pxe: Drop get_bootfile_path()

This function no longer makes sense, since it is pretty easy to prepend
the boot directory to the filename. Drop it and update its only caller.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Clean up the use of bootfile
Simon Glass [Thu, 14 Oct 2021 18:48:04 +0000 (12:48 -0600)]
pxe: Clean up the use of bootfile

The 'bootfile' environment variable is read in the bowels of pxe_util to
provide a directory to which all loaded files are relative.

This is not obvious from the API to PXE and it is strange to make the
caller set an environment variable rather than pass this as a parameter.

The code is also convoluted, which this feature implemented by
get_bootfile_path().

Update the API to improve this. Unfortunately this means that
pxe_setup_ctx() can fail, so add error checking.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Move common parsing coding into pxe_util
Simon Glass [Thu, 14 Oct 2021 18:48:03 +0000 (12:48 -0600)]
pxe: Move common parsing coding into pxe_util

Both the syslinux and pxe commands use essentially the same code to parse
and run extlinux.conf files. Move this into a common function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Tidy up code style a little in pxe_utils
Simon Glass [Thu, 14 Oct 2021 18:48:02 +0000 (12:48 -0600)]
pxe: Tidy up code style a little in pxe_utils

There are a few more blank lines than makes sense for readability. Also
free() handles a NULL pointer so drop the pointless checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Tidy up some comments in pxe_utils
Simon Glass [Thu, 14 Oct 2021 18:48:01 +0000 (12:48 -0600)]
pxe: Tidy up some comments in pxe_utils

Some of these functions are a big vague in the comments. Tidy them up a
bit.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Move pxe_utils files
Simon Glass [Thu, 14 Oct 2021 18:48:00 +0000 (12:48 -0600)]
pxe: Move pxe_utils files

Move the header file into the main include/ directory so we can use it
from the bootmethod code. Move the C file into boot/ since it relates to
booting.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Tidy up the is_pxe global
Simon Glass [Thu, 14 Oct 2021 18:47:59 +0000 (12:47 -0600)]
pxe: Tidy up the is_pxe global

Move this into the context to avoid a global variable. Also rename it
since the current name does not explain what it actually affects.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Add a userdata field to the context
Simon Glass [Thu, 14 Oct 2021 18:47:58 +0000 (12:47 -0600)]
pxe: Add a userdata field to the context

Allow the caller to provide some info which is passed back to the
readfile() method.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Move do_getfile() into the context
Simon Glass [Thu, 14 Oct 2021 18:47:57 +0000 (12:47 -0600)]
pxe: Move do_getfile() into the context

Rather than having a global variable, pass the function as part of the
context.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Use a context pointer
Simon Glass [Thu, 14 Oct 2021 18:47:56 +0000 (12:47 -0600)]
pxe: Use a context pointer

At present the PXE functions pass around a pointer to command-table entry
which is very strange. It is only needed in a few places and it is odd to
pass around a data structure from another module in this way.

For bootmethod we will need to provide some context information when
reading files.

Create a PXE context struct to hold the command-table-entry pointer and
pass that around instead. We can then add more things to the context as
needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agopxe: Move API comments to the header files
Simon Glass [Thu, 14 Oct 2021 18:47:55 +0000 (12:47 -0600)]
pxe: Move API comments to the header files

Put the function comments in the header file so that the full API can we
examined in one place.

Expand the comments to cover parameters and return values.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
2 years agoCreate a new boot/ directory
Simon Glass [Thu, 14 Oct 2021 18:47:54 +0000 (12:47 -0600)]
Create a new boot/ directory

Quite a lot of the code in common/relates to booting and images. Before
adding more it seems like a good time to move the code into its own
directory.

Most files with 'boot' or 'image' in them are moved, except:

- autoboot.c which relates to U-Boot automatically running a script
- bootstage.c which relates to U-Boot timing

Drop the removal of boot* files from the output directory, since this
interfers with the symlinks created by tools and there does not appear
to be any such file from my brief testing.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>