]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
11 months agosmbios: shorten sysinfo_str declarations and use
Ilias Apalodimas [Thu, 11 Jan 2024 14:39:35 +0000 (16:39 +0200)]
smbios: shorten sysinfo_str declarations and use

sysinfo_str is a bit too long and makes indentation weird. Shorten it
to si_str.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
11 months agocmd: license: Add CONFIG_GZIP dependency
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>
11 months agocmd: bootflow: remove dead code in do_bootflow_cmdline()
Heinrich Schuchardt [Thu, 11 Jan 2024 08:14:33 +0000 (09:14 +0100)]
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>
11 months agosmbios: buffer overflow when zeroing entry point
Heinrich Schuchardt [Thu, 11 Jan 2024 06:34:08 +0000 (07:34 +0100)]
smbios: buffer overflow when zeroing entry point

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>
11 months agonvme: Update nvme_scan_namespace to keep trying on busy
Moritz Fischer [Wed, 10 Jan 2024 05:04:48 +0000 (05:04 +0000)]
nvme: Update nvme_scan_namespace to keep trying on busy

A busy controller shouldn't be game-over for all controllers,
so keep trying on hitting -EBUSY.

This change brings the actual behavior of the routine in line
with what the descriptions says.

Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agonvme: Fix error code and log to indicate busy
Moritz Fischer [Wed, 10 Jan 2024 05:04:47 +0000 (05:04 +0000)]
nvme: Fix error code and log to indicate busy

Return -EBUSY if controller is found busy rather than -ENOMEM
and update the error message accordingly.

Fixes: 982388eaa991 ("nvme: Add NVM Express driver support")
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agodrivers: pci: Fix dm_pci_map_bar() to support 64b BARs
Moritz Fischer [Wed, 10 Jan 2024 04:59:02 +0000 (04:59 +0000)]
drivers: pci: Fix dm_pci_map_bar() to support 64b BARs

This enables 64b BARs if CONFIG_SYS_PCI_64BIT is enabled.

Reviewed-by: Philip Oberfichtner <pro@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Moritz Fischer <moritzf@google.com>
11 months agogetchar(): Correct usage
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.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agotest/py: bootstage: Add test for bootstage command
Love Kumar [Tue, 9 Jan 2024 09:09:57 +0000 (14:39 +0530)]
test/py: bootstage: Add test for bootstage command

Add test cases for bootstage command to print the bootstage report, to
stash the data into memory and to unstash the data from memory.

Signed-off-by: Love Kumar <love.kumar@amd.com>
11 months agoarch: mach-k3: Fix incorrect mapping of higher DDR addresses as device memory
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:

=> time crc32 0x881000000 0x20000000
crc32 for 881000000 ... 8a0ffffff ==> 7f34d7ca

time: 1 minutes, 14.716 seconds

After patch:

=> time crc32 0x881000000 0x20000000
crc32 for 881000000 ... 8a0ffffff ==> 7f34d7ca

time: 2.710 seconds

Acked-by: Andrew Davis <afd@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agotest: Skip cleanup test if not built out of tree
Tobias Deiminger [Mon, 8 Jan 2024 21:11:00 +0000 (22:11 +0100)]
test: Skip cleanup test if not built out of tree

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>
11 months agocmd: nvedit: Fix typo in 'illegal character' error
Ivan Orlov [Mon, 8 Jan 2024 17:20:45 +0000 (17:20 +0000)]
cmd: nvedit: Fix typo in 'illegal character' error

Fix a typo: add a space after the single quote in 'illegal character'
error message in 'env set' command

Signed-off-by: Ivan Orlov <ivan.orlov@codethink.co.uk>
11 months agoimage-host: refactor and protect for very long filenames
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>
11 months agoboard: ti: am64: Support TMDS64EVM
Roger Quadros [Mon, 8 Jan 2024 13:16:50 +0000 (15:16 +0200)]
board: ti: am64: Support TMDS64EVM

