platform/kernel/u-boot.git
2 years agoMerge branch '2022-04-12-two-more-fixes'
Tom Rini [Tue, 12 Apr 2022 13:52:08 +0000 (09:52 -0400)]
Merge branch '2022-04-12-two-more-fixes'

- Bugfix in cpu_to_be32_array() and re-use $(UBOOTINCLUDE) in
  dtc_cpp_flags

2 years agoinclude/linux/byteorder: fix cpu_to_be32_array()
Heinrich Schuchardt [Thu, 20 May 2021 15:36:03 +0000 (17:36 +0200)]
include/linux/byteorder: fix cpu_to_be32_array()

In cpu_to_be32_array() and be32_to_cpu_array() we should not compare an int
counter to a size_t parameter. Correct the type of the counter.  This
exists in upstream as b4c80629c5c9 ("include/linux/byteorder/generic.h:
fix index variables").

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoMakefile.lib: Re-use $(UBOOTINCLUDE) in dtc_cpp_flags
Andy Shevchenko [Wed, 30 Mar 2022 09:30:04 +0000 (12:30 +0300)]
Makefile.lib: Re-use $(UBOOTINCLUDE) in dtc_cpp_flags

As in ASL case use same basic set of the inclusions.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2 years agolinux/mtd/mtd.h: Add <dm/ofnode.h>
Tom Rini [Mon, 11 Apr 2022 21:11:21 +0000 (17:11 -0400)]
linux/mtd/mtd.h: Add <dm/ofnode.h>

We need to know where the typedef of 'ofnode' comes from.

Fixes: c86a4de8df61 ("mtd: Add flash_node in struct mtd_info")
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-11-assorted-updates'
Tom Rini [Mon, 11 Apr 2022 19:59:45 +0000 (15:59 -0400)]
Merge branch '2022-04-11-assorted-updates'

- Assorted fixes/updates including K3-J721s2 timer dts fix, assorted
  crypto improvements, led-pwm driver, improve handling of mtd
  partitions, align mkimage hash output buffers and backport a UBIFS
  bugfix from Linux.

2 years agoahci: add PCI bindings for Marvell 88SE6121/45 SATA controllers
Hajo Noerenberg [Mon, 28 Mar 2022 13:49:08 +0000 (15:49 +0200)]
ahci: add PCI bindings for Marvell 88SE6121/45 SATA controllers

Add AHCI PCI bindings for Marvell 88SE6121/45 SATA controllers.

The 88SE6121 controller is used, for example, in the Seagate Blackarmor NAS440 or the Iomega ix4-200d NAS.

As Pali Rohár explained [1], these controllers do not match the standard AHCI class code and therefore require an explizit PCI binding. The Linux kernel also uses this approach [2].

[1] https://lists.denx.de/pipermail/u-boot/2022-March/479197.html
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/ata/ahci.c?h=v5.17#n557

Signed-off-by: Hajo Noerenberg <hajo-uboot@noerenberg.de>
Reviewed-by: Pali Rohár <pali@kernel.org>
2 years agoubifs: Fix journal replay wrt. xattr nodes
Ville Baillie [Mon, 28 Mar 2022 09:13:43 +0000 (09:13 +0000)]
ubifs: Fix journal replay wrt. xattr nodes

Backport commit 1cb51a15b576 ("ubifs: Fix journal replay wrt. xattr
nodes") from the Linux Kernel, which has the following Signed-off-by
line:
Signed-off-by: Richard Weinberger <richard@nod.at>
For U-Boot, after comapring with the upstream commit:
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoimage: fit: Align hash output buffers
Sean Anderson [Thu, 24 Mar 2022 15:26:11 +0000 (11:26 -0400)]
image: fit: Align hash output buffers

Hardware-accelerated hash functions require that the input and output
buffers be aligned to the minimum DMA alignment. memalign.h helpfully
provides a macro just for this purpose. It doesn't exist on the host,
but we don't need to be aligned there either.

Fixes: 5dfb521386 ("[new uImage] New uImage low-level API")
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agocmd: pxe_utils: sysboot: replace cls command by video_clear in PXE parser
Patrick Delaunay [Tue, 22 Mar 2022 16:08:43 +0000 (17:08 +0100)]
cmd: pxe_utils: sysboot: replace cls command by video_clear in PXE parser

Since the commit bfaa51dd4adf ("cmd: add serial console support
for the cls command") the cls command is not enough to clear the
video display when ANSI console is activated.

This patch clears the video device with the video_clear() API
before to display the bitmap used for the PXE background.

This patch avoids to display the LOGO, activated by default with
commit 7a8555d87136 ("video: Show the U-Boot logo by default").

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agomtd: Update the way partitions are parsed
Patrice Chotard [Mon, 21 Mar 2022 08:13:37 +0000 (09:13 +0100)]
mtd: Update the way partitions are parsed

In case mtd_info's dev field is not populated (raw nand's case),
use the flash_node new field which reference the DT flash node where
can be found "partitions" node with "fixed-partitions" compatible.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Farhan Ali <farhan.ali@broadcom.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
2 years agomtd: Add flash_node in struct mtd_info
Patrice Chotard [Mon, 21 Mar 2022 08:13:36 +0000 (09:13 +0100)]
mtd: Add flash_node in struct mtd_info

Currently, add_mtd_partitions_of() can be used only if dev field of
mtd_info struct is populated. It's the case, for example, for a spi nor
flash, which has a DT compatible "jedec,spi-nor" and an associated
device. mtd->dev is populated in spi_nor_scan().

But in case of a raw nand node, mtd_info's dev field can't be populated
as flash node has no compatible, so no associated device.
add_mtd_partitions_of() can't be used to parse "partitions" subnode.

To remove this constraint, add an ofnode field in mtd_info struct
which reference the DT flash node. This new field is populated by
nand_scan_tail(). This new field will be used by add_mtd_partitions_of()
to parse the flash node for "partitions" defined in DT.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: Farhan Ali <farhan.ali@broadcom.com>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Marek Behun <marek.behun@nic.cz>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Wolfgang Denk <wd@denx.de>
2 years agodrivers: led: bcm6858: Set a default brightness when probing LEDs
Paul HENRYS [Thu, 17 Mar 2022 09:29:47 +0000 (10:29 +0100)]
drivers: led: bcm6858: Set a default brightness when probing LEDs

When probing the LEDs, a default brightness is set based on settings
from the U-Boot device tree, i.e. the 'default-brightness' property
of the LED nodes. If that property is not present, the default
maximum brightness is set.
This should make sure the LED controller's registers affecting the
brightness are correctly initialized and should give a consistent
behaviour.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2 years agospl: allow boot from first bootable partition
Jérôme Carretero [Tue, 15 Mar 2022 20:34:51 +0000 (16:34 -0400)]
spl: allow boot from first bootable partition

This was implemented in order to get dual-slot bootloader
partitions on the BeagleBone Black, whose MLO boots from
the first bootable partition: MLO chainloads u-boot in the
same way.

Signed-off-by: Jérôme Carretero <cJ-uboot@zougloub.eu>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 years agolib/crypto: support sha384/sha512 in x509/pkcs7
Dhananjay Phadke [Tue, 15 Mar 2022 17:19:32 +0000 (10:19 -0700)]
lib/crypto: support sha384/sha512 in x509/pkcs7

Set digest_size SHA384 and SHA512 algorithms in pkcs7 and x509,
(not set by ported linux code, but needed by __UBOOT__ part).

EFI_CAPSULE_AUTHENTICATE doesn't select these algos but required for
correctness if certificates contain sha384WithRSAEncryption or
sha512WithRSAEncryption OIDs.

Signed-off-by: Dhananjay Phadke <dphadke@linux.microsoft.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 years agoled: led_pwm: Add a driver for LEDs connected to PWM
Ivan Vozvakhov [Sat, 12 Mar 2022 10:03:14 +0000 (13:03 +0300)]
led: led_pwm: Add a driver for LEDs connected to PWM

Add a driver which allows to use of LEDs connected
to PWM (Linux compatible).
MAINTAINERS: add i.vozvakhov as a maintainer of leds-pwm
C(required during new functionality adding).

Signed-off-by: Ivan Vozvakhov <i.vozvakhov@corp.mail.ru>
2 years agolib: rsa: Update function padding_pss_verify (any-salt)
SESA644425 [Wed, 9 Mar 2022 09:27:17 +0000 (01:27 -0800)]
lib: rsa: Update function padding_pss_verify (any-salt)

Modify function to support any salt length instead of max
length only. Function now detects salt length by parsing
the content of db buffer. Note that it works with (but is
not limited to) zero-length, digest-length and max-length

Signed-off-by: SESA644425 <gioja.hermann@non.se.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolib: rsa: Leverage existing data buffer instead of systematic copy
SESA644425 [Wed, 9 Mar 2022 09:27:16 +0000 (01:27 -0800)]
lib: rsa: Leverage existing data buffer instead of systematic copy

Prior to introduction of modifications in rsassa_pss functions
related to padding verification, doing a pass to reduce memory
consumption of function by replacing memory copies of parts of
const buffer by pointers to the original buffer (masked_db and
h are subparts of msg buffer which is declared const, salt is a
subpart of db which is a working buffer, unmodified after being
filled). New pointers scope is limited to the function where
they are declared (not returned to caller by any mean), zeroing
risk of memory fault related to the change.

Signed-off-by: SESA644425 <gioja.hermann@non.se.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agolib: rsa: Fix const-correctness of rsassa_pss functions
SESA644425 [Wed, 9 Mar 2022 09:27:15 +0000 (01:27 -0800)]
lib: rsa: Fix const-correctness of rsassa_pss functions

Prior to introduction of modifications in rsassa_pss functions
related to padding verification, doing a pass to update
const-correctness in targeted functions to comply with
coding-rules and avoid const-cast

Signed-off-by: SESA644425 <gioja.hermann@non.se.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoARM: dts: k3-j721s2: Correct timer frequency
Vignesh Raghavendra [Mon, 7 Mar 2022 09:25:51 +0000 (14:55 +0530)]
ARM: dts: k3-j721s2: Correct timer frequency

MCU Timer0 runs at 250MHz, and the clock-frequency defined in DT appears
incorrect.

Without this delays in R5 SPL are 10x off.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
2 years agoMerge branch '2022-04-11-add-OP-TEE-rng'
Tom Rini [Mon, 11 Apr 2022 14:46:16 +0000 (10:46 -0400)]
Merge branch '2022-04-11-add-OP-TEE-rng'

- Add support for OP-TEE providing an RNG to use, and enable on some
  stm32mp15 configurations.

2 years agoconfigs: add support of OPTEE RNG in stm32mp15 defconfig
Patrick Delaunay [Tue, 29 Mar 2022 12:21:25 +0000 (14:21 +0200)]
configs: add support of OPTEE RNG in stm32mp15 defconfig

When the RNG device is secured with OP-TEE, it is only accessible with
the HWRNG TA, the CONFIG_RNG_OPTEE is needed for STM32MP15 targets
with OP-TEE support.

The probe of this RNG driver fails when the TA is not available in OP-TEE
and the previous driver can be used, as CONFIG_RNG_STM32MP1 is activated
and when the associated node is activated in the device tree with:

&rng1 {
status = "okay";
};

When the RNG is used in OP-TEE, this node should be deactivated in
the Linux and U-Boot device tree.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agotee: optee: bind rng optee driver
Patrick Delaunay [Tue, 29 Mar 2022 12:21:24 +0000 (14:21 +0200)]
tee: optee: bind rng optee driver

In U-Boot, the discovery of TA based on its UUID on the TEE bus is
not supported.

This patch only binds the driver associated to the new supported
OP-TEE TA = TA_HWRNG when this driver is enable.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agorng: add OP-TEE based Random Number Generator
Patrick Delaunay [Tue, 29 Mar 2022 12:21:23 +0000 (14:21 +0200)]
rng: add OP-TEE based Random Number Generator

Add driver for OP-TEE based Random Number Generator on ARM SoCs
where hardware entropy sources are not accessible to normal world
and the RNG service is provided by a HWRNG Trusted Application (TA).

This driver is based on the linux driver: char/hw_random/optee-rng.c

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2 years agoMerge branch '2022-04-11-initial-valgrind-support'
Tom Rini [Mon, 11 Apr 2022 14:15:06 +0000 (10:15 -0400)]
Merge branch '2022-04-11-initial-valgrind-support'

To quote the author:
This series adds support for running valgrind against U-Boot's internal
malloc. This allows for much more useful reports to be generated.

Some example output of valgrind run against u-boot/master with this
branch applied may be found at [1]. Note that valgrind gives up around
acpi.  This feature still needs a lot of work on suppressions/hints to
filter out the noise properly.

[1] https://gist.githubusercontent.com/Forty-Bot/199bf06f9cdd6871e54f8f484c16e111/raw/2a2f99108eef84b48e27a54332f3f71f4e2e5342/gistfile1.txt

2 years agodoc: sandbox: Document how to run sandbox with valgrind
Sean Anderson [Wed, 23 Mar 2022 18:04:50 +0000 (14:04 -0400)]
doc: sandbox: Document how to run sandbox with valgrind

This documents how to get more detailed results from valgrind made possible
by the last two commits.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agomalloc: Annotate allocator for valgrind
Sean Anderson [Wed, 23 Mar 2022 18:04:49 +0000 (14:04 -0400)]
malloc: Annotate allocator for valgrind

This annotates malloc and friends so that valgrind can track the heap. To
do this, we need to follow a few rules:

* Call VALGRIND_MALLOCLIKE_BLOCK whenever we malloc something
* Call VALGRIND_FREELIKE_BLOCK whenever we free something (generally after
  we have done our bookkeeping)
* Call VALGRIND_RESIZEINPLACE_BLOCK whenever we change the size of an
  allocation. We don't record the original request size of a block, and
  neither does valgrind. For this reason, we pretend that the old size of
  the allocation was for 0 bytes. This marks the whole allocaton as
  undefined, so in order to mark all bits correctly, we must make the whole
  new allocation defined with VALGRIND_MAKE_MEM_DEFINED. This may cause us
  to miss some invalid reads, but there is no way to detect these without
  recording the original size of the allocation.

In addition to the above, dlmalloc itself tends to make a lot of accesses
which we know are safe, but which would be unsafe outside of dlmalloc. For
this reason, we provide a suppression file which ignores errors ocurring in
dlmalloc.c

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoAdd valgrind headers to U-Boot
Sean Anderson [Wed, 23 Mar 2022 18:04:48 +0000 (14:04 -0400)]
Add valgrind headers to U-Boot

Valgrind uses magic code sequences to define an ABI that the client may use
to request behavior from the host. In particular, this may be used to
inform valgrind about custom allocators, such as the one used in U-Boot.

This adds headers defining these sequences to U-Boot. It also adds a config
option to disable emission of these sequences entirely, in the (likely)
event that the user does not wish to use valgrind. Note that this option is
called NVALGRIND upstream, but was renamed (and inverted) to
CONFIG_VALGRIND. Aside from this and the conversion of a few instances of
VALGRIND_DO_CLIENT_REQUEST_EXPR to STMT, these headers are unmodified.

These headers were copied from valgrind 3.16.1-4 as distributed in Arch
Linux. They are licensed with the bzip2 1.16 license. This appears to be a
BSD license with some clauses from Zlib.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoKconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ
Peng Fan [Mon, 11 Apr 2022 09:07:04 +0000 (17:07 +0800)]
Kconfig: Fix SYS_MALLOC_F_LEN for i.MX8MQ

i.MX8MQ use SYS_MALLOC_F_LEN 0x2000, not 0x10000. The OCRAM_S only has
32KB memory, use 0x10000 will make SPL not bootable.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Fabio Estevam <festevam@denx.de>
2 years agoMerge tag 'efi-2022-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 10 Apr 2022 15:21:39 +0000 (11:21 -0400)]
Merge tag 'efi-2022-07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request for efi-2022-07-rc1

Documentation:

* Describe how enable DM_SERIAL for a board

UEFI

* Preparatory patches for better integration of DM and UEFI
* Use sysreset after capsule updates instead of do_reset
* Allow to disable persisting non-volatile variables

2 years agoRevert "env: Load env when ENV_IS_NOWHERE is only location selected"
Marek Vasut [Sun, 10 Apr 2022 04:46:52 +0000 (06:46 +0200)]
Revert "env: Load env when ENV_IS_NOWHERE is only location selected"

This reverts commit 8d61237edbf6314a701cf78da2c5893a73ff5438.

This commit broke environment on literally every board I have access
to, with this revert in place, environment works as it should again.
The problem I observe with this patch is that saved environment in
either SPI NOR or eMMC is never used, the system always falls back
to default environment. The 'saveenv' command does succeed, but then
after reset, the default env is again used.

Furthermore, the commit introduced duplicate code in env_init(), this:
"
if (!prio) {
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = ENV_INVALID;

return 0;
}

if (ret == -ENOENT) {
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = ENV_INVALID;

return 0;
}
"

Furthermore, the commit is missing DCO SoB line.

Also note that upstream does not support UltraZed EG board, so
this might have been a patch pulled from downstream which did
depend on some other downstream behavior.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Felix.Vietmeyer@jila.colorado.edu <felix.vietmeyer@jila.colorado.edu>
Cc: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-08-gpio-updates'
Tom Rini [Sun, 10 Apr 2022 15:19:14 +0000 (11:19 -0400)]
Merge branch '2022-04-08-gpio-updates'

- Add PCA957X GPIO support, enable GPIO hogging in SPL, add
  gpio_request_by_line_name() for later use and add some pytests for
  'gpio'

2 years agodm: add tag support
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:46 +0000 (20:36 +0900)]
dm: add tag support

With dm-tag feature, any U-Boot subsystem is allowed to associate
arbitrary number of data with a particular udevice. This can been
see as expanding "struct udevice" without modifying the definition.

As a first user, UEFI subsystem makes use of tags to associate
an efi_disk object with a block device.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agovirtio: call device_probe() in scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:45 +0000 (20:36 +0900)]
virtio: call device_probe() in scanning

