Ilias Apalodimas [Thu, 11 Jan 2024 14:39:36 +0000 (16:39 +0200)]
smbios: fix matching issues for table types
commit 738b34668f28 ("smbios: Fallback to the default DT if sysinfo nodes are missing")
allowed the code to fallback and fill in SMBIOS tables with properties
from the compatible and product nodes of the DT, in case the
'smbios,sysinfo' node is missing.
That works fine for Type1/2 tables, but for other types we need to
match the smbios,sysinfo subnode name as well. So add it to the
smbios_ctx and check it during the sysinfo <-> DT mathcing
Ivan Orlov [Thu, 11 Jan 2024 12:58:19 +0000 (12:58 +0000)]
cmd: license: Add CONFIG_GZIP dependency
'License' command processing code could be successfully compiled only
when CONFIG_GZIP option is enabled, otherwise it can't find the 'gunzip'
function definition (it is defined in lib/gunzip.c).
Add CONFIG_GZIP dependency to 'license' command config option in the
corresponding Kconfig.
Signed-off-by: Ivan Orlov <ivan.orlov@codethink.co.uk>
cmd: bootflow: remove dead code in do_bootflow_cmdline()
Checking argc < 3 twice is redundant.
Addresses-Coverity-ID: 477198 Logically dead code Fixes: 921f63e57238 ("bootflow: Allow setting a cmdline arg with no value") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
A SMBIOS 3 entry point has a different length than an SMBIOS 2.1 entry
point.
Fixes: 70924294f375 ("smbios: Use SMBIOS 3.0 to support an address above 4GB") Fixes: 1c5f6fa3883d ("smbios: Drop support for SMBIOS2 tables")
Addresses-Coverity-ID: 477212 ("Wrong sizeof argument") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tom Rini [Tue, 9 Jan 2024 22:57:16 +0000 (17:57 -0500)]
getchar(): Correct usage
The function getchar() returns an 'int' and not a 'char'. Coverity notes
that "Assigning the return value of getchar to char ... truncates its value."
and so for the most part we can resolve this easily by using 'int' as
intended, and often used throughout the codebase. A few places are not
so simple and would require further re-architecting of the code in order
to change this, so we leave them be.
Sekhar Nori [Tue, 9 Jan 2024 08:45:51 +0000 (14:15 +0530)]
arch: mach-k3: Fix incorrect mapping of higher DDR addresses as device memory
Entry for physical address 0x500000000 in memory map table for MMU
configuration is spilling over and inadvertently making DDR available at
higher address (above 4GB address space) get mapped as device memory
(nGnRnE).
Fix this by adjusting entry size. Tested on AM62A SK. Before this patch:
With commit 42c0e5bb054d ("test: Find leftovers after clean/mrproper")
we assume that we are performing out of tree builds. test_clean and
test_mrproper fail if the assumption isn't met.
However there are valid scenarios where tests run with in source builds
(i.e., test.py --build-dir=.).
Automatically skip cleanup tests in such scenarios to prevent false
positives.
Signed-off-by: Tobias Deiminger <tdmg@linutronix.de> Reviewed-by: Harald Seiler <u-boot@rahix.de>
Hugo Cornelis [Mon, 8 Jan 2024 14:24:30 +0000 (15:24 +0100)]
image-host: refactor and protect for very long filenames
This patch adds a function fit_image_read_key_iv_data that checks the
return value of snprintf and allows to generate a sensible error
message when generating binary images using filenames that are too
long for the OS to handle.
This is especially relevant for automated builds such as Buildroot and
Yocto builds.
Signed-off-by: Hugo Cornelis <hugo.cornelis@essensium.com>
Clean up all configuration files to adhere to yamllint rules.
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
[trini: Update more yaml files added since this was posted] Signed-off-by: Tom Rini <trini@konsulko.com> Suggested-by: Nishanth Menon <nm@ti.com>
Caleb Connolly [Thu, 4 Jan 2024 17:12:22 +0000 (17:12 +0000)]
iommu: dont fail silently
When attempting to probe a device which has an associated IOMMU, if the
IOMMU device can't be found (no driver, disabled driver, driver failed
to probe, etc) then we currently fail to probe the device with no
discernable error.
If we fail to hook the device up to its IOMMU, we should make sure that
the user knows about it. Write some better error messages for
dev_iommu_enable() to facilitate this.
Caleb Connolly [Thu, 4 Jan 2024 16:03:35 +0000 (16:03 +0000)]
bootdev: avoid infinite probe loop
Sometimes, when only one bootdev is available, and it fails to probe, we
end up in an infinite loop calling probe() on the same device over and
over. With only debug level log output.
Break the loop if we fail to probe the same device twice in a row, and
promote the probe failure message to log_warning().
Tom Rini [Thu, 18 Jan 2024 16:38:25 +0000 (11:38 -0500)]
Revert "test: hush: dollar: fix bugous behavior"
What we were doing here amounts to simplifying the code for the new hush
parser, and the workarounds are required when using the old one. As we
have returned to having the old parser be default for now, we must undo
this so that the test passes again.
Tom Rini [Thu, 18 Jan 2024 14:07:25 +0000 (09:07 -0500)]
Revert "cmd: Set modern hush as default shell"
Currently at least two SoC families are able to cause a crash using
their regular boot scripts, with the new parser. For now, revert to the
old parser as default.
Tom Rini [Wed, 17 Jan 2024 22:12:36 +0000 (17:12 -0500)]
test: test_trace.py: Have trace-cmd report always use -l
With newer versions of trace-cmd the report subcommand will have
different output from before if we do or do not pass -l. However, with
the -l flag passed our put is consistent here. This updates our regular
expressions and comments for this as well now.
QEMU commit 0c7ffc977195 ("hw/net: cadence_gem: Fix MDIO_OP_xxx values")
is needed to fix the Ethernet PHY driver used by the emulated SiFive
Unleashed Board emulation.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tom Rini [Wed, 17 Jan 2024 14:27:43 +0000 (09:27 -0500)]
Merge tag 'xilinx-for-v2024.04-rc1-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze
Xilinx changes for v2024.04-rc1-v2
xilinx:
- Enable NFS, WGET, DNS and BLKMAP by default
zynqmp:
- Support new power-management node
- Remove multiple blank lines from DTSes
- Wire multiboot with DFU infrastructure
- Fix i2c-gpio pinctrl group name
- SOM DT changes (phy on kd240, kv260 cleanups
- Cleanup i2c bus on zcu1285
- DT cleanup (fix node names not to use _)
- Fix USB interrupts
- Cleanup zcu100 DT
- Add support for kaslr-seed
Tom Rini [Wed, 17 Jan 2024 14:27:23 +0000 (09:27 -0500)]
Merge tag 'efi-2024-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Documentation:
* add generated index to table of contents
* create index entries for commands
* update Python packages used to build the documentation
* fix typos in dfu documentation
- Add more pytests to exercise functionality on real hardware, cleanup
and add tests around "cp"/memmove, add phyCORE-AM62x and Phytium
Pe2201 platforms, Nuvoton NPCM BMC reset driver and improve QEMU
SMBIOS support
The first sentence is half-way true; the macro is always defined, but
has the value 0 or 1.
The second is outright false. A lot of code guarded by
MEM_SUPPORT_64BIT_DATA uses a "ulong" to store values, so if
sizeof(long) is not 8, that code would probably compile, but not work
at all as expected.
It would probably be possible to make all such code explicitly use u64
and thus make it work on 32 bit targets, but until that is done, do
not pretend that it's ok to override the automatic value of
MEM_SUPPORT_64BIT_DATA.
AKASHI Takahiro [Wed, 17 Jan 2024 04:39:44 +0000 (13:39 +0900)]
fs: remove explicit efi configuration dependency
Now it is clear that the feature actually depends on efi interfaces,
not "bootefi" command. efi_set_bootdev() will automatically be nullified
if necessary efi component is disabled.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Now it is clear that the feature actually depends on efi interfaces,
not "bootefi" command. efi_set_bootdev() will automatically be nullified
if necessary efi component is disabled.
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
AKASHI Takahiro [Wed, 17 Jan 2024 04:39:41 +0000 (13:39 +0900)]
efi_loader: split unrelated code from efi_bootmgr.c
Some code moved from cmd/bootefi.c is actually necessary only for "bootefi
<addr>" command (starting an image manually loaded by a user using U-Boot
load commands or other methods (like JTAG debugger).
The code will never been opted out as unused code by a compiler which
doesn't know how EFI boot manager is implemented. So introduce a new
configuration, CONFIG_EFI_BINARY_EXEC, to enforce them opted out
explicitly.
We want to override the Sphinx theme only partially. So we need to
import the Sphinx theme.css. Cf.
https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html
We also need to import the pygments.css for syntax highlighing.
Use sans-serif for body.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Newer versions of sphinx_rtd_theme require to add sphinx_rtd_theme to the
list of extensions. Cf.
https://github.com/readthedocs/readthedocs.org/pull/9654
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Oliver Faso [Sun, 14 Jan 2024 13:18:19 +0000 (14:18 +0100)]
docs/sphinx: Explicitly convert Sphinx paths to str
Sphinx 7.2+ is switching to using pathlib.Path
instead of str to represent paths. This fixes the
current deprecation warnings and eventual breakage.
This conversion will be a no-op when using older
Sphinx versions.
Signed-off-by: Oliver Faso <erer1243@gmail.com> Tested-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20230910040811.53046-1-erer1243@gmail.com Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Create a ft_board_setup() api that gets called as part
of bootm/booti before jumping to kernel. In this
ft_board_setup() callback that will inspect the DTB
and insert the device tree blob with the "kaslr-seed" property.
cmd/command.c: relax length check in cmd_get_data_size()
Just check that the length is at least 2. This allows passing strings
like ".b", which can be convenient when constructing
tests (i.e. parametrizing the suffix used).
cmd/command.c: constify "arg" argument of cmd_get_data_size()
This function obviously does not and must not modify "arg". Change the
prototype to allow passing an argument of type "const char*" without
requiring a cast.
There's no 'mv' shell command for handling overlapping src and dst
regions, and there's no point introducing one, when we can just make
the existing 'cp' command DTRT in all cases. memmove() should at most
be a few instructions more then memcpy() (to detect the appropriate
direction to do the copy), which is of course completely in the noise
with all the string processing that a shell command does.
Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Love Kumar [Wed, 3 Jan 2024 10:29:42 +0000 (15:59 +0530)]
test/py: memtest: Add tests for mtest command
Add the following memory tests:
memtest_negative - To test mtest command by providing incorrect inputs
memtest_ddr - To test memory write-read-comparision for DDR memory
Jim Liu [Wed, 3 Jan 2024 07:29:33 +0000 (15:29 +0800)]
reset: npcm: Add support for Nuvoton NPCM BMC family
Add reset controller driver for Nuvoton BMCs.
The npcm reset driver not only supports reset each module reset
but setting initial value of reset Control Registers.
Love Kumar [Tue, 2 Jan 2024 06:47:07 +0000 (12:17 +0530)]
test/py: i2c: Add tests for i2c command
Add below test cases for i2c commands:
i2c_bus - To show i2c bus info,
i2c_dev - To set or show the current bus,
i2c_probe - To probe the i2c device,
i2c_eeprom - To test i2c eeprom device,
i2c_probe_all_buses - To list down all the buses and probes it
Love Kumar [Tue, 2 Jan 2024 06:44:35 +0000 (12:14 +0530)]
test/py: mii: Add tests for mii command
Add below test cases for mii commands:
mii_info -To display MII PHY info
mii_list - To list MII devices
mii_set_device - To set MII device
mii_read - To reads register from MII PHY address
mii_dump - To display data from MII PHY address
Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
TracyMg_Li [Mon, 25 Dec 2023 03:21:34 +0000 (11:21 +0800)]
ARM add initial support for the Phytium Pe2201 Board.
Add pe2201 platform code and the device tree of pe2201 platform board.
The initial support comprises the UART and PCIe.
Signed-off-by: TracyMg_Li <TracyMg_Li@outlook.com>
Changes since v1:
fix space corrupt.
Changes since v2:
switch to bootstd and text environment.
Changes since v3:
add environment variables.
next_header() and get_next_header() only differ in how the const attribute
is used. One function taking a const parameter and returning a non-const is
good enough.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Love Kumar [Tue, 19 Dec 2023 12:20:51 +0000 (17:50 +0530)]
test/py: mdio: Add tests for mdio command
Add below test cases for mdio commands:
mdio_list - To list MDIO buses
mdio_read - To read PHY's register at <devad>.<reg>
mdio_write - To write PHY's register at <devad>.<reg>
Signed-off-by: Love Kumar <love.kumar@amd.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Tom Rini [Tue, 16 Jan 2024 14:51:16 +0000 (09:51 -0500)]
Merge tag 'qcom-2024.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon
Qualcomm architecture changes:
* Move clock and pinctrl drivers out of mach-snapdragon
* Various clock driver improvements
* Convert PMIC power/reset key driver to use the button API
* Preparetory work for migrating to upstream DT
Caleb Connolly [Mon, 15 Jan 2024 18:03:17 +0000 (18:03 +0000)]
sandbox_flattree: enable button support
sandbox_flattree enables QCOM_PMIC_GPIO which now depends on BUTTON. As
a result the button tests now get run, but fail because the ADC and GPIO
button drivers aren't enabled.
Enable them to run the tests for sandbox_flattree.
Reported-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Caleb Connolly [Tue, 5 Dec 2023 13:46:54 +0000 (13:46 +0000)]
pmic: qcom: dont use dev_read_addr to get USID
Linux DTs stuff a value indicating if the USID is a USID or a GSID in the
reg property, the Linux SPMI driver then reads the two address cells
separately. U-boot's dev_read_addr() doesn't know how to handle this, so
use ofnode_read_u32_index() to get just the USID.
The Qcom pmic driver doesn't have support for GSID handling, so just
ignore the second value for now.
Caleb Connolly [Tue, 5 Dec 2023 13:46:48 +0000 (13:46 +0000)]
mach-snapdragon: switch to PMIC button driver
The PMIC button driver is a much better representation of the hardware
here, adjust the boards to use upstream DT and the PMIC button driver
instead of exposing the buttons as GPIOs and relying on the GPIO-button
driver.
Qualcomm PMICs include a "pon" function which handles two buttons, the
power button and "resin" button (usually volume down). Introduce a new
driver following upstream Linux DT to enable these and map them to Enter
and Down respectively to enable use in boot menus.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
priv->pid is uint32_t, but dev_read_addr() returns a uint64_t on arm64,
with the upper bits being used for error codes. Do error checking before
downcasting to u32 to prevent errors being silently ignored.
Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Tested-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Caleb Connolly [Tue, 14 Nov 2023 12:51:11 +0000 (12:51 +0000)]
serial: msm-geni: don't rely on parent misc device
commit 1b15483deb3f ("misc: add Qualcomm GENI SE QUP device driver")
introduced support for platform-specific oversampling values, necessary
to configure the UART clocks on all platforms at runtime. However it
relies in probing a parent device. Despite the DM_FLAG_PRE_RELOC flag,
this is not done consistently during boot.
Instead, take another approach by relying on ofnode_ helpers to read the
serial engine base address and do the read directly. This fixes early
UART on boards with a non-default oversampling rate.
Caleb Connolly [Tue, 14 Nov 2023 12:55:42 +0000 (12:55 +0000)]
pinctrl: qcom: make compatible with linux DTs
The pinctrl and GPIO drivers are currently heavily incompatible with
upstream. Most Qualcomm pinctrl blocks feature "tiles" of pins, each at
it's own address. Introduce support for these by allowing the soc driver
to specify per-pin register offsets similarly to the Linux driver.
Adjust the GPIO driver to handle these too, and finally enable support
for all pins with the same numbering as used in Linux.
Caleb Connolly [Tue, 14 Nov 2023 12:55:40 +0000 (12:55 +0000)]
pinctrl: qcom: move out of mach-snapdragon
Move the Qualcomm pinctrl drivers out of mach-snapdragon and over to the
rest of the pinctrl drivers, adjust the drivers so that support for each
platform can be enabled/disabled individually and introduce platform
specific configuration options.
Caleb Connolly [Tue, 7 Nov 2023 12:41:05 +0000 (12:41 +0000)]
clk/qcom: fix rcg divider value
The RCG divider field takes a value of (2*h - 1) where h is the divisor.
This allows fractional dividers to be supported by calculating them at
compile time using a macro.
However, the clk_rcg_set_rate_mnd() function was also performing the
calculation. Clean this all up and consistently use the F() macro to
calculate these at compile time and properly support fractional divisors.
Additionally, improve clk_bcr_update() to timeout with a warning rather
than hanging the board, and make the freq_tbl struct and helpers common
so that they can be reused by future platforms.
Caleb Connolly [Tue, 7 Nov 2023 12:41:03 +0000 (12:41 +0000)]
clk/qcom: use function pointers for enable and set_rate
Currently, it isn't possible to build clock drivers for more than one
platform due to how the msm_enable() and msm_set_rate() callbacks are
implemented.
Extend qcom_clk_data to include function pointers for these and convert
all platforms to use them.
Previously, clock drivers relied on include/configs/<board.h> to include the
board specific sysmap header, however as most of the header contents are clock
driver related, import the contents directly into each clock driver and
remove the header. The only exception here is the dragonboard820c board file
which includes some pinctrl macros, those are also inlined.
Konrad Dybcio [Tue, 7 Nov 2023 12:41:01 +0000 (12:41 +0000)]
clk/qcom: handle resets and clocks in one device
Qualcomm's clock controller blocks actually do much more than it
says on the tin.. They provide clocks, resets and power domains.
Currently, U-Boot requires one to spawn 2 separate devices for
controlling clocks and resets, both spanning the same register space.
Refactor the code to make it work with just a single DT node, making
it compatible with upstream Linux bindings and dropping the dedicated
reset driver in favour of including it in the clock driver.
Heavily inspired by Renesas code for a similar hw block.
[caleb: moved drivers to clk/qcom, added reset driver and adjusted bind
logic. Imported qcom,gcc-ipq4019.h from Linux]
Caleb Connolly [Tue, 7 Nov 2023 12:40:59 +0000 (12:40 +0000)]
clk/qcom: move from mach-snapdragon
Clock drivers don't belong here, move them to the right place and
declutter mach-snapdragon a bit.
To de-couple these drivers from specific "target" platforms, add
additional config options to enable each clock driver gated behind a
common CLK_QCOM option and enable them by default for the respective
targets. This will make future work easier as we move towards a generic
Qualcomm target.
arm: xea: Add support for boot image source descriptor in SPL
We load two boot image source descriptor structures from last
two sectors in the SPI NOR flash and determine the boot source
for loading the kernel/DTB images, then adjust the boot order for
loading image from eMMC boot0 or boot1 partition.