The TMDS64EVM [1] ships with AM64X SR2.0 HS-FS chip
and a slightly different board name in the board information
EEPROM header. Support this board.

[1] https://www.ti.com/tool/TMDS64EVM

Gets rid of below message at boot
"Unidentified board claims AM64-EVM in eeprom header"

Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
11 months agoinclude: env: ti: add default for do_main_cpsw0_qsgmii_phyinit
Manorit Chawdhry [Mon, 8 Jan 2024 08:18:49 +0000 (13:48 +0530)]
include: env: ti: add default for do_main_cpsw0_qsgmii_phyinit

By default this variable is unset and this causes the test condition to
fail on devices that don't have this defined. Set a default value for
this.

   => boot
   ## Error: "main_cpsw0_qsgmii_phyinit" not defined
   [...]

Fixes: 0d72b0f2f83b ("include: env: ti: ti_common: Run main_cpsw0_qsgmii_phyinit conditionally")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agoinclude: env: ti: ti_common: Fix a missing semicolon
Manorit Chawdhry [Mon, 8 Jan 2024 08:18:48 +0000 (13:48 +0530)]
include: env: ti: ti_common: Fix a missing semicolon

Fix a missing semicolon that leads to syntax error while booting j721s2.

    Importing environment from mmc1 ...
    syntax error at 'run'HUSH died!

Fixes: 0d72b0f2f83b ("include: env: ti: ti_common: Run main_cpsw0_qsgmii_phyinit conditionally")
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agoboot: superfluous assignment in bootflow_menu_new()
Heinrich Schuchardt [Sun, 7 Jan 2024 09:01:07 +0000 (10:01 +0100)]
boot: superfluous assignment in bootflow_menu_new()

ret is assigned a value 0 which is never used but
is immediately overwritten in the next statement.

Addresses-Coverity-ID: 453304 ("Unused value")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agoboot: remove dead code in bootflow_check()
Heinrich Schuchardt [Sun, 7 Jan 2024 08:43:40 +0000 (09:43 +0100)]
boot: remove dead code in bootflow_check()

The 'return 0;' statement is not reachable. Remove it.
'else' is superfluous after an if statement with return.

Addresses-Coverity-ID: 352451 ("Logically dead code")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agolib: rsa: Allow legacy URI specification without "pkcs11:"
Csókás Bence [Fri, 5 Jan 2024 14:08:04 +0000 (15:08 +0100)]
lib: rsa: Allow legacy URI specification without "pkcs11:"

But emit a warning for it. Then we can remove support when
everyone had time to update their scripts, docs, CI etc.

Fixes: ece85cc020 rsa: use pkcs11 uri as defined in rfc7512
Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
11 months agolib: rsa: Fix PKCS11 URI if one is not given in `keydir`
Csókás Bence [Fri, 5 Jan 2024 14:08:03 +0000 (15:08 +0100)]
lib: rsa: Fix PKCS11 URI if one is not given in `keydir`

If `keydir` is not present, we need to build a PKCS11 URI
from just the key name. In this case, we *do* need 'pkcs11:'

Fixes: ece85cc020 rsa: use pkcs11 uri as defined in rfc7512
Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
11 months agotools: binman: ti_board_cfg: Check for linting problems
Neha Malcom Francis [Fri, 5 Jan 2024 11:39:17 +0000 (17:09 +0530)]
tools: binman: ti_board_cfg: Check for linting problems

Use yamllint for checking whether YAML configuration files are adhering
to default yamllint rules.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Suggested-by: Nishanth Menon <nm@ti.com>
11 months agoboard: ti: *-cfg.yaml: Adhere to yamllint rules
Neha Malcom Francis [Fri, 5 Jan 2024 11:39:16 +0000 (17:09 +0530)]
board: ti: *-cfg.yaml: Adhere to yamllint rules

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>
11 months agoiommu: dont fail silently
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.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agobootdev: avoid infinite probe loop
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().

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
11 months agoRevert "test: hush: dollar: fix bugous behavior"
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.