virtio_init() enumerates all the peripherals that are to be materialised
with udevices(UCLASS_VIRIO) and creates particular device instances
(UCLASS_BlK or whatever else) as children.
On the other hand, device_probe() won't be invoked against those resultant
udevices unlike other ordinary device drivers do in the driver model.

This is particularly inconvenient when we want to add "event notification"
callback so that we will be able to automatically create all efi_disk
objects in a later patch.

With this patch applied, "virtio scan" will work in a similar way
to "scsi rescan", "usb start" or others in term of 'probe' semantics.

I didn't add this change to virtio_init() itself because this function
may be called in board_init_r() (indirectly in board_late_init())
before UEFI subsustem is initialized.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoblock: ide: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:44 +0000 (20:36 +0900)]
block: ide: call device_probe() after scanning

Every time an ide bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agosata: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:43 +0000 (20:36 +0900)]
sata: call device_probe() after scanning

Every time a sata bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agonvme: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:42 +0000 (20:36 +0900)]
nvme: call device_probe() after scanning

Every time a nvme bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agommc: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:41 +0000 (20:36 +0900)]
mmc: call device_probe() after scanning

Every time a mmc bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2 years agousb: storage: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:40 +0000 (20:36 +0900)]
usb: storage: call device_probe() after scanning

Every time a usb bus/port is scanned and a new device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoscsi: call device_probe() after scanning
AKASHI Takahiro [Tue, 8 Mar 2022 11:36:39 +0000 (20:36 +0900)]
scsi: call device_probe() after scanning

