Simon Glass [Tue, 6 Jul 2021 16:36:39 +0000 (10:36 -0600)]
binman: Use bytearray instead of string
This is faster if data is being concatenated. Update the section and
collection etypes.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jul 2021 16:36:38 +0000 (10:36 -0600)]
binman: Split node-reading out from constructor in files
The constructor should not read the node information. Move it to the
ReadNode() method instead. This allows this etype to be subclassed.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Tue, 6 Jul 2021 16:36:37 +0000 (10:36 -0600)]
binman: Support multithreading for building images
Some images may take a while to build, e.g. if they are large and use slow
compression. Support compiling sections in parallel to speed things up.
Signed-off-by: Simon Glass <sjg@chromium.org>
(fixed to use a separate test file to fix flakiness)
Simon Glass [Tue, 6 Jul 2021 16:36:36 +0000 (10:36 -0600)]
binman: Put compressed data into separate files
At present compression uses the same temporary file for all invocations.
With multithreading this causes the data to become corrupted. Use a
different filename each time.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:33:00 +0000 (16:33 -0600)]
log: Allow padding of the function name
At present when function names are logged, the output is a little hard to
read since every function is a different length. Add a way to pad the
names so that the log messages line up vertically. This doesn't work if
the function name is very long, but it makes a big difference in most
cases.
Use 20 characters as a default since this covers the vast majority of
functions.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:59 +0000 (16:32 -0600)]
blk: Support iteration
It is useful to be able to iterate over block devices. Typically there
are fixed and removable devices. For security reasons it is sometimes
useful to ignore removable devices since they are under user control.
Add iterators which support selecting the block-device type.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:58 +0000 (16:32 -0600)]
sandbox: mmc: Support fixed MMC devices
Add support for reading devicetree flags for MMC devices. With this we
can distinguish between fixed and removable drives. Note that this
information is only available when the device is probed, not when it is
bound, since it is read in the of_to_plat() method. This could be changed
if needed later.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Simon Glass [Mon, 5 Jul 2021 22:32:57 +0000 (16:32 -0600)]
spl: Provide more information on boot failure
If SPL fails to boot, try to provide an error code to indicate what is
wrong. For example, if a uclass is missing, this can return -EPFNOSUPPORT
(-96) which provides useful information.
Add a helper for accessing the image-loader name so we can drop the use
of #ifdefs in this code.
Put this feature behind a CONFIG_SHOW_ERRORS option to avoid increasing
the code size.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:56 +0000 (16:32 -0600)]
image: Allow @ in node names when not using signatures
If signature verification is not in use we don't need to worry about
the risk of using @ in node names. Update fit_image_verify() to allow
it if the function is not enabled.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:55 +0000 (16:32 -0600)]
bloblist: Correct condition in bloblist_addrec()
It is possible to add a blob that ends at the end of the bloblist, but at
present this is not supported. Fix it and add a regression test for this
case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:54 +0000 (16:32 -0600)]
bloblist: Tidy up a few API comments
Some comments for struct bloblist_hdr are a bit ambiguous. Update them to
clarify the meaning more precisely. Also document bloblist_get_stats()
properly.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:53 +0000 (16:32 -0600)]
bloblist: Support resizing a blob
Sometimes a blob needs to expand, e.g. because it needs to hold more log
data. Add support for this. Note that the bloblist must have sufficient
spare space for this to work.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:52 +0000 (16:32 -0600)]
cros_ec: Use standard calls for recovery-request checking
Rather than calling directly into the sandbox SDL code, we can use the
normal U-Boot console handling for this feature. Update the code, to make
it more generic.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:51 +0000 (16:32 -0600)]
cros_ec: Support the full-size vboot context
The v2 format is 64-bytes in size. Support this and drop v1 since it is
not used anymore.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:50 +0000 (16:32 -0600)]
cros_ec: Drop cros_ec_entering_mode()
This function is not needed anymore. Drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:49 +0000 (16:32 -0600)]
cros_ec: Allow reading the battery-charge state
Add a function to read this information from the EC. It is useful for
determining whether the battery has enough charge to boot.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:48 +0000 (16:32 -0600)]
sandbox: Adjust the bloblist default address
Move this down to provide more space for the bloblist.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:47 +0000 (16:32 -0600)]
sandbox: Use hinting with the display
SDL provides a hinting feature which provides a higher-quality image
with the double-display option (-K). Enable it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:46 +0000 (16:32 -0600)]
sandbox: Add work-around for SDL2 display
At present the display does not show on some machines, e.g. Ubunutu
20.04 but the reason is unknown. Add a work-around until this can be
determined.
Also include more error checking just in case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:45 +0000 (16:32 -0600)]
sandbox: Support executables for more phases
The SPL header has a function for obtaining the phase in capital letters,
e.g. 'SPL'. Add one for lower-case also, as used by sandbox.
Use this to generalise the sandbox logic for determining the filename of
the next sandbox executable. This can provide support for VPL.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:43 +0000 (16:32 -0600)]
test: Avoid a build error with SPL
At present this fails to build chromeos_sandbox due to a rebase error
in dm_test_pre_run(). Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:42 +0000 (16:32 -0600)]
test: Add DM_DMA to be disabled
At present if DM_DMA is disabled on a sandbox build, the build fails.
Make the test conditional.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:41 +0000 (16:32 -0600)]
test: Allow CONFIG_SPL_LOAD_FIT to be disabled
At present if this is not enabled on a sandbox build, the build fails. Add
a condition to avoid this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:40 +0000 (16:32 -0600)]
dm: Support lzma in the flashmap
Allow lzma compression as well as lz4.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 5 Jul 2021 22:32:39 +0000 (16:32 -0600)]
dm: core: Add logging for DM_SEQ_ALIAS
It is sometimes helpful to see which sequence is assigned to a device.
Add debugging info for that.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 4 Jul 2021 18:19:50 +0000 (12:19 -0600)]
dtoc: Update documentation to cover warnings in more detail
When things go wrong it can be confusing to figure out what to change.
Add a few more details to the documentation.
Fix a 'make htmldocs' warning while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Simon Glass [Sun, 4 Jul 2021 18:19:49 +0000 (12:19 -0600)]
dtoc: Detect drivers which do not parse correctly
At present if a driver is missing a uclass or compatible stirng, this
is silently ignored. This makes sense in most cases, particularly for
the compatible string, since it is not required except when the driver
is used with of-platdata.
But it is also not very helpful. When there is some sort of problem
with a driver, the missing compatible string (for example) may be the
cause.
Add a warning in this case, showing it only for drivers which are used
by the build.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Simon Glass [Sun, 4 Jul 2021 18:19:48 +0000 (12:19 -0600)]
dtoc: Detect unexpected suffix on .of_match
Some rockchip drivers use a suffix on the of_match line which is not
strictly valid. At present this causes the parsing to fail. Fix this
and offer a warning.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 4 Jul 2021 18:19:47 +0000 (12:19 -0600)]
dtoc: Add a stdout check in test_normalized_name()
This test captures output but does not always check it. Add the missing
code and drop the old comment.
Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass [Sun, 4 Jul 2021 18:19:46 +0000 (12:19 -0600)]
dtoc: Correct the re_compat regular expression
This expects a . before the field name (.e.g '.compatible = ...) but
presently accepts anything at all. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Simon Glass [Sun, 4 Jul 2021 18:19:45 +0000 (12:19 -0600)]
dtoc: Allow multiple warnings for a driver
At present we show when a driver is missing but this is not always that
useful. There are various reasons why a driver may appear to be missing,
such as a parse error in the source code or a missing field in the driver
declaration.
Update the implementation to record all warnings for each driver, showing
only those which relate to drivers that are actually used. This avoids
spamming the user with warnings related to a driver for a different board.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Simon Glass [Sun, 4 Jul 2021 18:19:44 +0000 (12:19 -0600)]
dtoc: Convert to use ArgumentParser
Use this parser instead of OptionParser, which is deprecated.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Simon Glass [Sun, 4 Jul 2021 18:19:43 +0000 (12:19 -0600)]
dtoc: Avoid using subscripts on match objects
These are not supported before Python 3.6 so avoid them.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Walter Lozano <walter.lozano@collabora.com>
Tom Rini [Tue, 20 Jul 2021 23:31:40 +0000 (19:31 -0400)]
Merge branch 'master' of git://source.denx.de/u-boot-sh
- R-Car3 updates
Marek Vasut [Sat, 10 Jul 2021 17:17:34 +0000 (19:17 +0200)]
ARM: dts: rmobile: Remove multiple unused DT properties on R-Car Gen3
Filter out dmas dma-names interrupt-parent interrupts interrupts-extended
interrupt-names interrupt-map interrupt-map-mask iommus DT properties on
R-Car Gen3, since they are not used by U-Boot and only take space.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sat, 10 Jul 2021 16:56:29 +0000 (18:56 +0200)]
ARM: dts: rmobile: Disable RPC HF by default
The RPC HF might be locked by ATF, and any access to its register
space would result in complete hang. Disable the RPC HF by default.
The ATF should be patched to set RPC node status = "okay" in the DT
fragment it passes to U-Boot in case the RPC HF access is unlocked,
and that way U-Boot could access the RPC HF safely.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sun, 4 Jul 2021 15:27:27 +0000 (17:27 +0200)]
ARM: rmobile: Align CPU: print with other prints
The CPU: print only has one space after it, while the other prints
from U-Boot align the value to offset 7. Align the CPU: print too.
No functional change.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sat, 3 Jul 2021 18:41:50 +0000 (20:41 +0200)]
ARM: rmobile: Enable sysinfo on R-Car Gen3
Enable support for sysinfo on supported R-Car Gen3 boards. The sysinfo
is used e.g. to access and decode board-specific information and then
in turn used by board-info to print those information. On R-Car Gen3
the sysinfo rcar3 driver is used to parse the board ID EEPROM, obtain
board type and revision from it, and let board-info print this
information on boot.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sat, 3 Jul 2021 18:39:28 +0000 (20:39 +0200)]
ARM: rmobile: Enable I2C EEPROM support on R-Car Gen3
Enable support for I2C EEPROM driver on supported Renesas R-Car Gen3 boards.
This is useful for accessing the board ID EEPROM.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sat, 3 Jul 2021 16:16:14 +0000 (18:16 +0200)]
ARM: dts: rmobile: Add sysinfo extras on R-Car Gen3
Add sysinfo node and phandle to the board ID EEPROM on all boards
where this functionality is described in DT, which is Salvator-X(S),
ULCB and Ebisu. The u-boot,dm-pre-reloc is necessary here, since the
sysinfo must be available early during boot. The V3M and V3H boards
currently do not describe this board ID EEPROM in upstream DT, but
that could be easily added later, once the DTs contain the necessary
nodes.
ULCB and Ebisu needs the full EEPROM node in the u-boot extras DT,
since the EEPROM node is still missing in the upstream DTs. Ebisu
also needs extra compatible string override for the i2c_dvfs.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Marek Vasut [Sat, 3 Jul 2021 18:38:26 +0000 (20:38 +0200)]
sysinfo: rcar3: Add Renesas R-Car Gen3 sysinfo driver
The Renesas R-Car Gen3 development kits contain board ID EEPROM.
This driver parses out the board ID and revision out of that
EEPROM and exports it e.g. for the board-info print on boot.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Sean Anderson <sean.anderson@seco.com>
Cc: Simon Glass <sjg@chromium.org>
Tom Rini [Mon, 19 Jul 2021 12:41:04 +0000 (08:41 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-marvell
- Marvell SheevaPlug: Convert Ethernet and SATA to Driver Model (Tony)
- Zyxel NSA310S NAS: Convert to Driver Model (Tony)
- Turris_omnia: Add `u-boot-env` NOR partition (Marek)
- Turris_omnia: Fixup MTD partitions in Linux' DTB (Marek)
- Espressobin: Enable 'mtd' command and define SPI NOR partitions (Pali)
Tom Rini [Mon, 19 Jul 2021 12:29:24 +0000 (08:29 -0400)]
Merge tag 'ti-v2021.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ti
- Enabled distro boot for all TI platforms.
- Cleanup for AM335x Guardian Board
- PRUSS rproc on AM65 platform.
- Add PMIC support for J7200
- Misc fixes for Nokia RX-51
# Conflicts:
# arch/arm/mach-omap2/am33xx/Kconfig
Pali Rohár [Fri, 16 Jul 2021 10:34:42 +0000 (12:34 +0200)]
arm: mvebu: Espressobin: Enable 'mtd' command and define SPI NOR partitions
U-Boot now supports parsing SPI NOR partitions from Device Tree. So enable
'mtd' command support for Espressobin board and define partition layout in
U-Boot Espressobin DTS file. Access to SPI NOR via 'sf' command is old
method and 'mtd' command is now preferred variant.
From include file remove '#define CONFIG_MTD_PARTITIONS' as this option is
now defined and enabled in defconfig file. This change is required to fix
compile error:
CC arch/arm/lib/asm-offsets.s
In file included from include/config.h:4,
from include/common.h:16,
from lib/asm-offsets.c:14:
include/configs/mvebu_armada-37xx.h:63: warning: "CONFIG_MTD_PARTITIONS" redefined
#define CONFIG_MTD_PARTITIONS /* required for UBI partition support */
In file included from ././include/linux/kconfig.h:4,
from <command-line>:
include/generated/autoconf.h:44: note: this is the location of the previous definition
#define CONFIG_MTD_PARTITIONS 1
After enabling support for mtd command, output from 'mtd list' on
Espressobin board is:
=> mtd list
List of MTD devices:
* w25q32dw
- device: spi-flash@0
- parent: spi@10600
- driver: jedec_spi_nor
- path: /soc/internal-regs/spi@10600/spi-flash@0
- type: NOR flash
- block size: 0x1000 bytes
- min I/O: 0x1 bytes
- 0x000000000000-0x000000400000 : "w25q32dw"
- 0x000000000000-0x0000003f0000 : "firmware"
- 0x0000003f0000-0x000000400000 : "u-boot-env"
=>
Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Konstantin Porotchkin <kostap@marvell.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Thu, 15 Jul 2021 17:21:02 +0000 (19:21 +0200)]
arm: mvebu: turris_omnia: fixup MTD partitions in Linux' DTB
Fixup SPI NOR partition nodes in Linux' device tree prior booting Linux.
Linux' devicetree does not contain "u-boot-env" partition and we do not
want to add it there because the address is different between stock
U-Boot and current upstream U-Boot.
Instead we add code that recreates partition nodes from scratch
according to how U-Boot sees them (which is defined in U-Boot's device
tree).
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Marek Behún [Thu, 15 Jul 2021 17:21:01 +0000 (19:21 +0200)]
ARM: dts: armada-385-turris-omnia: add `u-boot-env` NOR partition
Specify a separate partition `u-boot-env` for U-Boot's env settings for
the Turris Omnia board.
Do this only in U-Boot's specific DTS. We do not want to do this in
Linux' official DTS, because Omnia's stock U-Boot stores env at a
different address, and there are still boards with stock U-Boot.
In a subsequent patch will add board code that fixes Linux's DTB before
booting Linux.
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Tony Dinh [Fri, 16 Jul 2021 09:18:04 +0000 (02:18 -0700)]
arm: kirkwood: Marvell Sheevaplug: Use Ethernet PHY name and address from device tree
- In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Tony Dinh [Wed, 14 Jul 2021 04:35:46 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM SATA and remove IDE configs
Enable DM SATA, removed IDE driver, and add SATA MV driver.
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Tony Dinh [Wed, 14 Jul 2021 04:35:44 +0000 (21:35 -0700)]
arm: kirkwood: Marvell Sheevaplug: Add DM Ethernet and DM SATA configs
Add DM_ETH, SATA_MV and associated configs to sheevaplug_defconfig
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Tony Dinh [Wed, 7 Jul 2021 09:06:47 +0000 (02:06 -0700)]
arm: kirkwood: NSA310S: Use Ethernet PHY name from device tree
In DM Ethernet, the old "egiga0" name is no longer valid, so replace it
with Ethernet PHY name from device tree. Also, Ethernet PHY address
is available so read it from device tree.
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Tony Dinh [Sat, 3 Jul 2021 03:08:14 +0000 (20:08 -0700)]
arm: kirkwood: NSA310S: Add DM SATA configs
Enable DM SATA, removed IDE driver, and add SATA MV driver.
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Tony Dinh [Thu, 1 Jul 2021 04:26:23 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add DM USB, DM Ethernet, and DM SATA configs
Convert to Driver Model.
- Add DM USB, DM Ethernet, and DM SATA configs to nsa310s_defconfig
- Add CONFIG_DEFAULT_DEVICE_TREE to nsa310s_defconfig
- Move CONFIG_ENV_SECT_SIZE from board file to nsa310s_defconfig
- Add CONFIG_IDENT_STRING, and CONFIG_NET_RANDOM_ETHADDR
to nsa310s_defconfig
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tony Dinh [Thu, 1 Jul 2021 04:26:22 +0000 (21:26 -0700)]
arm: kirkwood: NSA310S: Add device tree DTS for Zyxel NSA310S board
Add device tree kirkwood-nsa310s.dts for Zyxel NSA310S board to
convert to Driver Model.
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tom Rini [Mon, 19 Jul 2021 03:07:36 +0000 (23:07 -0400)]
Merge branch '2021-07-18-finalize-migrations'
- With the deadline for DM_USB (host controller support), DM_VIDEO,
DM_SPI_FLASH and DM_PCI now at 2 years past the release where their
migration deadline was given, finish removing platforms and enforcing
the switch.
Tom Rini [Mon, 19 Jul 2021 01:06:33 +0000 (21:06 -0400)]
Makefile: Remove DM_VIDEO and DM_SPI_FLASH checks
As we have now completed the DM_VIDEO and DM_SPI_FLASH migrations we can
remove the checks.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Sat, 15 May 2021 01:34:32 +0000 (21:34 -0400)]
pci: Require DM_PCI
As the migration deadline has passed, require that DM_PCI be used.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 9 Jul 2021 14:11:56 +0000 (10:11 -0400)]
usb: Enforce DM_USB migration for USB_HOST devices.
As the deadline for migration to DM_USB, when using a USB host
controller has now gone two years past the deadline, enforce migration.
This is done by:
- Ensuring that all host controller options (other than the very legacy
old MUSB ones) now select USB_HOST. USB_HOST now enforces DM_USB and
OF_CONTROL.
- Remove other parts of Kconfig logic that had platforms pick DM_USB.
- To keep Kconfig happy, have some select statements test for USB_HOST
as well.
- Re-order some Kconfig entries and menus so that we can cleanly pick
host or gadget roles. For the various HCD options that have platform
glue options, group them together and update dependencies in some
cases.
- As SPL_DM_USB is not required, on platforms that had not yet enabled
it, disable it.
Cc: Marek Vasut <marex@denx.de>
Cc: Icenowy Zheng <icenowy@aosc.io>
Cc: Samuel Holland <samuel@sholland.org>
Cc: FUKAUMI Naoki <naobsd@gmail.com>
Cc: Andre Przywara <andre.przywara@arm.com>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 9 Jul 2021 14:11:55 +0000 (10:11 -0400)]
treewide: Test on CONFIG_USB_HOST (or CONFIG_CMD_USB) not CONFIG_USB
As the logic here is only used when we have a USB host controller, test
on CONFIG_USB_HOST rather than CONFIG_USB in general. This lets us move
towards using CONFIG_USB only as a menu symbol to say that we have some
form of USB, and then USB_HOST or USB_GADGET depending on the role that
USB plays within the build.
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 9 Jul 2021 14:11:54 +0000 (10:11 -0400)]
tegra: Test on CONFIG_CMD_USB being enabled for distro bootcmd
Reuse the common logic to allow for BOOT_TARGET_DEVICES to list USB as a
possibility if we're building for a platform that will have USB but not
if we don't, so that we don't hit the link-time check for trying to have
USB boot on a non-USB system.
Acked-by: Tom Warren <twarren@nvidia.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 9 Jul 2021 14:11:53 +0000 (10:11 -0400)]
ge_bx50v3: Remove unused USB related defines
These USB defines do not change the build as there is no USB support
enabled currently.
Cc: Ian Ray <ian.ray@ge.com>
Cc: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tom Rini [Mon, 12 Jul 2021 16:42:14 +0000 (12:42 -0400)]
m68k: Remove M52277EVB board
This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it. As this is also the last in family remove the related
support as well.
Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 12 Jul 2021 16:42:13 +0000 (12:42 -0400)]
m68k: Remove M54451EVB board
This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it. As this is also the last in family remove the related
support as well.
Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 12 Jul 2021 16:42:12 +0000 (12:42 -0400)]
m68k: Remove M54418TWR board
This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.
Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 12 Jul 2021 16:42:11 +0000 (12:42 -0400)]
m68k: Remove M54455EVB board
This board has not been converted to CONFIG_DM_MMC by the deadline.
Remove it.
Cc: Angelo Durgehello <angelo.dureghello@timesys.com>
Cc: TsiChung Liew <Tsi-Chung.Liew@nxp.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Mon, 12 Jul 2021 16:42:10 +0000 (12:42 -0400)]
vinco: Enable DM_USB and DM_SPI_FLASH support
As this platform already enables CONFIG_DM and CONFIG_OF_CONTROL,
migrating to DM_USB and DM_SPI_FLASH is just a matter of enabling the
correct options.
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>
u-boot@lists.denx.de (open list)
Reported-by: Marek Behun <marek.behun@nic.cz>
Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Sun, 18 Jul 2021 22:31:16 +0000 (18:31 -0400)]
Merge tag 'mips-pull-2021-07-18' of https://source.denx.de/u-boot/custodians/u-boot-mips
- mips: gardena-smart-gateway: adjust config to new production values
- mips: malta: convert to PCI DM and ETH DM
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:01 +0000 (20:54 +0200)]
MIPS: malta: enable PCI driver model
Enable DM_PCI and DM_ETH on MIPS Malta.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Daniel Schwierzeck [Thu, 15 Jul 2021 18:54:00 +0000 (20:54 +0200)]
MIPS: malta: add support for PCI driver model
As almost all peripherals are connected via PCI dependent on the
used core card, PCI setup is always required. Thus run pci_init()
including PCI scanning and probing and core card specific setups
in board_early_init_r().
Also prepare support for dynamically managing the status of the
different PCI DT nodes dependent on used core card via option
CONFIG_OF_BOARD_FIXUP. Before this feature can be enabled,
the call order of the fix_fdt() init hook in board_init_f
needs to be changed. Otherwise rw_fdt_blob points to a read-only
NOR flash address. Thus this options needs to stay disabled
until the board_init_f problem could be solved. This breaks
running the default U-Boot image on real HW using the FPGA core
card but Qemu emulation still works. Currently Qemu is more
important as MIPS CI tests depend on Malta and the deadline
for PCI DM conversion will be enforced soon.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:59 +0000 (20:53 +0200)]
MIPS: malta: add DT bindings for PCI host controller
Add DT binding for GT64120 and MSC01 PCI controllers. Only
GT64120 is enabled by default to support Qemu. The MSC01 node
will be dynamically enabled by Malta board code dependent
on the plugged core card.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:58 +0000 (20:53 +0200)]
pci: msc01: convert to driver model
This driver is currently only used on MIPS Malta boards.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:57 +0000 (20:53 +0200)]
pci: gt64120: convert to driver model
This driver is currently only used on MIPS Malta boards.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Daniel Schwierzeck [Thu, 15 Jul 2021 18:53:56 +0000 (20:53 +0200)]
dm: pci: add option to map virtual system memory base address
On MIPS the DRAM start address respectively CONFIG_SYS_SDRAM_BASE
is still used as a virtual, CPU-mapped address instead of being used
as physical address. Converting all MIPS boards and generic MIPS code
to fix that is not trivial. Due to the approaching deadline for
PCI DM conversion, this workaround is required for MIPS boards with
PCI support until the CONFIG_SYS_SDRAM_BASE issue could be solved.
Add a compile-time option to let the PCI uclass core optionally map
the DRAM address to a physical address when adding the PCI region
of type PCI_REGION_SYS_MEMORY.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reto Schneider [Thu, 17 Jun 2021 16:09:34 +0000 (18:09 +0200)]
mips: mt7688: gardena-smart-gateway: Adjust to production values
This commit updates the default config with the values that will
be used soon on the MediaTek MT7688 based GARDENA smart gateway.
CONFIG_SPL_SYS_MALLOC_F_LEN had to be increased due to the more
demanding new configuration.
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Tom Rini [Sun, 18 Jul 2021 15:03:02 +0000 (11:03 -0400)]
Merge tag 'efi-2021-10-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2021-10-rc1-2
* Correct device path nodes for GUID partitions
* Embed keys to check update capsules instead of providing then in DTB
* Increase event log buffer size for measured boot.
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:46 +0000 (17:26 +0300)]
doc: Update CapsuleUpdate READMEs
Since we removed embeddingg the capsule key into a .dtb and fixed
authenticated capsule updates for all boards, move the relevant
documentation in the efi file and update it accordingly
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:45 +0000 (17:26 +0300)]
mkeficapsule: Remove dtb related options
commit
322c813f4bec ("mkeficapsule: Add support for embedding public key in a dtb")
added a bunch of options enabling the addition of the capsule public key
in a dtb. Since now we embedded the key in U-Boot's .rodata we don't this
this functionality anymore
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Ilias Apalodimas [Sat, 17 Jul 2021 14:26:44 +0000 (17:26 +0300)]
efi_capsule: Move signature from DTB to .rodata
The capsule signature is now part of our DTB. This is problematic when a
user is allowed to change/fixup that DTB from U-Boots command line since he
can overwrite the signature as well.
So Instead of adding the key on the DTB, embed it in the u-boot binary it
self as part of it's .rodata. This assumes that the U-Boot binary we load
is authenticated by a previous boot stage loader.
Reviewed-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Tested-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Masahisa Kojima [Wed, 14 Jul 2021 13:00:01 +0000 (22:00 +0900)]
efi_loader: increase eventlog buffer size
TCG PC Client PFP spec says "The Log Area Minimum Length
for the TCG event log MUST be at least 64KB." in ACPI chapter.
This commit increase the buffer size to 64KB.
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Masami Hiramatsu [Wed, 14 Jul 2021 05:19:13 +0000 (14:19 +0900)]
efi_loader: Use %pD to log device-path instead of local efi_dp_str()
Use %pD to log device-path instead of using efi_dp_str() and
efi_free_pool() locally in find_boot_device().
This is a cleanup patch, no feature update nor fix.
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Alfonso Sánchez-Beato [Thu, 15 Jul 2021 13:31:42 +0000 (15:31 +0200)]
efi_loader: set partition GUID in device path for SIG_TYPE_GUID
Previously, the GPT device GUID was being used instead of the partition,
which was incorrect.
Signed-off-by: Alfonso Sánchez-Beato <alfonso.sanchez-beato@canonical.com>
Let EFI_LOADER select CONFIG_PARTITION_UUIDS.
Use log_warning() instead of printf() for warning.
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tom Rini [Sat, 17 Jul 2021 15:39:50 +0000 (11:39 -0400)]
Merge branch '2021-07-16-cleanup-image-support'
- A large rework of the logic around supporting various image
types/formats and sharing between the host and target.
Tom Rini [Sat, 17 Jul 2021 14:52:21 +0000 (10:52 -0400)]
Merge tag 'u-boot-imx-
20210717' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
i.MX
----
- mx7ulp : fix WDOG
- imx8 : Phytec
- USB3 support for i.MX8
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/8277
Breno Lima [Tue, 29 Jun 2021 02:32:35 +0000 (10:32 +0800)]
mx7ulp: wdog: Wait for WDOG unlock and reconfiguration to complete
According to i.MX7ULP Reference Manual we should wait for WDOG unlock
and reconfiguration to complete.
Section "59.5.3 Configure Watchdog" provides the following example:
DisableInterrupts; //disable global interrupt
WDOG_CNT = 0xD928C520; //unlock watchdog
while(WDOG_CS[ULK]==0); //wait until registers are unlocked
WDOG_TOVAL = 256; //set timeout value
WDOG_CS = WDOG_CS_EN(1) | WDOG_CS_CLK(1) | WDOG_CS_INT(1) |
WDOG_CS_WIN(0) | WDOG_CS_UPDATE(1);
while(WDOG_CS[RCS]==0); //wait until new configuration takes effect
EnableInterrupts; //enable global interrupt
Update U-Boot WDOG driver to align with i.MX7ULP reference manual.
Use 32 bits accessing to CS register. According to RM, the bits in
this register only can write once after unlock. So using 8 bits access
will cause problem.
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Breno Lima [Tue, 29 Jun 2021 02:32:34 +0000 (10:32 +0800)]
mx7ulp: Update unlock and refresh sequences in sWDOG driver
According to i.MX7ULP Reference Manual the second word write for both
UNLOCK and REFRESH operations must occur in maximum 16 bus clock.
The current code is using writel() function which has a DMB barrier to
order the memory access. The DMB between two words write may introduce
some delay in certain circumstance, causing a WDOG timeout due to 16 bus
clock window requirement.
Replace writel() function by __raw_writel() to achieve a faster memory
access and avoid such issue.
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Breno Lima <breno.lima@nxp.com>
Ye Li [Sun, 21 Feb 2021 16:26:24 +0000 (08:26 -0800)]
imx8mq_evk: Enable the USB3.0 host port
Setup USB clock in board codes, and enable the DWC3 XHCI and
PHY drivers to make USB3.0 host port working on i.MX8MQ EVK.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Ye Li [Sun, 21 Feb 2021 16:26:23 +0000 (08:26 -0800)]
arm: imx8mq: Add USB clock init function
Add clock function to setup relevant clocks for USB3.0 controllers and
PHYs on i.MX8MQ
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
Ye Li [Sun, 21 Feb 2021 16:26:22 +0000 (08:26 -0800)]
arm: dts: imx8mq: Add alias for two usb controllers
Add alias for two DWC3 usb controllers to fix the seq index.
Signed-off-by: Ye Li <ye.li@nxp.com>
Tested-by: Patrick Wildt <patrick@blueri.se>
Ye Li [Sun, 21 Feb 2021 16:26:21 +0000 (08:26 -0800)]
phy: phy-imx8mq-usb: Add USB PHY driver for i.MX8MQ
Add the USB PHY driver for i.MX8MQ to work with DWC3 USB controller.
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Patrick Wildt <patrick@blueri.se>
Tested-by: Patrick Wildt <patrick@blueri.se>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:47 +0000 (17:05 -0500)]
tools: Use a single target-independent config to enable OpenSSL
Host tool features, such as mkimage's ability to sign FIT images were
enabled or disabled based on the target configuration. However, this
misses the point of a target-agnostic host tool.
A target's ability to verify FIT signatures is independent of
mkimage's ability to create those signatures. In fact, u-boot's build
system doesn't sign images. The target code can be successfully built
without relying on any ability to sign such code.
Conversely, mkimage's ability to sign images does not require that
those images will only work on targets which support FIT verification.
Linking mkimage cryptographic features to target support for FIT
verification is misguided.
Without loss of generality, we can say that host features are and
should be independent of target features.
While we prefer that a host tool always supports the same feature set,
we recognize the following
- some users prefer to build u-boot without a dependency on OpenSSL.
- some distros prefer to ship mkimage without linking to OpenSSL
To allow these use cases, introduce a host-only Kconfig which is used
to select or deselect libcrypto support. Some mkimage features or some
host tools might not be available, but this shouldn't affect the
u-boot build.
I also considered setting the default of this config based on
FIT_SIGNATURE. While it would preserve the old behaviour it's also
contrary to the goals of this change. I decided to enable it by
default, so that the default build yields the most feature-complete
mkimage.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:46 +0000 (17:05 -0500)]
image: Add support for relocating crypto_algos in linker lists
Function pointers from crypto_algos array are relocated, when
NEEDS_MANUAL_RELOC is set. This relocation doesn't happen if the algo
is placed in a linker list. Implement this relocation.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:45 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY_ECDSA macro
This macro is no longer needed for code flow or #ifdefs. Remove it.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:44 +0000 (17:05 -0500)]
image: Eliminate IMAGE_ENABLE_VERIFY macro
This macro is no longer needed for code flow or #ifdefs. Remove it.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:43 +0000 (17:05 -0500)]
lib: rsa: Remove #ifdefs from rsa.h
It is no longer necessary to implement rsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the rsa code is no longer linked when unused.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:42 +0000 (17:05 -0500)]
lib: ecdsa: Remove #ifdefs from ecdsa.h
It is no longer necessary to implement ecdsa_() functions as no-ops
depending on config options. It is merely sufficient to provide the
prototypes, as the ecdsa code is no longer linked when unused.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:41 +0000 (17:05 -0500)]
image: image-sig.c: Remove crypto_algos array
Crytographic algorithms (currently RSA), are stored in linker lists.
The crypto_algos array is unused, so remove it, and any logic
associated with it.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:40 +0000 (17:05 -0500)]
image: rsa: Move verification algorithm to a linker list
Move the RSA verification crytpo_algo structure out of the
crypto_algos array, and into a linker list.
Although it appears we are adding an #ifdef to rsa-verify.c, the gains
outweigh this small inconvenience. This is because rsa_verify() is
defined differently based on #ifdefs. This change allows us to have
a single definition of rsa_verify().
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:39 +0000 (17:05 -0500)]
image: Add support for placing crypto_algo in linker lists
The purpose of this change is to enable crypto algorithms to be placed
in linker lists, rather than be declared as a static array. The goal
is to remove the crypto_algos array in a subsequent patch.
Create a new linker list named "cryptos", and search it when
image_get_crypto_algo() is invoked.
NOTE that adding support for manual relocation of crypto_algos within
linker lists is beyond the scope of this patch.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:38 +0000 (17:05 -0500)]
common: image-sig.c: Remove host-specific logic and #ifdefs
Remove any ifdefs in image-sig.c that were previously used to
differentiate from the host code. Note that all code dedicated to
relocating ->sign() and ->add_verify_data)_ can be safely removed,
as signing is not supported target-side.
NOTE that although it appears we are removing ecdsa256 support, this
is intentional. ecdsa_verify() is a no-op on the target, and is
currently only used by host code.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Alexandru Gagniuc [Wed, 14 Jul 2021 22:05:37 +0000 (17:05 -0500)]
common: Move host-only logic in image-sig.c to separate file
image-sig.c is used to map a hash or crypto algorithm name to a
handler of that algorithm. There is some similarity between the host
and target variants, with the differences worked out by #ifdefs. The
purpose of this change is to remove those ifdefs.
First, copy the file to a host-only version, and remove target
specific code. Although it looks like we are duplicating code,
subsequent patches will change the way target algorithms are searched.
Besides we are only duplicating three string to struct mapping
functions. This isn't something to fuss about.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Wed, 14 Jul 2021 22:05:36 +0000 (17:05 -0500)]
image: Drop IMAGE_ENABLE_BEST_MATCH
This is not needed with Kconfig, since we can use IS_ENABLED() easily
enough. Drop it.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>