This reverts commit 6c2f753f4ad3dcee60190949d1286736a6d51d17.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoRevert "cmd: Set modern hush as default shell"
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.

This reverts commit 78912cfde281146d28254b230ecaa9b06722e6ff.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoRevert "test/py: net: Add dhcp abort test"
Tom Rini [Thu, 18 Jan 2024 14:05:38 +0000 (09:05 -0500)]
Revert "test/py: net: Add dhcp abort test"

In practice, as this test defaults to enabled rather than disabled, too
many platforms now fail.

This reverts commit d8364738623ff47dd2321dd68da310abb58fe861.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agoCI: Move to latest Ubuntu "Jammy" tag
Tom Rini [Wed, 17 Jan 2024 20:04:50 +0000 (15:04 -0500)]
CI: Move to latest Ubuntu "Jammy" tag

Move to the latest "Jammy" tag from Ubuntu.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agotest: test_trace.py: Have trace-cmd report always use -l
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.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agotest/py/requirements.txt: Update packaging requirement
Tom Rini [Wed, 17 Jan 2024 20:06:54 +0000 (15:06 -0500)]
test/py/requirements.txt: Update packaging requirement

Update packaging to be version 23.2 to match our Sphinx requirements.
This will let us build a pip cache out of both of our requirements.txt
files.

Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agodocker: build QEMU v8.2.0
Heinrich Schuchardt [Fri, 12 Jan 2024 02:17:57 +0000 (03:17 +0100)]
docker: build QEMU v8.2.0

ACPI support for RISC-V requires a recent QEMU.

Upgrade the used QEMU to v8.2.0.

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>
11 months agoMerge tag 'xilinx-for-v2024.04-rc1-v2' of https://source.denx.de/u-boot/custodians...
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

zynqmp_r5:
- Fix W=1 issue with missing dir

tools:
- Improve zynqmpimage mkimage support

11 months agoMerge tag 'efi-2024-04-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
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

UEFI:

* split unrelated code from efi_bootmgr.c
* rename CONFIG_BOOTEFI_BOOTMGR to CONFIG_EFI_BOOTMGR
* net: tftp: remove explicit EFI configuration dependency
* fs: remove explicit EFI configuration dependency

Other:

* Add Goldfish RTC driver and make it available on RISC-V QEMU

11 months agoMerge branch '2024-01-16-assorted-updates-and-improvements'
Tom Rini [Wed, 17 Jan 2024 14:12:27 +0000 (09:12 -0500)]
Merge branch '2024-01-16-assorted-updates-and-improvements'

- 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

11 months agotest.py: Update pycryptodomex to address CVE-2023-52323
Tom Rini [Fri, 5 Jan 2024 19:43:43 +0000 (14:43 -0500)]
test.py: Update pycryptodomex to address CVE-2023-52323

The version of pycryptodomex that we use is vulnerable to this CVE.
While not likely an issue for us, let us upgrade to be on the safe side.

Reported-by: GitHub dependabot
Signed-off-by: Tom Rini <trini@konsulko.com>
11 months agodoc: drop references to non-existing CONFIG_MEM_SUPPORT_64BIT_DATA
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:10 +0000 (11:47 +0100)]
doc: drop references to non-existing CONFIG_MEM_SUPPORT_64BIT_DATA

Such a config option does not exist. Rephrase, and avoid mentioning
MEM_SUPPORT_64BIT_DATA, which is an implementation detail.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agoREADME: drop mention of MEM_SUPPORT_64BIT_DATA
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:09 +0000 (11:47 +0100)]
README: drop mention of MEM_SUPPORT_64BIT_DATA

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.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agocmd/mem.c: fix wrong use of ifdef, drop pointless SUPPORT_64BIT_DATA macro
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:08 +0000 (11:47 +0100)]
cmd/mem.c: fix wrong use of ifdef, drop pointless SUPPORT_64BIT_DATA macro