Every time a scsi bus/port is scanned and a new block device is detected,
we want to call device_probe() as it will give us a chance to run
additional post-processings for some purposes.

In particular, support for creating partitions on a device will be added.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoefi_loader: Use sysreset instead of reset command
Masami Hiramatsu [Mon, 21 Mar 2022 13:37:56 +0000 (22:37 +0900)]
efi_loader: Use sysreset instead of reset command

Use sysreset_walk_halt() directly from reset-after-capsule-on-disk
feature to reboot (cold reset) machine instead of using reset command
interface, since this is not a command.
Note that this will make CONFIG_EFI_CAPSULE_ON_DISK depending on
the CONFIG_SYSRESET.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoefi_loader: Make efi_load_capsule_drivers() available even if EFI_CAPSULE_ON_DISK=n
Masami Hiramatsu [Mon, 21 Mar 2022 13:37:45 +0000 (22:37 +0900)]
efi_loader: Make efi_load_capsule_drivers() available even if EFI_CAPSULE_ON_DISK=n

Make efi_load_capsule_drivers() available even if EFI_CAPSULE_ON_DISK
is disabled because the caller (efi_init_obj_list()) expects it only
relays on EFI_HAVE_CAPSULE_SUPPORT.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
2 years agocmd: efidebug: Disable 'capsule disk-update' when CONFIG_EFI_CAPSULE_ON_DISK=n
Masami Hiramatsu [Mon, 21 Mar 2022 13:37:35 +0000 (22:37 +0900)]
cmd: efidebug: Disable 'capsule disk-update' when CONFIG_EFI_CAPSULE_ON_DISK=n

