mmc: tegra: get default-tap and default-trim from device tree
Default-tap and default-trim values are used for eMMC setup
mostly on T114+ devices. As for now, those values are hardcoded
for T210 and ignored for all other Tegra generations. Fix this
by passing tap and trim values from dts.
ARM: tegra210: set default-tap and default-trim values in sdhci nodes
Tegra MMC driver has hardcoded tap and trim values as for now.
Set default-tap and default-trim values in sdhci nodes to avoid
regressions in case Tegra MMC driver is upated to use dts values.
Tom Rini [Fri, 3 Nov 2023 13:53:01 +0000 (09:53 -0400)]
Merge tag 'qcom-pull-20231103' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon
As discussed, here is the maintainers update for Snapdragon. Sumit Garg
who maintains a few of the Qualcomm platforms in U-boot has also been
added as a reviewer.
Simon Glass [Wed, 1 Nov 2023 17:17:50 +0000 (11:17 -0600)]
u_boot_pylib: Ensure subprocess is closed down
It isn't clear why we need to have two different paths for closing down
the pipe. Unify them and use the Python to avoid this warning:
subprocess.py:1127: ResourceWarning: subprocess 83531 is still running
Note that this code appears to originally have come from [1] and was
committed into the ChromeOS chromiumos/platform/crosutils repo in the
bin/cros_image_to_target.py file. The addition of the extra code path
came later, so that is chosen for the fixes tag.
Simon Glass [Mon, 30 Oct 2023 17:22:30 +0000 (10:22 -0700)]
buildman: Support upstream branch name containing /
Buildman assumes that branch names do not have a slash in them, since
slash is used to delimit remotes, etc. This means that a branch called
'WIP/tryme' in remote dm ends up being 'tryme'.
Adjust the logic a little, to try to accommodate this.
For now, no tests are added for this behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
binman: openssl: x509: ti_secure_rom: Add support for bootcore_opts
According to the TRMs of K3 platform of devices, the ROM boot image
format specifies a "Core Options Field" that provides the capability to
set the boot core in lockstep when set to 0 or to split mode when set
to 2. Add support for providing the same from the binman DTS. Also
modify existing test case for ensuring future coverage.
Signed-off-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Simon Glass [Mon, 23 Oct 2023 07:52:43 +0000 (00:52 -0700)]
buildman: Include symbols in the read-only data section
When symbols switch between the inited data section and the read-only
data section their visbility changes, at present, with the -B option.
This is confusing, since adding 'const' to a variable declaration can
make it look like a significant improvement in bloat. But in fact
nothing has changed.
Add 'r' to the list of symbols types that are recorded, to correct this
problem. Add a constant to make it easier to find this code next time.
Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Tom Rini <trini@konsulko.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Simon Glass [Sat, 14 Oct 2023 20:40:27 +0000 (14:40 -0600)]
binman: Ensure attributes always come last in the metadata
cbfsutil changed to write zero bytes instead of 0xff when a small
padding must be added. Adjust the binman implementation to do the same.
Drop the code which looks for an unused attribute tag, since it is not
used. A future patch moves the attributes to the end of the header in
any case, so no data will follow the attributes.
Simon Glass [Sat, 14 Oct 2023 20:40:25 +0000 (14:40 -0600)]
binman: Reset missing bintools after testing
For tests which fake bintools being missing, we need to reset the list
afterwards, to ensure that future tests do not also see the bintools as
missing.
Reset the list when processing is complete.
Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Maxim Cournoyer [Fri, 13 Oct 2023 03:06:24 +0000 (23:06 -0400)]
patman: Add a 'keep_change_id' setting
A Change-Id can be useful for traceability purposes, and some projects
may wish to have them preserved. This change makes it configurable
via a new 'keep_change_id' setting.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Tom Rini [Thu, 2 Nov 2023 14:12:33 +0000 (10:12 -0400)]
Merge tag 'i2cfixes-for-v2024-01-rc2' of https://source.denx.de/u-boot/custodians/u-boot-i2c
i2c updates for v2024.01-rc2
- nuvoton: support standard/fast/fast plus mode
- bootcount: remove legacy i2c driver and implement
DM based version
Bugfixes:
- designware_i2c: adjust timing calculation
SPL probing failed on the StarFive VisionFive 2 board
Heinrich fixed this, by syncing timing calculation with
linux implementation.
+ CI: Use OpenSBI 1.3.1 release for testing
+ riscv: Support resume after exception
+ rng: Support RNG provided by RISC-V Zkr ISA extension
+ board: starfive VF2: Support jtag
+ board: starfive VF2: Support TRNG driver
+ board: sifive unmatched: Move kernel load address
Paul Barker [Wed, 1 Nov 2023 20:05:53 +0000 (20:05 +0000)]
arm: mach-rmobile: Drop <common.h>
For most source files we can just drop <common.h>. We need to add an
include for <asm/u-boot.h> in a couple of places. Also sort the include
list in memmap-gen3.c while we're here.
Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Chanho Park [Wed, 1 Nov 2023 12:16:50 +0000 (21:16 +0900)]
rng: Add StarFive JH7110 RNG driver
Adds to support JH7110 TRNG driver which is based on linux kernel's
jh7110-trng.c. This can support to generate 256-bit random numbers and
128-bit but this makes 256-bit default for convenience.
Signed-off-by: Chanho Park <chanho61.park@samsung.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Samuel Holland [Tue, 31 Oct 2023 05:37:20 +0000 (00:37 -0500)]
riscv: Weakly define invalidate_icache_range()
Some RISC-V CPUs, such as the T-HEAD XuanTie series, have a
vendor-specific way to invalidate a portion of the instruction cache.
Allow them to override invalidate_icache_range().
Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Samuel Holland [Tue, 31 Oct 2023 05:35:41 +0000 (00:35 -0500)]
riscv: Align the trap handler to 64 bytes
This is required on CPUs which always operate in CLIC mode, such as the
T-HEAD E906 and E907. Per the CLIC specification: "In this mode, the
trap vector base address held in mtvec is constrained to be aligned on a
64-byte or larger power-of-two boundary."
Reported-by: Madushan Nishantha <jlmadushan@gmail.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Yong-Xuan Wang [Thu, 26 Oct 2023 03:22:52 +0000 (03:22 +0000)]
board: sifive: unmatched: move kernel load address to 0x80200000
U-boot initially loads the kernel image to the kernel_addr_r, and
subsequently relocates it to memory address 0x80200000. Setting
kernel_addr_r to 0x80200000 can eliminate one copy operation.
Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Yang Xiwen [Thu, 17 Aug 2023 17:04:02 +0000 (01:04 +0800)]
clk: also handle ENOENT in *_optional functions
If the device does not specify any clocks in device tree, these
functions will return PTR_ERR(-ENOENT). This is not the intended
behavior and does not comply with linux kernel CCF. Fix that by
returning NULL under such circumstances instead.
Maksim Kiselev [Tue, 5 Sep 2023 22:16:49 +0000 (01:16 +0300)]
clk: use private clk struct in CLK_CCF's enable/disable functions
In clk_enable()/clk_disable() functions, when CCF is activated,
we must pass a private clk struct to enable()/disable() ops functions.
Otherwise, the use of a container_of() construction within these ops
should be banned. Because passing a non-private clk struct to
container_of() results in an out of range error.
At the moment, clk-mux, clk-fixed-factor, clk-gate and possibly other
clocks use container_of() in their enable()/disable() functions.
Therefore, for these functions to work correclty, private clk struct
must be passed.
Eugen Hristev [Mon, 19 Jun 2023 10:47:52 +0000 (13:47 +0300)]
clk: fix count parameter type for clk_release_all
The second parameter for clk_release_all is used as an unsigned
(which makes sense) but the function prototype declares it as an int.
This causes warnings/error like such below:
include/clk.h:422:48: error: conversion to ‘int’ from ‘unsigned int’ may change the sign of the result [-Werror=sign-conversion]
422 | return clk_release_all(bulk->clks, bulk->count);
To fix this, changed the type of the count to `unsigned int`
drivers: clk: Adjust temp var data type to properly match that of struct clk_ops
In commit 5c5992cb90cf ("clk: Add debugging for return values"), a
temporary storage variable was added around the ops->get_rate() call
inside clk_get_rate(), so that the result could be passed through
log_ret.
This temporary variable was declared as an int, yet when we look in
struct clk_ops, we can see this needs to be a ulong:
ulong (*get_rate)(struct clk *clk);
This was resulting in a signed to unsigned casting error on our
builds, where a clock value of 0xABCDABCD was being incorrectly cast
to 0xFFFFFFFFABCDABCD.
Simon Glass [Tue, 24 Oct 2023 18:17:36 +0000 (07:17 +1300)]
bootstd: Handle a few special cases in cmdline_set_arg()
Two bugs have appeared:
- arguments can have an equals sign embedded in them, which must be
considered part of the value
- arguments must fully match the name; partial matches should be
ignored
Compiling sandbox_defconfig with CONFIG_BOOTSTD=n fails:
/usr/bin/ld: drivers/mtd/spi/sf_bootdev.o:
in function `sf_get_bootflow':
/drivers/mtd/spi/sf_bootdev.c:43:(.text+0x96):
undefined reference to `bootmeth_set_bootflow'
Add the missing Kconfig dependency.
Fixes: Fixes: 0c1f4a9fb13a ("bootstd: Add a SPI flash bootdev") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Add extension to the 'mmc' command to read out the card registers.
Currently, only the eMMC OCR/CID/CSD/EXTCSD/RCA/DSR register are
supported. A register value can either be displayed or read into
an environment variable.
Sean Anderson [Fri, 27 Oct 2023 20:57:03 +0000 (16:57 -0400)]
mmc: sdhci: Rework SDHCI_QUIRK_BROKEN_R1B
As noted in commit 3a6383207be ("mmc: sdhci: add the quirk for broken
r1b response"), some MMC controllers don't always set the transfer
complete bit with R1b responses.
According to the SD Host Controller Simplified Specification v4.20,
> In the case of a command pairing with response-with-busy[, Transfer
> Complete] is set when busy is de-asserted. Refer to DAT Line Active
> and Command Inhibit (DAT) in the Present State register.
By polling the DAT Line Active bit in the present state register, we can
detect when we are no longer busy, without waiting for a long timeout.
This results in much faster reads/writes on buggy controllers.
Signed-off-by: Sean Anderson <sean.anderson@seco.com> Tested-by: Henrik Grimler <henrik@grimler.se>
mmc_bind() in mmc-uclass.c calls blk_create_devicef() which is
defined in blk-uclass.c, so SPL_BLK is required by SPL_DM_MMC.
Implicitly select SPL_BLK for SPL_DM_MMC.
The Corstone-1000 kernel has become too large to fit in the available
storage. Switching to a compressed kernel avoids the problem, but
requires uncompressing it.
Changes made are generated using savedefconfig.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Current documentation limits the firmware size to 1.5MB.
When the fTPM and StandaloneMM-based RPMB secure storage is
enabled, firmware size is bigger than that size.
Let's specify the A/B update bank size(4MB) for flash
rawwrite parameter.
Masahisa Kojima [Wed, 25 Oct 2023 06:51:02 +0000 (15:51 +0900)]
board: developerbox: update old NOR flash layout build instruction
v2023.07 is the last version supporting old NOR flash layout
by default. The later versions of U-Boot, Developerbox is
configured to enable A/B update and new NOR Flash layout
by default.
This commit updates the documentation to pin the U-Boot
version for the old NOR flash layout. It is still useful
for the user wants to replace the factory default EDK II
firmware to U-Boot.
Masahisa Kojima [Wed, 25 Oct 2023 06:51:01 +0000 (15:51 +0900)]
board: developerbox: remove obsolete NOR flash layout definition
There are two kinds of NOR flash layout for the Developerbox.
Capsule update for the old layout is no longer available since
it has small capacity for secure world images and can not
house the TA such as fTPM.
This commit removes the definition related to the obsolete
NOR flash layout for the UEFI capsule update.
Jim Liu [Mon, 23 Oct 2023 07:02:24 +0000 (15:02 +0800)]
board: nuvuton: arbel: Fix incorrect ram size
1. Fix incorrect ram size of 4GB dram with ECC enabled
2. Fix wrong place to set dram bank size
- The dram bank size should be set in dram_init_banksize
- Dram_init should not access gd->bd because the board info
struct is not reserved yet.
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
[trini: Rework slightly] Signed-off-by: Tom Rini <trini@konsulko.com>
Marek Vasut [Sun, 29 Oct 2023 22:37:22 +0000 (23:37 +0100)]
dfu: mmc: Add support for exposing whole mmc device
Add support for exposing the whole mmc device by setting the 'size'
parameter to 0. This can be useful in case it is not clear what the
total device size is up front. Update the documentation accordingly.
genimage create android-sparse file with CRC32 chunk at end. When
U-Boot's fastboot receives this chunk it returns error message:
`Fail Bogus chunk size for chunk type Dont Care`
According to reference implementation of Android's sparse file format:
This new function enhances the i2c_get_chip*() toolbox by implementing a
variant that does not require a chip_addr. Instead, the desired device
is pointed to by a phandle.
Signed-off-by: Philip Richard Oberfichtner <pro@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
The legacy I2C bootcounter will hereby be removed and eventually
be replaced by a driver model implementation in the follow-up commit.
The legacy driver has the following drawbacks:
- It's not adhering to the driver model
- Settings are grabbed from Kconfig rather than device tree
- i2c_{read,write} are being used instead of dm_i2c_{read,write}
Signed-off-by: Philip Richard Oberfichtner <pro@denx.de> Reviewed-by: Heiko Schocher <hs@denx.de>
- Two Kconfig content fixes, fix some issues reported by Coverity,
resync get_maintainer.pl (two small fixees), update i2c_eeprom, and
fix an off by one in addrmap_set_entry
Michel Alex [Thu, 26 Oct 2023 05:47:41 +0000 (05:47 +0000)]
misc: i2c_eeprom: consider pagesize when writing to eeprom
Calculate the maximum length of the buffer when writing
across the page boundary. If the buffer length (len)
exceeds the page boundary (pagesize), split it. Use this
length instead of comparing the length with the pagesize,
because if the write start address (offset) is not at the
beginning of a page and the page_offset + len is greater
than the page boundary (pagesize), the write operation
would overflow the current page and the behaviour can be
undefined (e.g. at24).
Signed-off-by: Alex Michel <alex.michel@wiedemann-group.com>
Tom Rini [Sat, 28 Oct 2023 16:58:27 +0000 (12:58 -0400)]
get_maintainer.pl: update from Linux kernel v6.5
Update U-Boot's version of scripts/get_maintainer.pl to sync it up with
the latest changes to the Linux kernel's version of the same script.
The last sync was with Linux kernel version v5.13-rc6. The commits to
the kernel's get_maintainer.pl since then (starting with the most
recent) are: 11fb48961e52 get_maintainer: Honor mailmap for in file emails 26d98e9f78da get_maintainer: don't remind about no git repo when --nogit is used
Tom Rini [Thu, 19 Oct 2023 15:04:35 +0000 (11:04 -0400)]
common: Reword CONSOLE_RECORD_.*SIZE help texts
Make it clear that in the options for setting the console record buffer
sizes that we are talking about buffers for that feature specifically
and not the general console buffers.
- Fix some mpc85xx platforms, fixes for a few TI K3 platforms, enable
usb device and fastboot on verdin-imx8mp, make all QEMU platforms use
the default console buffer sizes, vexpress platform fixes, and update
synquacer flash layout
Jan Kiszka [Sun, 22 Oct 2023 18:07:26 +0000 (20:07 +0200)]
iot2050: Allow for more than 1 USB storage device
This was lost in refactoring while some users of the IOT2050 expect it
to work: Make sure that up to 3 USB storage devices are probed.
Fixes: 53873974a4b0 ("include: armv7: Enable distroboot across all configs") Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Martin Fäcknitz [Thu, 19 Oct 2023 23:06:55 +0000 (01:06 +0200)]
mpc85xx: relocate code in non-SPL build
When building a non-SPL image, relocation is needed. This patch restores
the old behaviour before commit b35316fb67cb ("Convert
CONFIG_SPL_INIT_MINIMAL et al to Kconfig") was only defined if
CONFIG_SPL_BUILD was defined.
Fixes: b35316fb67cb ("Convert CONFIG_SPL_INIT_MINIMAL et al to Kconfig") Signed-off-by: Martin Fäcknitz <faecknitz@hotsplots.de>