The macro MEM_SUPPORT_64BIT_DATA is always defined, as either 1 or 0,
so using "#ifdef MEM_SUPPORT_64BIT_DATA" doesn't do what one
expects.

This means that currently all 32 bit targets get compiled with the .q
suffix mentioned in the help text, while it doesn't actually work.

Use the proper "#if" instead.

There's really no point defining another similarly-named macro with
exactly the same value, so just use MEM_SUPPORT_64BIT_DATA throughout.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agotest: add test of "cp" shell command
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:07 +0000 (11:47 +0100)]
test: add test of "cp" shell command

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agoriscv: qemu: imply GOLDFISH_RTC
Heinrich Schuchardt [Sat, 30 Dec 2023 23:53:01 +0000 (00:53 +0100)]
riscv: qemu: imply GOLDFISH_RTC

QEMU's virt board provides an emulated Goldfish RTC. Enable the driver by
default.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agortc: driver for Goldfish RTC
Heinrich Schuchardt [Sat, 30 Dec 2023 23:53:00 +0000 (00:53 +0100)]
rtc: driver for Goldfish RTC

The Goldfish RTC is a virtual device which may be supplied by QEMU.
It is enabled by default on QEMU's RISC-V virt machine.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agofs: remove explicit efi configuration dependency
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>
11 months agonet: tftp: remove explicit efi configuration dependency
AKASHI Takahiro [Wed, 17 Jan 2024 04:39:43 +0000 (13:39 +0900)]
net: tftp: 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: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agoefi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR
AKASHI Takahiro [Wed, 17 Jan 2024 04:39:42 +0000 (13:39 +0900)]
efi_loader: rename BOOTEFI_BOOTMGR to EFI_BOOTMGR

At this point, EFI boot manager interfaces is fully independent from
bootefi command. So just rename the configuration parameter.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoefi_loader: split unrelated code from efi_bootmgr.c
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.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
11 months agodoc: update requirements.txt
Heinrich Schuchardt [Sun, 14 Jan 2024 13:18:23 +0000 (14:18 +0100)]
doc: update requirements.txt

Update requirements.txt to most current packages as produced by

   python3 -m pip install six sphinx-rtd-theme sphinx-prompt
   python3 -m pip freeze

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agodoc: import Sphinx theme.css and pygments.css
Heinrich Schuchardt [Sun, 14 Jan 2024 13:18:22 +0000 (14:18 +0100)]
doc: import Sphinx theme.css and pygments.css

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>
11 months agodoc: update theme_overrides.css
Heinrich Schuchardt [Sun, 14 Jan 2024 13:18:21 +0000 (14:18 +0100)]
doc: update theme_overrides.css

Update theme_overrides.css from Linux v6.7.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agodoc: add sphinx_rtd_theme extension
Heinrich Schuchardt [Sun, 14 Jan 2024 13:18:20 +0000 (14:18 +0100)]
doc: add sphinx_rtd_theme extension

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>
11 months agodocs/sphinx: Explicitly convert Sphinx paths to str
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>
11 months agodoc: create index entries for commands
Heinrich Schuchardt [Sun, 14 Jan 2024 13:53:13 +0000 (14:53 +0100)]
doc: create index entries for commands

Add the description of CLI commands to the generated index.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agodoc: add generated index to table of contents
Heinrich Schuchardt [Sun, 14 Jan 2024 13:54:03 +0000 (14:54 +0100)]
doc: add generated index to table of contents

Show the index in the navigation sidebar.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
11 months agodoc: dfu: fix a handful of typos
Mattijs Korpershoek [Wed, 3 Jan 2024 08:00:04 +0000 (09:00 +0100)]
doc: dfu: fix a handful of typos