Disable 'capsule disk-update' option for the efidebug command
when CONFIC_EFI_CAPSULE_ON_DISK is disabled, because this option
is available only when the EFI capsule update on disk is enabled.

Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoefi_loader: optional persistence of variables
Tom Saeger [Tue, 22 Mar 2022 21:21:10 +0000 (15:21 -0600)]
efi_loader: optional persistence of variables

Since be66b89da306 ("efi_loader: configuration of variables store")
the choice of EFI_VARIABLE_FILE_STORE or EFI_MM_COMM_TEE
is mutually-exclusive, however efi_var_to_file also allows
for "neither". Provide an additional Kconfig option.

Signed-off-by: Tom Saeger <tom.saeger@oracle.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: distro: Update list of all support boot types
Pali Rohár [Wed, 6 Apr 2022 09:35:46 +0000 (11:35 +0200)]
doc: distro: Update list of all support boot types

Add HOST, UBIFS.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: debug UART for RISC-V QEMU virt machine
Heinrich Schuchardt [Tue, 5 Apr 2022 14:14:27 +0000 (16:14 +0200)]
doc: debug UART for RISC-V QEMU virt machine

Provide settings for enabling the debug UART of the virt machine on
RISC-V QEMU.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodoc: correct bootefi.rst
Heinrich Schuchardt [Sat, 2 Apr 2022 05:16:56 +0000 (07:16 +0200)]
doc: correct bootefi.rst

