Simon Glass [Sun, 6 Mar 2022 03:19:12 +0000 (20:19 -0700)]
binman: Support splitting an ELF file into multiple nodes
Some boards need to load an ELF file using the 'loadables' property, but
the file has segments at different memory addresses. This means that it
cannot be supplied as a flat binary.
Allow generating a separate node in the FIT for each segment in the ELF,
with a different load address for each.
Also add checks that the fit,xxx directives are valid.
Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:11 +0000 (20:19 -0700)]
binman: Keep a separate list of entries for fit
The current implementation sets up the FIT entries but then deletes the
'generator' ones so they don't appear in the final image.
This is a bit clumsy. We cannot build the image more than once, since the
generator entries are lost during the first build. Binman requires that
calling BuildSectionData() multiple times returns a valid result each
time.
Keep a separate, private list which includes the generator nodes and use
that where needed, to correct this problem. Ensure that the missing list
includes removed generator entries too.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:10 +0000 (20:19 -0700)]
binman: Update fit to use node instead of subnode
It doesn't make sense to use 'subnode' as a function parameter since it
is just a 'node' so far as the function is concerned. Update two functions
to use 'node' instead.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:09 +0000 (20:19 -0700)]
binman: Add a consistent way to report errors with fit
Add a new function to handling reporting errors within a particular
subnode of the FIT description. This can be used to make the format of
these errors consistent.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:06 +0000 (20:19 -0700)]
binman: Read the fit entries only once
At present the entries are read twice, once by the entry_Section class
and once by the FIT implementation. This is harmless but can be confusing
when debugging. Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:04 +0000 (20:19 -0700)]
binman: Make fake blobs zero-sized by default
On x86 devices having even a small amount of data can cause an overlap
between regions. For example, bayleybay complains when the intel-vga
region overlaps with u-boot-ucode:
Simon Glass [Sun, 6 Mar 2022 03:19:03 +0000 (20:19 -0700)]
binman: Change how faked blobs are created
At present fake blobs are created but internally an empty blob is used.
Change it to use the contents of the faked file. Also return whether the
blob was faked, in case the caller needs to know that.
Add a TODO to put fake blobs in their own directory.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:01 +0000 (20:19 -0700)]
binman: Refactor fit to generate output at the end
At present the fit implementation creates the output tree while
scanning the FIT description. Then it updates the tree later when the
data is known.
This works, but is a bit confusing, since it requires mixing the scanning
code with the generation code, with a fix-up step at the end.
It is actually possible to do this in two phases, one to scan everything
and the other to generate the FIT. Thus the FIT is generated in one pass,
when everything is known.
Update the code accordingly. The only functional change is that the 'data'
property for each node are now last instead of first, which is really a
more natural position. Update the affected test to deal with this.
One wrinkle is that the calculated properties (image-pos, size and offset)
are now added before the FIT is generated. so we must filter these out
when copying properties from the binman description to the FIT.
Most of the change here is splitting out some of the code from the
ReadEntries() implementation into _BuildInput(). So despite the large
diff, most of the code is the same. It is not feasible to split this patch
up, so far as I can tell.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:19:00 +0000 (20:19 -0700)]
binman: Rename ExpandEntries to gen_entries
Leave the 'expand' term for use by entry types which have an expanded
version of themselves. Rename this method to indicate that it generates
subentries.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:18:59 +0000 (20:18 -0700)]
binman: Rename ExpandToLimit to extend_to_limit
The word 'expand' is used for entries which generate subentries. It is
also used for entries that can have an '_expanded' version which is used
to break out its contents.
Rather than talking about expanding an entry's size, use the term
'extending'. It is slightly more precise and avoids the above conflicts.
This change renders the old 'expand-size' property invalid, so add an
error check for that.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Simon Glass [Sun, 6 Mar 2022 03:18:57 +0000 (20:18 -0700)]
elf: Rename load_segments() and module failure
Rename this function to make it clear that it only reads loadable
segments. Also update the error for missing module to better match the
message emitted by Python.
Simon Glass [Sun, 6 Mar 2022 03:18:52 +0000 (20:18 -0700)]
dtoc: Make GetArgs() more flexible
At present it is not possible to have arguments which include spaces.
Update the function to only split the args if the property is a single
string. This is a bit inconsistent, but might still be useful.
Simon Glass [Mon, 28 Feb 2022 22:13:47 +0000 (15:13 -0700)]
sandbox: Open host file for read-only access if needed
Some files cannot be written but read-only access is still useful for
tests. Add a fallback to read-only access when needed.
This is useful in CI when opening a large data file provided by docker,
where read/write access would result in copying the file, thus needing
a lot of extra disk space.
Jan Kiszka [Mon, 28 Feb 2022 16:06:20 +0000 (17:06 +0100)]
binman: Include also subnodes in generator nodes
This allows to prefill fdt and config nodes with hash and signature
subnodes. It's just important to place the child nodes last so that
hashes do not come before the data - would be disliked by mkimage.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Sat, 12 Mar 2022 04:07:29 +0000 (23:07 -0500)]
Convert CONFIG_AM335X_USB0 et al to Kconfig
This converts the following to Kconfig:
CONFIG_AM335X_USB0
CONFIG_AM335X_USB0_MODE
CONFIG_AM335X_USB1
CONFIG_AM335X_USB1_MODE
We do this by introducing specific options for static configuration of
USB0/USB1 in SPL rather than defining CONFIG_AM335X_USBx_MODE to the
enum value being used. Furthermore, with how the code is used now we do
not need to have OTG mode exposed as an option here, so remove that.
Tom Rini [Fri, 11 Mar 2022 14:12:10 +0000 (09:12 -0500)]
net: fec_mxc: Drop CONFIG_FEC_XCV_TYPE
With all boards now using DM_ETH we determine the value for
CONFIG_FEC_XCV_TYPE at run time, except in the case of the default
fall-back. Set the fallback directly now.
Cc: Fabio Estevam <festevam@gmail.com> Cc: Ramon Fried <rfried.dev@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 11 Mar 2022 14:12:08 +0000 (09:12 -0500)]
imx: Convert some boards to DM_ETH
A small number of i.MX6/7 and vf610 boards have not enabled DM_ETH yet.
Given the state of the rest of the platform, enable DM_ETH.
Cc: Alison Wang <alison.wang@nxp.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Richard Hu <richard.hu@technexion.com> Cc: Troy Kisky <troy.kisky@boundarydevices.com> Cc: Uri Mashiach <uri.mashiach@compulab.co.il> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 11 Mar 2022 14:12:07 +0000 (09:12 -0500)]
Convert CONFIG_ETHPRIME to Kconfig
This converts the following to Kconfig:
CONFIG_ETHPRIME
This is also done by adding a gating Kconfig option, CONFIG_USE_ETHPRIME
similar to other options that are not always set and control environment
variables.
Tom Rini [Fri, 11 Mar 2022 14:12:06 +0000 (09:12 -0500)]
Remove CONFIG_HAS_ETH0 et al symbols
This converts removes the following symbols:
CONFIG_HAS_ETH0
CONFIG_HAS_ETH1
CONFIG_HAS_ETH2
CONFIG_HAS_ETH3
This is because at this point, only the ids8313 platform was using the
code which was controlled by these symbols. In turn, this code already
performs error checking on being able to perform the device tree fixup.
Rather than convert these to Kconfig for a single platform, update the
code to not need these checks and remove them from all the platforms
they were unused on.
Reviewed-by: Heiko Schocher <hs@denx.de> Signed-off-by: Tom Rini <trini@konsulko.com>
Tom Rini [Fri, 11 Mar 2022 14:12:04 +0000 (09:12 -0500)]
Convert CONFIG_BOOT_RETRY_TIME et al to Kconfig
This converts the following to Kconfig:
CONFIG_BOOT_RETRY_TIME
CONFIG_BOOT_RETRY_MIN
CONFIG_RESET_TO_RETRY
We also introduce CONFIG_BOOT_RETRY to gate these options, and clean up
the associated Makefile entry and C code for picking default values of
CONFIG_BOOT_RETRY_MIN.
Tom Rini [Fri, 11 Mar 2022 14:11:58 +0000 (09:11 -0500)]
Convert CONFIG_ARMV8_SWITCH_TO_EL1 to Kconfig
This converts the following to Kconfig:
CONFIG_ARMV8_SWITCH_TO_EL1
Cc: Alex Nemirovsky <alex.nemirovsky@cortina-access.com> Cc: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Michal Simek <michal.simek@xilinx.com> Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Cc: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Cc: Tien Fong Chee <tien.fong.chee@intel.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Tom Rini [Fri, 11 Mar 2022 12:12:48 +0000 (07:12 -0500)]
configs: Re-run migrations
As the CI test for stopping platforms from being merged that were
defining symbols that had Kconfig entries, a small number of symbols
needed to be migrated again. Do so, and catch two cases the README
should also have been updated but was not.
Tom Rini [Fri, 11 Mar 2022 12:12:47 +0000 (07:12 -0500)]
Revert "efi: Allow easy selection of serial-only operation"
This commit re-introduced a migrated CONFIG symbol to the board header
file. These changes should likely be handled via documentation instead,
as well.
Cc: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Fri, 11 Mar 2022 12:12:45 +0000 (07:12 -0500)]
CI: Fix unmigrated symbol test
When calling comm to compare the CONFIG symbols a defconfig uses with
the symbols that have been migrated, we need to suppress all output as
the summary line will have everything we need. Failure to do this leads
to the test blowing up, but in non-fatal ways.
Michal Simek [Mon, 14 Mar 2022 14:26:11 +0000 (15:26 +0100)]
arm64: zynqmp: Add pinctrl emmc description to SM-K26
Production SOM has emmc on it and make sense to describe pin description to
be able use EMMC if it is not configured via psu_init.
(Still some regs are not handled but this is one step in that direction)
Huang Jianan [Sat, 26 Feb 2022 07:05:48 +0000 (15:05 +0800)]
lib/lz4: update LZ4 decompressor module
Update the LZ4 compression module based on LZ4 v1.8.3 in order to
use the newest LZ4_decompress_safe_partial() which can now decode
exactly the nb of bytes requested.
Andre Przywara [Fri, 4 Mar 2022 16:30:08 +0000 (16:30 +0000)]
vexpress64: fvp: Fix automatic boot
Commit c258080c5ad3 ("vexpress64: Clean up BASE_FVP boot configuration")
cleaned up the usage of default address variables, but missed to update
the address for the kernel in the FVP's bootcmd definition.
Change ${kernel_addr} to read ${kernel_addr_r} to bring back the
automated boot for the fastmodel.
Also use "setenv" instead of the potentially ambiguous "set" on the way.
Fixes: c258080c5ad3 ("vexpress64: Clean up BASE_FVP boot configuration") Signed-off-by: Andre Przywara <andre.przywara@arm.com>
board: ti: j721e: evm.c: Fix the probing of in Sierra SerDes0
Initialization and power on operations of links have been moved under the
link device in the Sierra SerDes driver. Also, the UCLASS of
sierra_phy_provider has been changed to UCLASS_MISC.
Therefore, fix the probing of SerDes0 instance accordingly.
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
phy: cadence: Sierra: Move the link operations from serdes phy to link device
In commit d8556b1f3cb2 ("phy: cadence: Sierra: Add a UCLASS_PHY device for
links"), a separate udevice of type UCLASS_PHY was created for each link.
Therefore, move the corresponding link operations under the link device.
Also, change the uclass of sierra phy to UCLASS_MISC as it is no longer the
phy device.
Fixes: d8556b1f3cb2 ("phy: cadence: Sierra: Add a UCLASS_PHY device for links") Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Reviewed-by: Georgi Vlaev <g-vlaev@ti.com>
rockchip: sdhci: Fix RK3399 eMMC PHY power cycling
The Rockchip RK3399 eMMC PHY has to be power-cycled while changing its
clock speed to some higher speeds. This is dependent on the desired
SDHCI clock speed, and it looks like the PHY should be powered off while
setting the SDHCI clock in these cases.
Commit 98a215fb58f0 ("mmc: rockchip_sdhci: add phy and clock config for
rk3399") attempts to do this in the set_ios_post() hook by setting the
SDHCI clock once more while the PHY is turned off/on as necessary, as
the SDHCI framework does not provide a way to override how it sets its
clock. However, the commit breaks reinitializing the eMMC on a few
boards including chromebook_kevin and reportedly ROCKPro64.
This patch reworks the power cycling to utilize the SDHCI framework
slightly better (using the set_control_reg() hook to power off the PHY
and set_ios_post() hook to power it back on) which happens to fix the
issue, at least on a chromebook_kevin.
Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Michal Simek [Mon, 7 Mar 2022 07:53:38 +0000 (08:53 +0100)]
arm64: zynqmp: Fix i2c addresses for zynqmp-p-a2197
After double checking some i2c addresses are not correct. It is visible
from i2c dump
ZynqMP> i2c bus
Bus 3: i2c@ff020000
74: i2c-mux@74, offset len 1, flags 0
Bus 5: i2c@ff020000->i2c-mux@74->i2c@0
Bus 6: i2c@ff020000->i2c-mux@74->i2c@2
Bus 7: i2c@ff020000->i2c-mux@74->i2c@1
Bus 8: i2c@ff020000->i2c-mux@74->i2c@3
Bus 4: i2c@ff030000 (active 4)
74: i2c-mux@74, offset len 1, flags 0
Bus 9: i2c@ff030000->i2c-mux@74->i2c@0
Bus 10: i2c@ff030000->i2c-mux@74->i2c@3
Bus 11: i2c@ff030000->i2c-mux@74->i2c@4
Bus 12: i2c@ff030000->i2c-mux@74->i2c@5 (active 12)
51: generic_51, offset len 1, flags 0
60: generic_60, offset len 1, flags 0
74: generic_74, offset len 1, flags 0
Bus 13: i2c@ff030000->i2c-mux@74->i2c@6 (active 13)
51: generic_51, offset len 1, flags 0
5d: generic_5d, offset len 1, flags 0
74: generic_74, offset len 1, flags 0
ZynqMP> i2c dev 4
Setting bus to 4
ZynqMP> i2c mw 74 0 18
ZynqMP> i2c probe
Valid chip addresses: 18 36 37 50 51 60 74
ZynqMP> i2c mw 74 0 20
ZynqMP> i2c probe
Valid chip addresses: 51 60 74
where it is clear that si570 (u5) is at 0x60 address and 8t49n240 (u39) is
also at address 0x60 based on log above.
i2c address 0x74 is i2c mux and 0x51 is eeprom.
Xilinx ZynqMP SOC can set 6 parameters for its pins. pinmux status
command will print the status of these parameters for each pin. But
current print buffer length is only 40 characters long, increase it
to 80 to print all the parameters.
Michal Simek [Mon, 7 Mar 2022 15:48:17 +0000 (16:48 +0100)]
cmd: test: pinmux: Do not check all empty spaces
There is really no value to check empty spaces. That's why use
ut_assert_nextlinen() instead of ut_assert_nextline().
This change ensures that PINMUX_SIZE can be increased without changing
tests.
Pali Rohár [Mon, 7 Mar 2022 18:12:59 +0000 (19:12 +0100)]
arm: a37xx: Remap IO space to bus address 0x0
Remap PCI I/O space to the bus address 0x0 in the Armada 37xx device-tree
in order to support legacy I/O port based cards which have hardcoded I/O
ports in low address space.
Some legacy PCI I/O based cards do not support 32-bit I/O addressing.
Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Fix parsing of option -b with optional argument again.
Fixes: 8083af97baac ("tools: kwboot: Allow to use -b without image path as the last getopt() option") Signed-off-by: Pali Rohár <pali@kernel.org> Reported-by: Tony Dinh <mibodhi@gmail.com> Tested-by: Tony Dinh <mibodhi at gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Mon, 7 Mar 2022 18:03:08 +0000 (19:03 +0100)]
tools: kwboot: Check if baudrate value is supported before sending image
Call kwboot_open_tty() which baudrate value which was specified at the
command line by option -B. This function returns error if baudrate is not
supported by selected tty device.
Initial baudrate for image transfer is always 115200, so call
kwboot_tty_change_baudrate() with value 115200 immediately after
kwboot_open_tty() if baudrate specified by option -B is different than
115200.
This makes kwboot fail immediately, informing that baudrate is unsupported,
instead of failing only after the first part of image is already sent.
Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Pali Rohár [Mon, 7 Mar 2022 18:03:07 +0000 (19:03 +0100)]
tools: kwboot: Allow to specify custom baudrate only in supported operations
Custom baudrate different than 115200 may be specified only when kwboot is
not going to send boot/debug message pattern or when it is going to send
boot message pattern with image file (in which case baudrate change happens
after sending kwbimage header). BootROM detects boot/debug message pattern
only at baudrate 115200.
Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
efi_loader: copy GUID in InstallProtocolInterface()
InstallProtocolInterface() is called with a pointer to the protocol GUID.
There is not guarantee that the memory used by the caller for the protocol
GUID stays allocated. To play it safe the GUID should be copied to U-Boot's
internal structures.
Reported-by: Joerie de Gram <j.de.gram@gmail.com> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>