Reword some sentences, add missing periods and fix various typos in the
dfu documentation.

This was originally contributed on [1]

[1] https://github.com/Maalobs/u-boot/commit/9a21ed8ba722d904b68945f40ca6697b4b1cc4d4

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
11 months agoconfigs: zynqmp_kria: Enable CONFIG_OF_BOARD_SETUP
Venkatesh Yadav Abbarapu [Wed, 17 Jan 2024 03:20:14 +0000 (08:50 +0530)]
configs: zynqmp_kria: Enable CONFIG_OF_BOARD_SETUP

Enable CONFIG_OF_BOARD_SETUP, so we could use ft_board_setup()
to enable the kaslr-seed and pass to kernel.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240117032014.1014084-3-venkatesh.abbarapu@amd.com
11 months agoxilinx: board: Update the kaslr-seed property
Venkatesh Yadav Abbarapu [Wed, 17 Jan 2024 03:20:13 +0000 (08:50 +0530)]
xilinx: board: Update the kaslr-seed property

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.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240117032014.1014084-2-venkatesh.abbarapu@amd.com
11 months agocmd/command.c: relax length check in cmd_get_data_size()
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:06 +0000 (11:47 +0100)]
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).

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agocmd/command.c: constify "arg" argument of cmd_get_data_size()
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:05 +0000 (11:47 +0100)]
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.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agodoc/usage/cmd/cp.rst: document that overlapping regions are supported
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:04 +0000 (11:47 +0100)]
doc/usage/cmd/cp.rst: document that overlapping regions are supported

Now that the cp command is changed to use memmove() internally, update
the documentation to explicitly state that overlapping regions are
allowed.

Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
11 months agocmd/mem.c: use memmove in do_mem_cp()
Rasmus Villemoes [Wed, 3 Jan 2024 10:47:03 +0000 (11:47 +0100)]
cmd/mem.c: use memmove in do_mem_cp()

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>
11 months agotest/py: memtest: Add tests for mtest command
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

Signed-off-by: Love Kumar <love.kumar@amd.com>
11 months agoreset: npcm: Add support for Nuvoton NPCM BMC family
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.

And The driver support each module reset.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
11 months agotest/py: i2c: Add tests for i2c command
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

Signed-off-by: Love Kumar <love.kumar@amd.com>
11 months agotest/py: mii: Add tests for mii command
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>
11 months agoARM add initial support for the Phytium Pe2201 Board.
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.

11 months agolib: smbios: remove redundant next_header()
Heinrich Schuchardt [Sat, 23 Dec 2023 01:17:33 +0000 (02:17 +0100)]
lib: smbios: remove redundant next_header()

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>
11 months agosmbios: copy QEMU tables
Heinrich Schuchardt [Sat, 23 Dec 2023 01:03:34 +0000 (02:03 +0100)]
smbios: copy QEMU tables

QEMU provides SMBIOS tables with detailed information. We should not try to
replicate them in U-Boot.

If we want to inform about U-Boot, we can add a Firmware Inventory
Information (type 45) table in future.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
11 months agoarm: dts: k3-j721e-binman: Add support for HS-SE 2.0
Neha Malcom Francis [Wed, 20 Dec 2023 11:34:33 +0000 (17:04 +0530)]
arm: dts: k3-j721e-binman: Add support for HS-SE 2.0

Add support for J721E HS-SE 2.0 device. Make use of the existing
templates and override the phandles for sysfw.itb so that builds do not
fail.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
11 months agodoc: board: phytec: Add phyCORE-AM62x
Wadim Egorov [Wed, 20 Dec 2023 09:18:11 +0000 (10:18 +0100)]
doc: board: phytec: Add phyCORE-AM62x

Add documentation for PHYTEC phyCORE-AM62x SoM.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
11 months agoboard: phytec: am62x: Add PHYTEC phyCORE-AM62x SoM
Wadim Egorov [Wed, 20 Dec 2023 09:18:10 +0000 (10:18 +0100)]
board: phytec: am62x: Add PHYTEC phyCORE-AM62x SoM