* add link to booti man-page
* correct link description for efidebug command
* correct punctuation

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agodm: Add docs to explain how to enable DM_SERIAL for a board
Simon Glass [Wed, 16 Mar 2022 03:03:20 +0000 (21:03 -0600)]
dm: Add docs to explain how to enable DM_SERIAL for a board

This is an attempt to cover the common cases found when enabling driver
model for serial on a new board.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 years agogpio: pca953x_gpio: add PCA957X support
Luca Ellero [Tue, 22 Mar 2022 14:38:36 +0000 (15:38 +0100)]
gpio: pca953x_gpio: add PCA957X support

Take as reference Linux kernel code:
drivers/gpio/gpio-pca953x.c

Signed-off-by: Luca Ellero <l.ellero@asem.it>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agogpio: Enable hogging support in SPL
Eddie James [Mon, 7 Feb 2022 23:09:01 +0000 (17:09 -0600)]
gpio: Enable hogging support in SPL

Use the CONFIG macros to conditionally build the GPIO hogging support in
either the SPL or U-Boot, or both, depending on the configuration. Also
call the GPIO hog probe function in the common SPL board initialization
as an equivalent to adding it to the U-Boot init sequence functions.

Signed-off-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agogpio: Add gpio_request_by_line_name()
Andrew Jeffery [Mon, 31 Jan 2022 03:24:05 +0000 (13:54 +1030)]
gpio: Add gpio_request_by_line_name()

Add support for the upstream gpio-line-names property already described
in the common GPIO binding document[1]. The ability to search for a line
name allows boards to lift the implementation of common GPIO behaviours
away from specific line indexes on a GPIO controller.

[1] https://github.com/devicetree-org/dt-schema/blob/3c35bfee83c2e38e2ae7af5f83eb89ca94a521e8/dtschema/schemas/gpio/gpio.yaml#L17

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
2 years agotest/py:Update python tests for ‘gpio’ cmd
Adarsh Babu Kalepalli [Mon, 31 May 2021 10:53:51 +0000 (16:23 +0530)]
test/py:Update python tests for ‘gpio’ cmd

Generic Python Test cases are developed to verfiy 'gpio' command.

Signed-off-by: Adarsh Babu Kalepalli <opensource.kab@gmail.com>
2 years agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 8 Apr 2022 17:36:51 +0000 (13:36 -0400)]
configs: Resync with savedefconfig

Rsync all defconfig files using moveconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-08-Kconfig-updates-and-dead-code-removal'
Tom Rini [Fri, 8 Apr 2022 17:33:14 +0000 (13:33 -0400)]
Merge branch '2022-04-08-Kconfig-updates-and-dead-code-removal'

- Migration of more symbols from board config.h files to defconfig
- Remove unused network drivers

2 years agoarm: Remove unused ep93xx code
Tom Rini [Thu, 31 Mar 2022 17:46:53 +0000 (13:46 -0400)]
arm: Remove unused ep93xx code

There are no platforms for this architecture anymore, remove unused
code.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove uli526x driver
Tom Rini [Thu, 31 Mar 2022 17:46:52 +0000 (13:46 -0400)]
net: Remove uli526x driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove ns8382x driver
Tom Rini [Thu, 31 Mar 2022 17:46:51 +0000 (13:46 -0400)]
net: Remove ns8382x driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove natsemi driver
Tom Rini [Thu, 31 Mar 2022 17:46:50 +0000 (13:46 -0400)]
net: Remove natsemi driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove lan91c96 driver
Tom Rini [Thu, 31 Mar 2022 17:46:49 +0000 (13:46 -0400)]
net: Remove lan91c96 driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove ftmac110 driver
Tom Rini [Thu, 31 Mar 2022 17:46:48 +0000 (13:46 -0400)]
net: Remove ftmac110 driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove dnet driver
Tom Rini [Thu, 31 Mar 2022 17:46:47 +0000 (13:46 -0400)]
net: Remove dnet driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove cs8900 driver
Tom Rini [Thu, 31 Mar 2022 17:46:46 +0000 (13:46 -0400)]
net: Remove cs8900 driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove ax88180 driver
Tom Rini [Thu, 31 Mar 2022 17:46:45 +0000 (13:46 -0400)]
net: Remove ax88180 driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonet: Remove armada100_fec driver
Tom Rini [Thu, 31 Mar 2022 17:46:44 +0000 (13:46 -0400)]
net: Remove armada100_fec driver

This driver is not enabled by any board and not converted to DM_ETH.
Remove.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: fsl-layerscape: Migrate more DP-DDR options to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:35 +0000 (18:07 -0400)]
arm: fsl-layerscape: Migrate more DP-DDR options to Kconfig

Based on current usage, migrate a number of DP-DDR related options to
Kconfig.

Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Rajesh Bhagat <rajesh.bhagat@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agosiemens-am33x-common: Drop CONFIG_DMA_COHERENT*
Tom Rini [Wed, 30 Mar 2022 22:07:34 +0000 (18:07 -0400)]
siemens-am33x-common: Drop CONFIG_DMA_COHERENT*

These values are not used in the code, remove them.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agom53menlo: Drop CONFIG_DISCOVER_PHY
Tom Rini [Wed, 30 Mar 2022 22:07:33 +0000 (18:07 -0400)]
m53menlo: Drop CONFIG_DISCOVER_PHY

This is not used in code, drop.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_FSL_QIXIS et al to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:32 +0000 (18:07 -0400)]
Convert CONFIG_FSL_QIXIS et al to Kconfig

This converts the following to Kconfig:
   CONFIG_FSL_QIXIS
   CONFIG_QIXIS_I2C_ACCESS

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_DIMM_SLOTS_PER_CTLR to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:31 +0000 (18:07 -0400)]
Convert CONFIG_DIMM_SLOTS_PER_CTLR to Kconfig

This converts the following to Kconfig:
   CONFIG_DIMM_SLOTS_PER_CTLR

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agogalileo: Remove CONFIG_DESIGNWARE_ETH reference
Tom Rini [Wed, 30 Mar 2022 22:07:30 +0000 (18:07 -0400)]
galileo: Remove CONFIG_DESIGNWARE_ETH reference

This platform has CONFIG_ETH_DESIGNWARE set already, which is the
correct value for the driver in question.  Remove this incorrect line.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agopowerpc: mpc83xx: Migrate DEFAULT_IMMR to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:29 +0000 (18:07 -0400)]
powerpc: mpc83xx: Migrate DEFAULT_IMMR to Kconfig

As no platforms override this value, set it for all mpc83xx platforms.

Cc: Mario Six <mario.six@gdsys.cc>
Cc: Wolfgang Denk <wd@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agonds32: Migrate CONFIG_DEBUG_LED to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:28 +0000 (18:07 -0400)]
nds32: Migrate CONFIG_DEBUG_LED to Kconfig

Move this value to the board Kconfig file.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agols1021atwr: Use DEBUG and not CONFIG_DEBUG
Tom Rini [Wed, 30 Mar 2022 22:07:27 +0000 (18:07 -0400)]
ls1021atwr: Use DEBUG and not CONFIG_DEBUG

We use 'DEBUG' and not 'CONFIG_DEBUG' tree-wide for debug code that is
left in, and not wrapped by some other regular debugging type print
macro.

Cc: Alison Wang <alison.wang@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agomicroblaze: Migrate DCACHE/ICACHE to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:26 +0000 (18:07 -0400)]
microblaze: Migrate DCACHE/ICACHE to Kconfig

Move these two options to the arch Kconfig file.

Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
2 years agotegra: Drop CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS
Tom Rini [Wed, 30 Mar 2022 22:07:25 +0000 (18:07 -0400)]
tegra: Drop CONFIG_CHROMEOS_EXTRA_ENV_SETTINGS

This is not currently set by any boards, so drop.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agocontrolcenterdc: Migrate CUSTOMER_BOARD_SUPPORT to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:24 +0000 (18:07 -0400)]
controlcenterdc: Migrate CUSTOMER_BOARD_SUPPORT to Kconfig

This symbol is only possibly useful on some mvebu platforms, so move the
symbol there and select it for the only current user.

Cc: Mario Six <mario.six@gdsys.cc>
Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agospi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:23 +0000 (18:07 -0400)]
spi: cadence_qspi: Migrate CONFIG_CQSPI_REF_CLK to Kconfig

This is a little tricky since SoCFPGA has code to determine this as
runtime.  Introduce a guard variable for platforms to select if they
have a static value to use.  Then for ARCH_SOCFPGA, call
cm_get_qspi_controller_clk_hz() and otherwise continue the previous
behavior.

Cc: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_SH_SCIF_CLK_FREQ to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:22 +0000 (18:07 -0400)]
Convert CONFIG_SH_SCIF_CLK_FREQ to Kconfig

This converts the following to Kconfig:
   CONFIG_SH_SCIF_CLK_FREQ

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_CONS_SCIF0 et al to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:21 +0000 (18:07 -0400)]
Convert CONFIG_CONS_SCIF0 et al to Kconfig