Add basic support for PHYTEC phyCORE-AM62x SoM.

Supported features:
  - 2GB DDR4 RAM
  - eMMC Flash
  - OSPI NOR Flash
  - external uSD
  - Ethernet
  - debug UART

Product page SoM: https://www.phytec.com/product/phycore-am62x

Device trees were taken from Linux v6.7-rc3.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
11 months agotest/py: mdio: Add tests for mdio command
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>
11 months agotest/py: net: Add dhcp abort test
Love Kumar [Tue, 21 Nov 2023 13:02:47 +0000 (18:32 +0530)]
test/py: net: Add dhcp abort test

Abort the dhcp request in the middle by pressing ctrl + c on u-boot
prompt and validate the abort status.

Signed-off-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
11 months agoMerge tag 'qcom-2024.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapd...
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

11 months agoMerge tag 'u-boot-imx-20240115' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Tue, 16 Jan 2024 14:49:48 +0000 (09:49 -0500)]
Merge tag 'u-boot-imx-20240115' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

11 months agosandbox_flattree: enable button support
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>
11 months agotest: spmi: fix tests
Caleb Connolly [Mon, 8 Jan 2024 15:30:51 +0000 (15:30 +0000)]
test: spmi: fix tests

With the recent changes to the Qualcomm PMIC GPIO driver the sandbox
tests for it no longer pass, update the DTS and tests to work with the
changes.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopmic: qcom: dont use dev_read_addr to get USID
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.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agospmi: msm: fix register range names
Caleb Connolly [Tue, 5 Dec 2023 13:46:53 +0000 (13:46 +0000)]
spmi: msm: fix register range names

The core and chnl register ranges were swapped on SDM845. Fix it, and
fetch the register ranges by name instead of by index.

Drop the cosmetic "version" variable and clean up the debug logging.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: drop gpio-count property
Caleb Connolly [Tue, 5 Dec 2023 13:46:52 +0000 (13:46 +0000)]
gpio: qcom_pmic: drop gpio-count property

This property is not part of the dt bindings and all boards use the new
gpio-ranges property instead. Drop support for this.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agodts: qcom: adjust pmic gpio to use upstream bindings
Caleb Connolly [Tue, 5 Dec 2023 13:46:51 +0000 (13:46 +0000)]
dts: qcom: adjust pmic gpio to use upstream bindings

Use the upstream gpio-ranges property instead of gpio-count, and drop
the bank-name property for Qualcomm boards.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agogpio: qcom_pmic: support upstream DT
Caleb Connolly [Tue, 5 Dec 2023 13:46:50 +0000 (13:46 +0000)]
gpio: qcom_pmic: support upstream DT

Upstream uses the gpio-ranges property to define the number of GPIOs,
support for parsing this when gpio-count is unspecified

Additionally, drop the bank-name property as it isn't used in upstream,
and we can just hardcode the bank name instead.

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>
11 months agogpio: qcom_pmic: drop pon GPIO driver
Caleb Connolly [Tue, 5 Dec 2023 13:46:49 +0000 (13:46 +0000)]
gpio: qcom_pmic: drop pon GPIO driver

Remove the (now unused) GPIO driver for the power and resin buttons on
the PMIC.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agomach-snapdragon: switch to PMIC button driver
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.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Tested-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agobutton: qcom-pmic: introduce Qualcomm PMIC button driver
Caleb Connolly [Tue, 5 Dec 2023 13:46:47 +0000 (13:46 +0000)]
button: qcom-pmic: introduce Qualcomm PMIC 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>
11 months agogpio: qcom_pmic: fix silent dev_read_addr downcast
Caleb Connolly [Tue, 5 Dec 2023 13:46:46 +0000 (13:46 +0000)]
gpio: qcom_pmic: fix silent dev_read_addr downcast

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>
11 months agoserial: msm-geni: handle devm_clk_get() errors
Caleb Connolly [Tue, 14 Nov 2023 12:51:12 +0000 (12:51 +0000)]
serial: msm-geni: handle devm_clk_get() errors