This converts the following to Kconfig:
   CONFIG_CONS_SCIF0
   CONFIG_CONS_SCIF1
   CONFIG_CONS_SCIF2
   CONFIG_CONS_SCIF4
   CONFIG_CONS_SCIFA0

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoat91: Remove unused LED code
Tom Rini [Wed, 30 Mar 2022 22:07:20 +0000 (18:07 -0400)]
at91: Remove unused LED code

These LED files (and CONFIG values) are unused today, remove the code in
question.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agostm32f429-discovery: Migrate CONFIG_*_LED out of CONFIG namespace
Tom Rini [Wed, 30 Mar 2022 22:07:19 +0000 (18:07 -0400)]
stm32f429-discovery: Migrate CONFIG_*_LED out of CONFIG namespace

These values are only used in one file, reference them more directly.

Cc: Kamil Lulko <kamil.lulko@gmail.com>
Cc: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cc: Patrice Chotard <patrice.chotard@foss.st.com>
Cc: uboot-stm32@st-md-mailman.stormreply.com
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2 years agocorvus: Migrate CONFIG_*_LED out of CONFIG namespace
Tom Rini [Wed, 30 Mar 2022 22:07:18 +0000 (18:07 -0400)]
corvus: Migrate CONFIG_*_LED out of CONFIG namespace

This code is only used on the corvus platform, so migrate the LED on/off
code to this platform and remove it from the CONFIG namespace.  In
theory, this should likely be moved to the modern GPIO LED driver as a
further cleanup.

Cc: Heiko Schocher <hs@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 years agoMPC837XERDB: Stop using CONFIG_RAMDISKFILE
Tom Rini [Wed, 30 Mar 2022 22:07:17 +0000 (18:07 -0400)]
MPC837XERDB: Stop using CONFIG_RAMDISKFILE

We don't really configure this, just set it directly in the environment
section.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agos5p_goni, smdkc100: Move some environment settings out of CONFIG
Tom Rini [Wed, 30 Mar 2022 22:07:16 +0000 (18:07 -0400)]
s5p_goni, smdkc100: Move some environment settings out of CONFIG

A number of CONFIG options are used on these platforms as part of the
default environment.  Set some of these more directly and in other
cases, just reference them directly.

Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoarm: integrator: Migrate platform-specific options and cleanup armcoremodule.h
Tom Rini [Wed, 30 Mar 2022 22:07:15 +0000 (18:07 -0400)]
arm: integrator: Migrate platform-specific options and cleanup armcoremodule.h

This converts the following to Kconfig:
   CONFIG_CM_INIT
   CONFIG_CM_REMAP
   CONFIG_CM_SPD_DETECT
   CONFIG_CM_MULTIPLE_SSRAM
   CONFIG_CM_TCRAM

We make the first three of these options be always enabled, as that
matches usage.  We select the last two based on how they were defined in
armcoremodule.h.  This also allows us to remove some unused code in
board/armltd/integrator/lowlevel_init.S

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoConvert CONFIG_CMDLINE_PS_SUPPORT to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:14 +0000 (18:07 -0400)]
Convert CONFIG_CMDLINE_PS_SUPPORT to Kconfig

This converts the following to Kconfig:
   CONFIG_CMDLINE_PS_SUPPORT

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agotegra: Migrate CI_UDC_HAS_HOSTPC to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:13 +0000 (18:07 -0400)]
tegra: Migrate CI_UDC_HAS_HOSTPC to Kconfig

This option is only enabled for CI_UDC and !TEGRA20, so implement it as
such in Kconfig directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
2 years agomvebu: Move BOOTROM_ERR_REG out of CONFIG namespace
Tom Rini [Wed, 30 Mar 2022 22:07:12 +0000 (18:07 -0400)]
mvebu: Move BOOTROM_ERR_REG out of CONFIG namespace

This register is referenced in one location and does not seem
configurable, so remove it from CONFIG namespace.

Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Stefan Roese <sr@denx.de>
2 years agoConvert CONFIG_BOARD_SIZE_LIMIT to Kconfig
Tom Rini [Wed, 30 Mar 2022 22:07:11 +0000 (18:07 -0400)]
Convert CONFIG_BOARD_SIZE_LIMIT to Kconfig

This converts the following to Kconfig:
   CONFIG_BOARD_SIZE_LIMIT

To do this, introduce CONFIG_HAS_BOARD_SIZE_LIMIT.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 years agoMerge branch '2022-04-08-env-updates'
Tom Rini [Fri, 8 Apr 2022 12:27:50 +0000 (08:27 -0400)]
Merge branch '2022-04-08-env-updates'

- Assorted env tooling updates
- Bug fix around multiple possible env locations and ENV_IS_NOWHERE
- Add 'indirect' sub-command to env
- Allow for FAT env to have the location overridden by the board code.

2 years agoenv: Allow text-env tests to run with awk
Simon Glass [Sun, 13 Mar 2022 05:47:49 +0000 (22:47 -0700)]
env: Allow text-env tests to run with awk

At present the tests assume that gawk is being used. Adjust the tests so
that the names are inserted in alphabetical order, so that awk is happy.

Also use PROCINFO to make gawk output in alphabetical order. This is not
ideal, since it changes the env-car ordering from what the user provided,
but it may be acceptable.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Fixes: https://source.denx.de/u-boot/u-boot/-/issues/10