devm_clk_get() returns an ERR_PTR on failure, not null. Fix the check to
avoid the board crashing when the clock isn't available.

Additionally, add the missing error handling for this function.

Fixes: 324df15a292e ("serial: qcom: add support for GENI serial driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoserial: msm-geni: don't rely on parent misc device
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.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agomsm_gpio: use unsigned int
Caleb Connolly [Tue, 14 Nov 2023 12:55:43 +0000 (12:55 +0000)]
msm_gpio: use unsigned int

Replaces the uses of "unsigned" with "unsigned int".

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: make compatible with linux DTs
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.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: move ipq4019 driver from mach-ipq40xx
Caleb Connolly [Tue, 14 Nov 2023 12:55:41 +0000 (12:55 +0000)]
pinctrl: qcom: move ipq4019 driver from mach-ipq40xx

Drop the duplicated pinctrl-snapdragon driver from mach-ipq40xx and add
it to drivers/pinctrl/qcom.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agopinctrl: qcom: move out of mach-snapdragon
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.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: fix rcg divider value
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.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: add mnd_width to clk_rcg_set_rate_mnd()
Caleb Connolly [Tue, 7 Nov 2023 12:41:04 +0000 (12:41 +0000)]
clk/qcom: add mnd_width to clk_rcg_set_rate_mnd()

This property is needed on some platforms to ensure that only the
relevant bits are set in the M/N/D registers.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: use function pointers for enable and set_rate
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.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
[caleb: remove additional sysmap-sdm845.h mention]

11 months agoclk/qcom: sdm845: add register map for simple gate clocks
Caleb Connolly [Tue, 7 Nov 2023 12:41:02 +0000 (12:41 +0000)]
clk/qcom: sdm845: add register map for simple gate clocks

Many gate clocks can be enabled with a single register write, add support
for defining these simple gate clocks and add the ones found on SDM845.

While we're here, inline clk_init_uart() into msm_set_rate().

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: handle resets and clocks in one device
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]

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: move ipq4019 driver from mach-ipq40xx
Caleb Connolly [Tue, 7 Nov 2023 12:41:00 +0000 (12:41 +0000)]
clk/qcom: move ipq4019 driver from mach-ipq40xx

This driver is just a stub, but it's necessary to support the upcoming
reset driver changes.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoclk/qcom: move from mach-snapdragon
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.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
11 months agoMerge tag 'u-boot-nand-20240115' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 15 Jan 2024 14:29:57 +0000 (09:29 -0500)]
Merge tag 'u-boot-nand-20240115' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

Pull request for u-boot-nand-20240115

The first patch is by Heinrich Schuchardt and fixes an integer overflow

The following two patches are by Dario Binacchi and add arguments check
to the nand_mtd_to_devnum() and nand_register() functions.

The remaining patches are by Roger Quadros and include various fixes for
the OMAP platform.

11 months agoarm: xea: Add support for boot image source descriptor in SPL
Anatolij Gustschin [Mon, 15 Jan 2024 13:51:30 +0000 (14:51 +0100)]
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.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Lukasz Majewski <lukma@denx.de>
11 months agoarm: config: Enable CRC8 support in SPL on imx287 XEA board
Lukasz Majewski [Mon, 15 Jan 2024 13:51:29 +0000 (14:51 +0100)]
arm: config: Enable CRC8 support in SPL on imx287 XEA board

The boot0/1 feature uses simple CRC8 to check (in SPL) if
SPI-NOR content is not corrupted, hence the need to enable
it.

Signed-off-by: Lukasz Majewski <lukma@denx.de>