2 years agoenv: Drop the unncessary protocol mention in autoload
Simon Glass [Fri, 11 Mar 2022 23:22:39 +0000 (16:22 -0700)]
env: Drop the unncessary protocol mention in autoload

Drop this text at the end since it already mentions bootp and dhcp.

Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2 years agoenv: Move the doc comment to the code
Simon Glass [Fri, 11 Mar 2022 23:22:38 +0000 (16:22 -0700)]
env: Move the doc comment to the code

This doesn't really make much sense in the documentation. Add a code
comment instead.

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2 years agoMakefile: Sort u-boot-initial-env output
Christoph Niedermaier [Tue, 1 Mar 2022 08:38:51 +0000 (09:38 +0100)]
Makefile: Sort u-boot-initial-env output

This will sort the default environment file generated by
"make u-boot-initial-env", but won't sort the default
environment in the compiled u-boot binary. The file
u-boot-initial-env is considered to use for the userpace
environment access tools [1] in case of that the
environments is written the first time into its location.
This is done on the one hand for a better overview and
comparison of the generated environment file. On the other
hand it is to synchronize the output with the script
get_default_env.sh, which generated a sorted default
environment file. The sorting preserves the order of equal
variable names by sorting only the variable name, and
disable the last-resort comparison. After sorting,
unnoticed blank lines at the end move to the top. Avoid
that by removing it before sorting.

[1] https://github.com/sbabic/libubootenv

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Stefano Babic <sbabic@denx.de>
Tested-by: Stefano Babic <sbabic@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Marek Behún <marek.behun@nic.cz>
To: u-boot@lists.denx.de
Reviewed-by: Simon Glass <sjg@chromium.org>
2 years agoscripts/get_default_envs.sh: Remove blank lines
Christoph Niedermaier [Wed, 23 Feb 2022 09:33:36 +0000 (10:33 +0100)]
scripts/get_default_envs.sh: Remove blank lines

After sorting, unnoticed blank lines at the end move to the top.
Avoid this by removing it before sorting.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Cc: Lukasz Majewski <lukma@denx.de>
Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de

2 years agoenv: fat: Allow overriding interface, device and partition
He Yong [Thu, 17 Feb 2022 16:07:25 +0000 (00:07 +0800)]
env: fat: Allow overriding interface, device and partition

For platform which can boot on different device, this allows
to override interface, device and partition from board code

Signed-off-by: He Yong <hyyoxhk@163.com>
2 years agocmd: env: Add `indirect` to indirectly set values
Samuel Dionne-Riel [Mon, 20 Dec 2021 23:31:56 +0000 (18:31 -0500)]
cmd: env: Add `indirect` to indirectly set values

This allows an ergonomic-enough approximation of ${!variable} expansion.
This could be used the following way:

```
for target in ${boot_targets}; do
   env indirect target_name target_name_${target}
   # ...
done
```

Assuming `target_name_mmc0` and similar are set appropriately.

A default value can be optionally provided.

Note: this acts on environment variables, not hush variables.

Signed-off-by: Samuel Dionne-Riel <samuel@dionne-riel.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: "Marek Behún" <marek.behun@nic.cz>
[trini: Don't enable by default]

2 years agoenv: Load env when ENV_IS_NOWHERE is only location selected
Felix.Vietmeyer@jila.colorado.edu [Wed, 21 Apr 2021 02:04:26 +0000 (20:04 -0600)]
env: Load env when ENV_IS_NOWHERE is only location selected

This patch prevent u-boot from hanging on a UltraZed EG board (zynqmp).

Without the patch,
(drv = env_driver_lookup(ENVOP_INIT, prio))
evaluates to 0, causing prio = 0
Then, (!prio) is hit, returning -ENODEV causing a stall.

With the patch,
instead of returning -ENODEV and causing a stall, we
set gd->env_addr (is this really needed?)
and then
mark gd->env_valid = ENV_INVALID to use the default env.

2 years agoimx8/ls10xx: Use a sane SYS_MALLOC_F_LEN default
Fabio Estevam [Sat, 26 Mar 2022 14:47:40 +0000 (11:47 -0300)]
imx8/ls10xx: Use a sane SYS_MALLOC_F_LEN default

When adding new features to imx8m boards, such as DM clock support,
the malloc area can be exhausted.

To avoid such issue, provide a reasonable default for the
SYS_MALLOC_F_LEN size.

Quoting Tom Rini:

"This seems to be an area where everyone is either:
- Kicking the value up a bit for themselves
- Having hard to figure out problems booting the platform because it's
  too small a value until they see someone else picked a larger value.

So lets raise these a bit and get some acks, please."

Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Tested-by: Adam Ford <aford173@gmail.com> #imx8mm-beacon, imx8mn-beacon
Tested-by: Heiko Thiery <heiko.thiery@gmail.com>
2 years agoMerge branch '2022-04-06-various-verified-boot-bugfixes'
Tom Rini [Thu, 7 Apr 2022 13:49:27 +0000 (09:49 -0400)]
Merge branch '2022-04-06-various-verified-boot-bugfixes'

To quote the author:

This series collects together various misc patches that were needed when
building mainline U-Boot against Chromium OS verified boot. Most of them
fix minor bugs.

2 years agodm: blk: Expand iteration and add tests
Simon Glass [Mon, 28 Feb 2022 19:08:35 +0000 (12:08 -0700)]
dm: blk: Expand iteration and add tests

Add some functions which support iteration before probing. Also add tests
for the functions.

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