]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
3 weeks agonet: lwip: wget: fix legacy syntax
Jerome Forissier [Tue, 26 Nov 2024 14:45:06 +0000 (15:45 +0100)]
net: lwip: wget: fix legacy syntax

Commit 356011f7ac25 ("lwip: fix code style issues") has inadvertently
broken the support for the legacy syntax:

 => wget 192.168.0.16:test.bin
 invalid uri, no file path
 Invalid URL. Use http(s)://

The reason is two calls to strncpy() were replaced by strlcpy() without
paying attention to the fact that they are not equivalent in the present
case. Since we are using a character counter (n) and since we do not
depend on having a properly null-terminated string at each step in the
parsing, strlcpy() is not justified and strncpy() is the right tool for
the job. So use it again.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
3 weeks agoRevert "efi_memory: do not add U-Boot memory to the memory map"
Ilias Apalodimas [Fri, 29 Nov 2024 17:08:13 +0000 (19:08 +0200)]
Revert "efi_memory: do not add U-Boot memory to the memory map"

This reverts commit ("commit a68c9ac5d8af ("efi_memory: do not add
U-Boot memory to the memory map").

This code was removed when the EFI subsystem started using LMB calls for
the reservations. In hindsight it unearthed two problems.

The e820 code is adding u-boot memory as EfiReservedMemory while it
should look at what LMB added and decide instead of blindly overwriting
it. The reason this worked is that we marked that code properly late,
when the EFI came up. But now with the LMB changes, the EFI map gets
added first and the e820 code overwrites it.

The second problem is that we never mark SetVirtualAddressMap as runtime
code, which we should according to the spec. Until we fix this the
current hack can't go away, at least for architectures that *need* to
call SVAM.

More specifically x86 currently requires SVAM and sets the NX bit for
pages not marked as *_CODE. So unless we do that late, it will crash
trying to execute from non-executable memory. It's also worth noting
that x86 calls SVAM late in the boot, so this will work until someone
decides to overwrite/use BootServicesCode from the OS.

Notably arm64 disables it explicitly if the VA space is > 48bits, so
doesn't suffer from any of these problems.

This doesn't really deserve a fixes tag, since it brings back a hack to
remedy a situation that was wrong long before that commit, but in case
anyone hits the same bug ...
Simon sent the original revert in the link, but we need a proper
justification for it.

Link: https://lore.kernel.org/u-boot/20241112131830.576864-1-sjg@chromium.org/
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reported-by: Simon Glass <sjg@chromium.org>
3 weeks agoMerge tag 'u-boot-imx-master-20241130' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sat, 30 Nov 2024 14:34:45 +0000 (08:34 -0600)]
Merge tag 'u-boot-imx-master-20241130' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/23643

- Make DRAM coding GPIOs available before relocation on Data Modul
  i.MX8M Mini/Plus eDM SBC because the DRAM configuration GPIO straps
  must be accessible in SPL and before relocation because the GPIOs are
  sampled both in U-Boot SPL as well as early on in U-Boot proper.
- Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC
  instead of failing with hang() or panic().
- Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL since
  SDP is much more flexible.
- Deduplicate Data Modul i.MX8M eDM SBC defconfigs.
- Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM
  SBC.

3 weeks agotest/cmd/wget.c: move net_test_wget() to the cmd test suite
Jerome Forissier [Fri, 15 Nov 2024 16:45:14 +0000 (17:45 +0100)]
test/cmd/wget.c: move net_test_wget() to the cmd test suite

Since net_test_wget() is testing a command and is in test/cmd it should
be in the 'cmd' test suite, not 'lib'.

Saving and restoring the values of the environment variables that the
test manipulates is necessary to avoid a regression when running the
whole ut test suite. A minimal reproducer is:

 $ ./u-boot -T -c "ut cmd net_test_wget; ut dm dm_test_eth_act" | \
     grep -E "(Test:|Failures:)"

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
3 weeks agoRevert "arm64: dts: ti: k3-j7200: Fix OSPI boot"
Tom Rini [Fri, 29 Nov 2024 13:50:33 +0000 (07:50 -0600)]
Revert "arm64: dts: ti: k3-j7200: Fix OSPI boot"

While I had thought this commit was a cherry-pick from upstream, it is
not. And so, this is not allowed here.

This reverts commit dfe5f16a33453b742a66cabc8ea9a52a33279810.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 weeks agoARM: dts: imx: Enable PCIe and NVMe on Data Modul i.MX8M Mini eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:35:43 +0000 (01:35 +0100)]
ARM: dts: imx: Enable PCIe and NVMe on Data Modul i.MX8M Mini eDM SBC

Enable PCIe/NVMe support on Data Modul i.MX8M Mini eDM SBC. Except for
the configuration options which are enabled, add slight adjustment
to board u-boot.dtsi, which is necessary as there is currently no
driver for the I2C PCIe clock generator. Since the generator is
strapped to be always on, it is possible to supplant the generator
functionality by fixed-clock.

Signed-off-by: Marek Vasut <marex@denx.de>
3 weeks agoARM: imx: Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL
Marek Vasut [Fri, 29 Nov 2024 02:41:47 +0000 (03:41 +0100)]
ARM: imx: Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL

The YModem support in SPL was never really used on this device,
the SDP support is much more convenient on i.MX8M Mini based
hardware. Replace the YModem support with SDP support.

The SDP can be utilized by forcing the board into SDP boot mode
by grounding test point right next to silkscreen label U30, and
then by using mfgtools 'uuu -brun spl flash.bin' once the device
enumerates on host system USB bus. The SDP capable USB port is
available on the USB micro-B port on the base board.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
3 weeks agoARM: imx: Deduplicate Data Modul i.MX8M eDM SBC defconfigs
Marek Vasut [Fri, 29 Nov 2024 00:13:56 +0000 (01:13 +0100)]
ARM: imx: Deduplicate Data Modul i.MX8M eDM SBC defconfigs

Deduplicate defconfigs for all Data Modul i.MX8M eDM SBC systems by factoring
out the common parts into generic imx8m_data_modul.config and including
those using the #include <configs/...> preprocessor macro in the current
set of board specific defconfigs. The preprocessor macro is applicable
to defconfigs as well.

This introduces no functional change, the resulting .config is almost
identical for all Data Modul i.MX8M eDM SBC systems, except for slight
alignment in DEBUG_UART and SYS_PBSIZE.

Signed-off-by: Marek Vasut <marex@denx.de>
3 weeks agoARM: imx: Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:13:55 +0000 (01:13 +0100)]
ARM: imx: Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM SBC

The current A/B switching preparatory altbootcmd is confusing
to users, replace it with plain 'run bootcmd' which can be
replaced by proper A/B switching altbootcmd when the matching
updater is added on top of the platform. By default, keep the
boot counter incrementing, but do not do any A/B partition
switching.

Signed-off-by: Marek Vasut <marex@denx.de>
3 weeks agoARM: dts: imx: Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:13:54 +0000 (01:13 +0100)]
ARM: dts: imx: Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC

In case gpio_request_list_by_name_nodev() in board dmo_get_memcfg()
returns error code, pick a safe default DRAM configuration instead
of bailing out with some sort of hang() or panic(). The BIT(2)|BIT(0)
strap option is the lowest known option of 2 GiB , use that.

Signed-off-by: Marek Vasut <marex@denx.de>
3 weeks agoARM: dts: imx: Make DRAM coding GPIOs available before relocation on Data Modul i...
Marek Vasut [Fri, 29 Nov 2024 00:13:53 +0000 (01:13 +0100)]
ARM: dts: imx: Make DRAM coding GPIOs available before relocation on Data Modul i.MX8M Mini/Plus eDM SBC

The DRAM configuration GPIO straps must be accessible in SPL and before
relocation because the GPIOs are sampled both in U-Boot SPL as well as early
on in U-Boot proper. The already present bootph-pre-ram DT property made the
GPIO controllers available in SPL, but not early on in U-Boot proper, which
made gpio_request_list_by_name_nodev() in board dmo_get_memcfg() fail. Add
missing bootph-some-ram DT property to all GPIO controllers which are
referenced in dmo,ram-coding-gpios DT property to make those GPIO
controllers available early in U-Boot proper as well.

Fixes: 8c103c33fb14 ("dm: dts: Convert driver model tags to use new schema")
Signed-off-by: Marek Vasut <marex@denx.de>
3 weeks agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 27 Nov 2024 13:34:17 +0000 (07:34 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/23592

- some configs modification

3 weeks agoMerge branch 'u-boot-nand-20241126' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 27 Nov 2024 13:33:06 +0000 (07:33 -0600)]
Merge branch 'u-boot-nand-20241126' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/23584

Remove device specific nand driver files as they are now replaced by a
common driver bcmbca_nand.c

Make use of OF_UPSTREAM which uses Linux dts.

Implement a minimal set of defconfig options to enable basic NAND
functionality. Tested on:
47622
63146
63158
63178
6813

Set parameter_page_big_endian to zero for bcmbca.

Update log level messages so that more critical messages can be logged
to console and help the troubleshooting with field devices.

3 weeks agoconfigs: enable CONFIG_PCI_REGION_MULTI_ENTRY=y in sifive_unmatched_defconfig
Yuri Zaporozhets [Tue, 19 Nov 2024 20:59:59 +0000 (21:59 +0100)]
configs: enable CONFIG_PCI_REGION_MULTI_ENTRY=y in sifive_unmatched_defconfig

Currently, the PCI subsystem selects the small "region 2" (which starts at 0x7000000)
as bus_addr/phys_addr. As a consequence, the BAR0 on PCIe video card cannot be initialized,
because it simply doesn't fit into 0x1000000 bytes size of "region 2".

U-Boot should use "region 1" instead (the one which starts at 0x60090000), because
it has much bigger size (0xFF70000), and easily accomodates BAR0 of the video card.
Linux kernel also uses 0x60090000 as bus_start/phys_start.

Signed-off-by: Yuri Zaporozhets <yuriz@vodafonemail.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 weeks agoconfigs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE
Andreas Schwab [Tue, 12 Nov 2024 16:27:22 +0000 (17:27 +0100)]
configs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE

To restore MMC boot, enable SPL_SYS_MMCSD_RAW_MODE and recover
SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION and
SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.

Fixes: 2a00d73d081 ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 weeks agoconfigs: SiFive Unmatched: enable 'env erase' sub-command
Heinrich Schuchardt [Tue, 12 Nov 2024 10:42:23 +0000 (11:42 +0100)]
configs: SiFive Unmatched: enable 'env erase' sub-command

With the move from script based booting to using bootmeth a lot of
environment variables have changed. To always use the default environment
it is recommendable to erase the environment stored in the SPI flash.
This can be done with the 'env erase' sub-command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 weeks agospl: increase SPL_SYS_MALLOC_SIZE when using BIOSEMU on RISC-V
Yuri Zaporozhets [Mon, 11 Nov 2024 19:24:04 +0000 (20:24 +0100)]
spl: increase SPL_SYS_MALLOC_SIZE when using BIOSEMU on RISC-V

If BIOSEMU is compiled for RISC-V (SiFive Unmatched board) and the function
dm_pci_run_vga_bios() is executed, U-Boot stops with error message saying
that the SPL malloc pool is too small. So increase the default pool size
when both BIOSEMU and RISCV parameters are set.

Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
3 weeks agomtd: rawnand: brcmnand: update log level messages
david regan [Wed, 13 Nov 2024 06:27:15 +0000 (22:27 -0800)]
mtd: rawnand: brcmnand: update log level messages

Update log level messages so that more critical messages can be logged
to console and help the troubleshooting with field devices.

This is a port of the upstream Linux patch to U-Boot.

https://lore.kernel.org/linux-mtd/20240223034758.13753-4-william.zhang@broadcom.com/

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
3 weeks agomtd: rawnand: brcmnand: Default bcmbca parameter_page_big_endian to zero
david regan [Wed, 13 Nov 2024 06:27:14 +0000 (22:27 -0800)]
mtd: rawnand: brcmnand: Default bcmbca parameter_page_big_endian to zero

Set parameter_page_big_endian to zero for bcmbca

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
3 weeks agoarm: dts: Use upstream dts
david regan [Wed, 13 Nov 2024 06:27:13 +0000 (22:27 -0800)]
arm: dts: Use upstream dts

Make use of OF_UPSTREAM which uses Linux dts.

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
3 weeks agomtd: nand: brcmnand: remove device specific nand driver files
david regan [Wed, 13 Nov 2024 06:27:12 +0000 (22:27 -0800)]
mtd: nand: brcmnand: remove device specific nand driver files

These device specific nand driver files can be removed because
they are now replaced by a common driver bcmbca_nand.c

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
3 weeks agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 26 Nov 2024 14:10:18 +0000 (08:10 -0600)]
configs: Resync with savedefconfig

Rsync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
3 weeks agoMerge tag 'u-boot-dfu-20241126' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Tue, 26 Nov 2024 14:05:11 +0000 (08:05 -0600)]
Merge tag 'u-boot-dfu-20241126' of https://source.denx.de/u-boot/custodians/u-boot-dfu

CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/23572

- Fastboot:
  - handle unknown partition type as "raw"
- USB gadget:
  - Fix ci_udc gadget driver for Tegra 2 devices by not using USBADRA

3 weeks agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 26 Nov 2024 14:04:44 +0000 (08:04 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell

CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=379&view=results

- mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards (Tony)
- kirkwood: Enable bootstd for Sheevaplug board (Tony)
- mvebu: Add Allied Telesis x250 board (Chris)
- mvebu: Updates for Allied Telesis boards (Chris)

3 weeks agoarm: mvebu: Add Allied Telesis x250 board
Chris Packham [Mon, 25 Nov 2024 19:55:53 +0000 (08:55 +1300)]
arm: mvebu: Add Allied Telesis x250 board

The x250 and SE250 are series of 10G L2+ switches from Allied Telesis.
There are a number of them in the range but as far as U-Boot is
concerned all the CPU block components are the same so there's only one
board defined.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x530: Enable IPV6 support
Chris Packham [Fri, 22 Nov 2024 00:30:21 +0000 (13:30 +1300)]
arm: mvebu: x530: Enable IPV6 support

Enable IPV6 support for the x530 board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x530: Don't build mkeficapsule
Chris Packham [Fri, 22 Nov 2024 00:30:20 +0000 (13:30 +1300)]
arm: mvebu: x530: Don't build mkeficapsule

The x530 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x530: Remove dead comments
Chris Packham [Fri, 22 Nov 2024 00:30:19 +0000 (13:30 +1300)]
arm: mvebu: x530: Remove dead comments

As things have been moved to Kconfig there are a number of dead comments
left over in x530.h. Remove them.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x240: Enable IPV6 support
Chris Packham [Fri, 22 Nov 2024 00:30:18 +0000 (13:30 +1300)]
arm: mvebu: x240: Enable IPV6 support

Enable IPV6 support for the x240 board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x240: Don't build mkeficapsule
Chris Packham [Fri, 22 Nov 2024 00:30:17 +0000 (13:30 +1300)]
arm: mvebu: x240: Don't build mkeficapsule

The x240 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x240: Switch to standard boot
Chris Packham [Fri, 22 Nov 2024 00:30:16 +0000 (13:30 +1300)]
arm: mvebu: x240: Switch to standard boot

Use standard boot instead of the distro boot scripts. Regenerate the
board defconfig now that some options are selected automatically.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: x240: Use default baudrate table
Chris Packham [Fri, 22 Nov 2024 00:30:15 +0000 (13:30 +1300)]
arm: mvebu: x240: Use default baudrate table

Remove CFG_SYS_BAUDRATE_TABLE as there's no reason not to use the
defaults defined via config_fallbacks.h.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: kirkwood: Enable bootstd for Sheevaplug board
Tony Dinh [Thu, 21 Nov 2024 19:02:27 +0000 (11:02 -0800)]
arm: kirkwood: Enable bootstd for Sheevaplug board

Enable bootstd for Sheevaplug board.
Remove JFFS2 support. See JFFS2 Vulnerability[1].
Enable LTO to keep board size within limit.
Move default envs to text-base environment

[1] https://lore.kernel.org/u-boot/20241114233005.GN3600562@bill-the-cat/T/#m2fc25da1d2c019bc3cd8676991fdd64b8a21aa9b

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agoarm: mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards
Tony Dinh [Mon, 18 Nov 2024 19:34:59 +0000 (11:34 -0800)]
arm: mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards

These boards don't use JFFS2 file system for booting so remove it.

Ref: https://lore.kernel.org/u-boot/20241114233005.GN3600562@bill-the-cat/T/#t
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
3 weeks agousb: ci_udc: don't use "advance" feature when setting address
Ion Agorria [Tue, 26 Nov 2024 07:29:56 +0000 (09:29 +0200)]
usb: ci_udc: don't use "advance" feature when setting address

In the older USB controllers like for example in ChipIdea controller
used by the Tegra 2 the "USBADRA: Device Address Advance" bitflag
does not exist, so the new device address set during SET_ADDRESS
can't be deferred by hardware, which causes the host to not recognize
the device and give an error.

Instead store it until ep completes to apply the change into the hw
register as Linux kernel does. This should fix regression on old and
and be compatible with newer controllers.

Inspired by: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef15e5490edc7edf808d3477ab32e0e320792f65

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241126072956.64778-2-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
3 weeks agoPrepare v2025.01-rc3
Tom Rini [Mon, 25 Nov 2024 22:58:57 +0000 (16:58 -0600)]
Prepare v2025.01-rc3

Signed-off-by: Tom Rini <trini@konsulko.com>
3 weeks agoMerge branch 'master-asix' of https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Mon, 25 Nov 2024 21:32:16 +0000 (15:32 -0600)]
Merge branch 'master-asix' of https://source.denx.de/u-boot/custodians/u-boot-usb

- Fix two issues with the asix88179 driver

3 weeks agospi: Fix missed rename from SPI_ADVANCE to SPI_STACKED_PARALLEL
Dominik Wernberger [Mon, 25 Nov 2024 21:21:52 +0000 (22:21 +0100)]
spi: Fix missed rename from SPI_ADVANCE to SPI_STACKED_PARALLEL

Fix missed rename from SPI_ADVANCE to SPI_STACKED_PARALLEL. This fixes
an issue encountered while testing the Zynq-7000 QSPI parallel Flash
implementation.

Fixes: f896aa656774 ("mtd: spi-nor: Rename SPI_ADVANCE to SPI_STACKED_PARALLEL")
Reviewed-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Dominik Wernberger <dominik.wernberger@gmx.de>
3 weeks agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Mon, 25 Nov 2024 18:37:46 +0000 (12:37 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Support for Microchip USB5744 hub

3 weeks agoast2600: spl: Use readl for reading mmio
Joel Stanley [Mon, 18 Nov 2024 02:12:56 +0000 (12:42 +1030)]
ast2600: spl: Use readl for reading mmio

u-boot was crashing in qemu as the modeled hardware enforced overly
strict memory reads.

While this code will work on existing hardware, fix to avoid future issues.

Fixes: 12770d0df0e8 ("ast2600: spl: Add boot mode detection")
Link: https://gitlab.com/qemu-project/qemu/-/issues/2636
Signed-off-by: Joel Stanley <joel@jms.id.au>
3 weeks agomtd: Drop superfluous const qualifier
Andy Shevchenko [Mon, 21 Oct 2024 14:20:40 +0000 (17:20 +0300)]
mtd: Drop superfluous const qualifier

The compiler will ignore it anyway:

  include/linux/mtd/mtd.h:342:15: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
3 weeks agoeth: asix88179: packet drop when receiving large fragmented packets
Khoa Hoang [Fri, 8 Nov 2024 05:51:36 +0000 (21:51 -0800)]
eth: asix88179: packet drop when receiving large fragmented packets

The ASIX 88179A drops packets when receiving fragmented packets larger
than the MTU size due to an insufficient URB buffer size. This change
synchronizes the URB buffer size with the configuration used in the
Linux kernel, resolving the packet drop issue.

To reproduce the issue, set the following configuration:
    CONFIG_IP_DEFRAG=y
    CONFIG_TFTP_BLOCKSIZE=16352

Then, run the `tftp` command. It will fail with a timeout error:

    U-Boot> tftp zero.bin
    Using ax88179_eth device
    TFTP from server 10.0.0.196; our IP address is 10.0.0.18
    Filename 'zero.bin'
    Load address: 0x10000000
    Loading: T T T T T T T T T T T
    Retry count exceeded; starting again

Signed-off-by: Khoa Hoang <admin@khoahoang.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agoeth: asix88179: Fix ASIX AX88179A PHY hang
Khoa Hoang [Fri, 8 Nov 2024 05:51:35 +0000 (21:51 -0800)]
eth: asix88179: Fix ASIX AX88179A PHY hang

The ASIX AX88179A locks up when the ADVERTISE_NPAGE bit is set in the
MII_ADVERTISE register, suggesting that this feature may be broken or
unsupported on this chip. In the Linux kernel, this bit is not set,
and enabling it also causes the PHY to lock up and stay in a
link-down state.

Additionally, the AX88179 and AX88179A variants do not appear to
support the ADVERTISE_LPACK bit, as setting it consistently reads
back as 0.

This patch removes the ADVERTISE_NPAGE and ADVERTISE_LPACK bits from
the MII_ADVERTISE register configuration. It also resets the PHY
before modifying the MII_ADVERTISE register, then restarts
auto-negotiation, following the same flow used in the U-Boot asix.c
driver.

Signed-off-by: Khoa Hoang <admin@khoahoang.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agousb: onboard-hub: Bail out if peer hub is already probed
Venkatesh Yadav Abbarapu [Mon, 25 Nov 2024 04:12:02 +0000 (09:42 +0530)]
usb: onboard-hub: Bail out if peer hub is already probed

The .bind function is implemented to bind the correct
"half" of the hub that the driver wants to bind,
and returning -ENODEV for the other "half".

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agousb: onboard-hub: Add i2c initialization for usb5744 hub
Venkatesh Yadav Abbarapu [Mon, 25 Nov 2024 04:12:01 +0000 (09:42 +0530)]
usb: onboard-hub: Add i2c initialization for usb5744 hub

Add i2c initialization hook and set usb5744 platform
data with function having required i2c initialization sequence.

Apart from the USB command attach, prevent the hub from suspend.
when the “USB Attach with SMBUS (0xAA56)” command is issued to the hub,
the hub is getting enumerated and then it puts in a suspend mode.
This causes the hub to NAK any SMBUS access made by the SMBUS Master
during this period and not able to see the hub's slave address while
running the "i2c probe" command.

Prevent the MCU from the putting the HUB in suspend mode through register
write. The BYPASS_UDC_SUSPEND bit (Bit 3) of the RuntimeFlags2 register at
address 0x411D controls this aspect of the hub. The BYPASS_UDC_SUSPEND
bit in register 0x411Dh must be set to ensure that the MCU is always
enabled and ready to respond to SMBus runtime commands. This register
needs to be written before the USB attach command is issued.
The byte sequence is as follows:
Slave addr: 0x2d           00 00 05 00 01 41 1D 08
Slave addr: 0x2d           99 37 00
Slave addr: 0x2d           AA 56 00

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agousb: onboard-hub: add support for Microchip USB5744
Venkatesh Yadav Abbarapu [Mon, 25 Nov 2024 04:12:00 +0000 (09:42 +0530)]
usb: onboard-hub: add support for Microchip USB5744

Add support for the Microchip USB5744 USB3.0 and USB2.0 Hub.
The usb5744 driver trigger hub reset signal after soft reset.
The usb5744 hub need to reset after the phy initialization,
which toggles the gpio.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agousb: onboard-hub: Fix the return values of regulator APIs
Venkatesh Yadav Abbarapu [Mon, 25 Nov 2024 04:11:59 +0000 (09:41 +0530)]
usb: onboard-hub: Fix the return values of regulator APIs

Don't error out if there is no vdd regulator supply, as these are
optional properties.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agousb: onboard-hub: Add reset-gpio support
Venkatesh Yadav Abbarapu [Mon, 25 Nov 2024 04:11:58 +0000 (09:41 +0530)]
usb: onboard-hub: Add reset-gpio support

As part of the reset, sets the direction of the pin to output before
toggling the pin. Delay of millisecond is added in between low and
high to meet the setup and hold time requirement of the reset.
Update the usb2514 hub_data with the reset delay and power on
delay values.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 weeks agoMerge patch series "Fix device removal order for Apple dart iommu"
Tom Rini [Sun, 24 Nov 2024 21:41:32 +0000 (15:41 -0600)]
Merge patch series "Fix device removal order for Apple dart iommu"

Janne Grunau <j@jannau.net> says:

Starting with v2024.10 dev_iommu_dma_unmap calls during device removal
trigger a NULL pointer dereference in the Apple dart iommu driver. The
iommu device is removed before its user. The sparsely used DM_FLAG_VITAL
flag is intended to describe this dependency. Add it to the driver.

Adding this flag is unfortunately not enough since the boot routines
except the arm one simply remove all drivers. Add and use a new function
which calls
    dm_remove_devioce_flags(DM_REMOVE_ACTIVE_ALL | DM_REMOVE_NON_VITAL);
    dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL);
to ensure this order dependency is head consistently.

Link: https://lore.kernel.org/r/20241123-iommu_apple_dart_ordering-v2-0-cc2ade6dde97@jannau.net
3 weeks agodm: Add dm_remove_devices_active() for ordered device removal
Janne Grunau [Sat, 23 Nov 2024 21:44:05 +0000 (22:44 +0100)]
dm: Add dm_remove_devices_active() for ordered device removal

This replaces dm_remove_devices_flags() calls in all boot
implementations to ensure non vital devices are consistently removed
first. All boot implementation except arch/arm/lib/bootm.c currently
just call dm_remove_devices_flags(DM_REMOVE_ACTIVE_ALL). This can result
in crashes when dependencies between devices exists. The driver model's
design document describes DM_FLAG_VITAL as "indicates that the device is
'vital' to the operation of other devices". Device removal at boot
should follow this.

Instead of adding dm_remove_devices_flags() with (DM_REMOVE_ACTIVE_ALL |
DM_REMOVE_NON_VITAL) everywhere add dm_remove_devices_active() which
does this.

Fixes a NULL pointer deref in the apple dart IOMMU driver during EFI
boot. The xhci-pci (driver which depends on the IOMMU to work) removes
its mapping on removal. This explodes when the IOMMU device was removed
first.

dm_remove_devices_flags() is kept since it is used for testing of
device_remove() calls in dm.

Signed-off-by: Janne Grunau <j@jannau.net>
3 weeks agoiommu: apple: Mark device with DM_FLAG_VITAL
Janne Grunau [Sat, 23 Nov 2024 21:44:04 +0000 (22:44 +0100)]
iommu: apple: Mark device with DM_FLAG_VITAL

Avoids NULL pointer dereferences in apple_dart_unmap when the iommu
device is removed before its user. U-boot's device model does not track
dependencies between devices.
Observed on a M1 Ultra Mac Studio with v2024.10.

Acked-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Janne Grunau <j@jannau.net>
4 weeks agoMerge tag 'efi-2025-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 24 Nov 2024 15:37:32 +0000 (09:37 -0600)]
Merge tag 'efi-2025-01-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

CI: https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/23529

- Documentation:
  - Document wget syntax enhancements with lwIP network stack
  - Move README.kconfig to HTML documentation
  - Remove redundant README.TPL
- UEFI:
  - Simplify efi_tcg2_hash_log_extend_event()
  - Allow EFI_LOADER_BOUNCE_BUFFER on all architectures
  - Correctly unmap and free memory on errors
- Other:
 - Enable EFI_LOADER_BOUNCE_BUFFER on StarFive VisionFive 2

4 weeks agolmb: Correctly unmap and free memory on errors
Ilias Apalodimas [Sun, 24 Nov 2024 09:00:03 +0000 (11:00 +0200)]
lmb: Correctly unmap and free memory on errors

We never free and unmap the memory on errors and we never unmap it when
freeing it. The latter won't cause any problems even on sandbox, but for
consistency always use unmap_sysmem()

Fixes: commit 22f2c9ed9f53 ("efi: memory: use the lmb API's for allocating and freeing memory")
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 weeks agoMerge tag 'u-boot-imx-master-20241123' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sun, 24 Nov 2024 03:14:15 +0000 (21:14 -0600)]
Merge tag 'u-boot-imx-master-20241123' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/23523

- Fix a imx8mn clock driver regression where the 32kHz clock can not be
  found in SPL.

4 weeks agoconfigs: JH7110: enable EFI_LOADER_BOUNCE_BUFFER
Heinrich Schuchardt [Thu, 21 Nov 2024 14:25:22 +0000 (15:25 +0100)]
configs: JH7110: enable EFI_LOADER_BOUNCE_BUFFER

Our MMC driver for JH7110 boards only supports reading to the low 4 GiB of
memory. Booting boards with more memory requires EFI_LOADER_BOUNCE_BUFFER.

Reported-by: E Shattow <lucent@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Loic Devulder <ldevulder@suse.com>
4 weeks agoefi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architectures
Heinrich Schuchardt [Thu, 21 Nov 2024 14:25:21 +0000 (15:25 +0100)]
efi_loader: allow EFI_LOADER_BOUNCE_BUFFER on all architectures

Commit 775f7657ba58 ("Kconfig: clean up the efi configuration status")
by mistake revoked commit dcd1b63b7072 ("efi_loader: allow
EFI_LOADER_BOUNCE_BUFFER on all architectures").

Fixes: 775f7657ba58 ("Kconfig: clean up the efi configuration status")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tested-by: Loic Devulder <ldevulder@suse.com>
4 weeks agodoc: cmd: wget: document lwIP syntax
Jerome Forissier [Mon, 18 Nov 2024 09:18:01 +0000 (10:18 +0100)]
doc: cmd: wget: document lwIP syntax

The lwIP version of wget supports a different syntax with a URL,
in addition to the legacy syntax. Document that.

While we're at it, fix a couple of minor issues in the legacy
syntax:
- hostIPaddr can be a DNS name if CONFIG_CMD_DNS is enabled
- path is mandatory

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 weeks agodoc: remove README.TPL
Heinrich Schuchardt [Mon, 11 Nov 2024 09:16:21 +0000 (10:16 +0100)]
doc: remove README.TPL

doc/develop/spl.rst describes SPL, TPL, VPL.
Remove the outdated README.TPL document.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 weeks agodoc: move README.kconfig to HTML documentation
Heinrich Schuchardt [Mon, 11 Nov 2024 09:05:39 +0000 (10:05 +0100)]
doc: move README.kconfig to HTML documentation

* format according to Sphinx style
* add link to Linux Kconfig documentation
* sort table alphabetically in 'Conversion from boards.cfg to Kconfig'

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 weeks agoefi_loader: simplify efi_tcg2_hash_log_extend_event()
Heinrich Schuchardt [Tue, 5 Nov 2024 04:20:45 +0000 (05:20 +0100)]
efi_loader: simplify efi_tcg2_hash_log_extend_event()

The value of variable nt is never used. Just use NULL when calling
efi_check_pe().

The API function is not expected to write to the console. Such output might
have unwanted side effects on the screen layout of an EFI application.

Leave error handling to the caller.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 weeks agoarm64: dts: imx8mn: Include 32kHz oscillator clock in SPL DTs
Marek Vasut [Fri, 22 Nov 2024 01:58:12 +0000 (02:58 +0100)]
arm64: dts: imx8mn: Include 32kHz oscillator clock in SPL DTs

Since 50cdd3f74af3 ("clk: imx: clk-imx8mn Fix nand and spi clock parent"),
drivers/clk/imx/clk-imx8mn.c clk_get_by_name(dev, "osc_24m", &osc_24m_clk)
fails with error -22 EINVAL in SPL. This is because clk_get_by_name() in the
end calls fdtdec_parse_phandle_with_args(), which iterates over all phandles
in clock-controller@30380000 { clocks = <&osc_32k>, <&osc_24m>, ... } node
'clocks' property in an attempt to find the "osc_24m" clock, but fails to
resolve the &osc_32k phandle and returns with -EINVAL.

Include the osc_32k clock in SPL DTs as a low risk fix for v2025.01 release.
This way, fdtdec_parse_phandle_with_args() can resolve both the osc_32k and
following osc_24m phandle and successfully look up the osc_24m clock.

Fixes: 50cdd3f74af3 ("clk: imx: clk-imx8mn Fix nand and spi clock parent")
Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Adam Ford <aford173@gmail.com> #imx8mn-beacon
4 weeks agoMerge branch '2024-11-22-assorted-fixes'
Tom Rini [Fri, 22 Nov 2024 20:43:17 +0000 (14:43 -0600)]
Merge branch '2024-11-22-assorted-fixes'

- Assorted additional lwIP fixes
- Assorted test fixes
- Assorted other localized fixes

4 weeks agocmd: improve description of the cdp command
Heinrich Schuchardt [Mon, 11 Nov 2024 09:50:35 +0000 (10:50 +0100)]
cmd: improve description of the cdp command

Users might not know what 'CDP' refers to. Provide basic information.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
4 weeks agotest: unit test for hextoull()
Heinrich Schuchardt [Wed, 13 Nov 2024 21:15:12 +0000 (22:15 +0100)]
test: unit test for hextoull()

Provide a unit test for the hextoull() function.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 weeks agonet: lwip: dhcp: support arguments for TFTP file download
Jerome Forissier [Thu, 14 Nov 2024 17:20:07 +0000 (18:20 +0100)]
net: lwip: dhcp: support arguments for TFTP file download

The dhcp command is supposed to have the following syntax as per
"help dhcp":

  dhcp [loadAddress] [[hostIPaddr:]bootfilename]

In other words, any arguments should be passed to an implicit
tftpboot command after the DHCP exchange has occurred.

Add the missing code to the lwIP version of do_dhcp().

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
4 weeks agonet: lwip: provide entropy to MBed TLS in one go
Ilias Apalodimas [Thu, 14 Nov 2024 14:29:15 +0000 (16:29 +0200)]
net: lwip: provide entropy to MBed TLS in one go

We currently provide entropy to mbedTLS using 8b chunks.
Take into account the 'len' parameter passed by MBed TLS to the entropy
gathering function instead. Note that the current code works because len
is always 128 (defined at compile time), therefore mbedtls_hardware_poll()
is called repeatedly and the buffer is filled correctly. But passing 'len'
to dm_rng_read() is both better and simpler.

Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 weeks agonet: lwip: wget: update help string
Jerome Forissier [Thu, 14 Nov 2024 14:20:40 +0000 (15:20 +0100)]
net: lwip: wget: update help string

The lwIP version of wget also supports the legacy syntax. Document it in
the help string.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 weeks agonet: lwip: fix get_udev_ipv4_info()
Jerome Forissier [Mon, 18 Nov 2024 14:31:25 +0000 (15:31 +0100)]
net: lwip: fix get_udev_ipv4_info()

The local variables ipstr, maskstr and gwstr in static function
get_udev_ipv4_info() cannot be pointers to read-only data, since
they may be written to in case the device index is > 0. Therefore
make them char arrays allocated on the stack.

Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reported-by: Adriano Cordova <adrianox@gmail.com>
Link: https://lists.denx.de/pipermail/u-boot/2024-November/572066.html
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 weeks agoarm64: dts: ti: k3-j7200: Fix OSPI boot
Udit Kumar [Tue, 19 Nov 2024 10:07:20 +0000 (15:37 +0530)]
arm64: dts: ti: k3-j7200: Fix OSPI boot

OSPI boot is broken due to missing bootph property
in pin mux of OSPI.
So add bootph to fix OSPI boot.

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
4 weeks agoboard: armltd: Make myself maintainer for total compute
Ben Horgan [Tue, 19 Nov 2024 17:25:58 +0000 (17:25 +0000)]
board: armltd: Make myself maintainer for total compute

The previous maintainer is no longer involved in total compute.

Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Leo Yan <leo.yan@arm.com>
4 weeks agoRevert "test: Update time tests to use unit-test asserts"
Tom Rini [Tue, 19 Nov 2024 14:05:26 +0000 (08:05 -0600)]
Revert "test: Update time tests to use unit-test asserts"

While at the base level, this conversion looks equivalent, we now see
both of these tests failing (due to exceeding their allowed margin for
being too slow) in Azure with a very high frequency.

This reverts commit 88db4fc5fec20429881896740df61d402b4b1f66.

Signed-off-by: Tom Rini <trini@konsulko.com>
Tested-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
4 weeks agonet: lwip: fix dhcp_loop()
Jerome Forissier [Fri, 22 Nov 2024 12:35:29 +0000 (13:35 +0100)]
net: lwip: fix dhcp_loop()

The local variables ipstr, maskstr and gwstr in static function
dhcp_loop() cannot be pointers to read-only data, since they may be
written to in case the device index is > 0. Therefore make them char
arrays allocated on the stack.

Reported-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 weeks agotest: boot: Set DM|SCAN_FDT flags for bootmeth_{cros,android}
Mattijs Korpershoek [Fri, 22 Nov 2024 14:11:34 +0000 (15:11 +0100)]
test: boot: Set DM|SCAN_FDT flags for bootmeth_{cros,android}

We make fewer calls to dm_test_restore() since
commit fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()")

Because of this some valid test combinations are now broken:

$ ./test/py/test.py --bd sandbox --build -k test_ut
$ ./test/py/test.py --bd sandbox --build -k "bootflow_android or bootflow_cros"

Shows:

  Expected '  2  cros         ready   mmc          4 mmc5.bootdev.part_4       ',
  got '  2  cros         ready   mmc          2 mmc5.bootdev.part_2       '

Here prep_mmc_bootdev() is called twice and it will bind bootmeth_cros twice.

Since bootmeth_cros is bound twice, 'bootflow scan' will find 2x the
expected bootflows.

Before
commit fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()")
this did not happen because a cleanup was called each time.

Add UTF_DM and UTF_SCAN_FDT flags to both tests to make sure that the
bootmeths are unbound after the test finishes.

Fixes: fbdac8155c89 ("test: Expand implementation of ut_list_has_dm_tests()")
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 weeks agoMerge branch 'qcom-main' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon
Tom Rini [Wed, 20 Nov 2024 17:55:24 +0000 (11:55 -0600)]
Merge branch 'qcom-main' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/23474

- UFS support is enabled for SC7280 and SM8150 platforms.
- Qualcomm dt-bindings headers are all dropped in favour of
  dts/upstream.
- The SMMU driver now correctly handles stream ID 0 and is disabled in
  EL2.
- Initial support for capsule updates (using the new dynamic UUIDs) is
  added for the RB3 Gen 2 board alongside a new SCSI backend for DFU.
- CONFIG_PINCONF is enabled in qcom_defconfig.
- The vqmmc supply is now enabled for sdcard support on boards that need
  it.
- A quirk is added for reading GPIOs on the PM8550 PMIC

4 weeks agotreewide: remove Qualcomm dt-binding headers that are available upstream
Caleb Connolly [Wed, 13 Nov 2024 04:33:32 +0000 (05:33 +0100)]
treewide: remove Qualcomm dt-binding headers that are available upstream

Some dt-binding headers mask the upstream ones which can lead to build
failures, or worse: super weird bugs, if they get out of sync.

Remove these headers so our devicetree and binding headers will both be
in sync with upstream.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoiommu: qcom-smmu: handle running in el2
Caleb Connolly [Wed, 13 Nov 2024 05:09:24 +0000 (06:09 +0100)]
iommu: qcom-smmu: handle running in el2

We only need to configure the SMMU when running in EL1. In EL2 the
hypervisor isn't running so peripherals can just do DMA as they wish.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoiommu: qcom-smmu: allow SID 0
Caleb Connolly [Wed, 13 Nov 2024 05:00:56 +0000 (06:00 +0100)]
iommu: qcom-smmu: allow SID 0

It turns out this is a very real stream ID. Who woulda thought?

Drop the 0 check on the SID, there's no reason for it to be there in the first
place.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoqcom_defconfig: enable capsule update support
Caleb Connolly [Sat, 12 Oct 2024 13:57:20 +0000 (15:57 +0200)]
qcom_defconfig: enable capsule update support

Enable all the necessary options for capsule updates to work, as well as
a few additional EFI features.

Capsule updates themselves are only enabled for the RB3 Gen 2, since the
exact details on where to flash U-Boot (or how to handle multiple boot
methods) has not been finalised for other boards.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agomach-snapdragon: implement capsule update support
Caleb Connolly [Sat, 12 Oct 2024 13:57:19 +0000 (15:57 +0200)]
mach-snapdragon: implement capsule update support

Qualcomm boards flash U-Boot a variety of partitions, implement support
for determining which slot U-Boot is running from, finding the correct
partition for that slot and configuring the appropriate DFU string.

Initially, we only support the RB3 Gen 2 where U-Boot is flashed to the
UEFI partition, and ignore handling of slots. In the future we will
additionally support booting U-Boot from other partitions (e.g. boot)
and correct handling for A/B.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agodisk: expose partition type flags
Caleb Connolly [Sat, 12 Oct 2024 13:57:18 +0000 (15:57 +0200)]
disk: expose partition type flags

GPT partition tables include two bytes worth of vendor defined
attributes, per partition. ChromeOS and Qualcomm both use these (with
different encoding!) to handle A/B slot switching with a retry counter.

Expose these via the disk_partition struct so that they can be parsed by
the relevant board code.

This will be used on Qualcomm boards to determine which slot we're
booting on so that we can flash capsule updates to the correct one.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agodfu: add scsi backend
Caleb Connolly [Sat, 12 Oct 2024 13:57:17 +0000 (15:57 +0200)]
dfu: add scsi backend

This is extremely similar to the MMC backend, but there are some notable
differences.

Works with a DFU string like

    scsi 4=u-boot-bin part 11

Where "4" is the SCSI dev number (sequential LUN across all SCSI devices)
and "11" is the partition number.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agophy: qcom: Add SM8150 to QMP UFS PHY driver
Julius Lehmann [Wed, 2 Oct 2024 18:52:17 +0000 (20:52 +0200)]
phy: qcom: Add SM8150 to QMP UFS PHY driver

Copy PHY tables over from Linux to support SM8150

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
4 weeks agophy: qcom: ufs: add sc7280
Caleb Connolly [Sat, 12 Oct 2024 13:22:05 +0000 (15:22 +0200)]
phy: qcom: ufs: add sc7280

Add configuration for the SC7280, copied from Linux 6.11

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoqcom_defconfig: enable UFS Qualcomm controller and PHY drivers
Neil Armstrong [Mon, 14 Oct 2024 07:00:26 +0000 (09:00 +0200)]
qcom_defconfig: enable UFS Qualcomm controller and PHY drivers

Now the Qualcomm controller and PHY drivers were accepted,
enable then in the qcom_defconfig file.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agodt-bindings: remove phy/phy-qcom-qmp.h in favor of dts/upstream
Neil Armstrong [Wed, 16 Oct 2024 07:37:20 +0000 (09:37 +0200)]
dt-bindings: remove phy/phy-qcom-qmp.h in favor of dts/upstream

The upstream version has new defines use to build DT, drop
it in favor of the dts/upstream more recent one.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agophy: qcom: ufs: drop unused ufsphy_v2_regs_layout
Neil Armstrong [Wed, 16 Oct 2024 07:43:56 +0000 (09:43 +0200)]
phy: qcom: ufs: drop unused ufsphy_v2_regs_layout

The ufsphy_v2_regs_layout is not used, drop it and fix:
phy-qcom-qmp-ufs.c:87:27: warning: ‘ufsphy_v2_regs_layout’ defined but not used [-Wunused-const-variable=]

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agogpio: qcom_pmic: add again the quirk to skip GPIO configuration on PM8550
Neil Armstrong [Wed, 16 Oct 2024 09:16:18 +0000 (11:16 +0200)]
gpio: qcom_pmic: add again the quirk to skip GPIO configuration on PM8550

The qcom_pmic code is broken for new PMICs and should be fixed,
without the QUIRK the code is broken and the GPIOs don't work
anymore on SM8550 and SM8650 platforms.

Partially revert the revert and only add the quirk on the PM8550
PMIC, making the buttons and MMC detect gpio work again.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agommc: msm_sdhci: enable vqmmc at probe if available
Neil Armstrong [Wed, 16 Oct 2024 09:17:16 +0000 (11:17 +0200)]
mmc: msm_sdhci: enable vqmmc at probe if available

On earlier platforms, the vqmmc regulator was enabled by the
previous bootloader, but on the newest (SM8650) it's not
and we need vqmmc to be enabled in order to have the card
to respond.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agomach-snapdragon: configure logging
Caleb Connolly [Wed, 13 Nov 2024 05:04:17 +0000 (06:04 +0100)]
mach-snapdragon: configure logging

Set LOG_CATEGORY and pr_fmt. Also fix the time.h include.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoARM: mach-snapdragon: configure a larger default SYS_MALLOC_LEN for fastboot
Neil Armstrong [Wed, 16 Oct 2024 09:25:32 +0000 (11:25 +0200)]
ARM: mach-snapdragon: configure a larger default SYS_MALLOC_LEN for fastboot

Fastboot is very hungry when it flashes larges chunks, and 8MiB
is way too small, allocate a much bigger size like other platforms
using Fastboot.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # rb1
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoqcom_defconfig: enable PINCONF
Neil Armstrong [Thu, 17 Oct 2024 08:04:54 +0000 (10:04 +0200)]
qcom_defconfig: enable PINCONF

The SM8550 and SM8650 SoCs requires PINCONF to properly
setup SDC pins in order to function correctly.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
4 weeks agoMerge tag 'xilinx-for-v2025.01-rc3-v2' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 19 Nov 2024 18:58:05 +0000 (12:58 -0600)]
Merge tag 'xilinx-for-v2025.01-rc3-v2' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx changes for v2025.01-rc3:

- microblaze:
  - Disable JFFS2
- fpga:
  - pass compatible flag to fpga_load()
- zynqmp:
  - SOM RTC fix
  - SC(system controller) PMW polarity fix
  - Fix ram_top calculation with introducing XILINX_MINI
  - Fix RPU release command
- versal:
  - Enable capsule update
  - Enable soft reset and Micron octal flashes
- xilinx:
  - Align Kconfig regarding SPI_STACKED_PARALLEL
- bootcount:
  - Add new zynqmp driver

4 weeks agoxilinx: Introduce XILINX_MINI configuration
Michal Simek [Fri, 15 Nov 2024 14:31:02 +0000 (15:31 +0100)]
xilinx: Introduce XILINX_MINI configuration

There is no common symbol which mini configurations are using and recent
get_mem_top() changes adding 1.3kB without having a way to remove it.
That's why introduce new symbol which can be used for removing features
which are not requested by these configurations.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/aa27b72e17057fa8cbdd92a2bbb863a31c8c1226.1731681053.git.michal.simek@amd.com
4 weeks agomicroblaze: Disable JFFS2 support
Michal Simek [Fri, 15 Nov 2024 08:38:55 +0000 (09:38 +0100)]
microblaze: Disable JFFS2 support

JFFS2 is not maintained for quite a long time and none should be using it.
Please use other filesystems for flashes like UBIFS instead.

Also remove jffs to MTD map but MTD map is for example that's why it won't
affect anything.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a8239acee8886229fdbff66142c46d522e3fe851.1731659933.git.michal.simek@amd.com
4 weeks agoarm64: zynqmp: Set default RTC device at start
Michal Simek [Tue, 12 Nov 2024 13:58:48 +0000 (14:58 +0100)]
arm64: zynqmp: Set default RTC device at start

For RTC to start to operate there is a need to call the driver. The simple
way to do it is to set default RTC instance which will call the probe and
do basic initialization.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/01155f1555dbd42adc618906629f5fb45754d5a4.1731419926.git.michal.simek@amd.com
4 weeks agoarm64: versal: Enable soft reset support for xspi flashes
Venkatesh Yadav Abbarapu [Thu, 14 Nov 2024 04:26:41 +0000 (09:56 +0530)]
arm64: versal: Enable soft reset support for xspi flashes

Activate the xSPI Software Reset support, which will be
utilized to transition from octal DTR mode to legacy
mode during shutdown and boot (if enabled).

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241114042641.22642-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 weeks agoarm64: versal: Enable defconfig for Micron octal flashes
Venkatesh Yadav Abbarapu [Thu, 14 Nov 2024 05:10:47 +0000 (10:40 +0530)]
arm64: versal: Enable defconfig for Micron octal flashes

The Micron MT35 series octal flashes can be activated
through the configuration option CONFIG_SPI_FLASH_MT35XU.
To ensure their detection, enable this option in the
default defconfig for octal flashes.

Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241114051047.13700-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 weeks agospi: cadence_qspi: Fix OSPI boot issue
Venkatesh Yadav Abbarapu [Thu, 14 Nov 2024 06:20:45 +0000 (11:50 +0530)]
spi: cadence_qspi: Fix OSPI boot issue

Moving the hw_reset function from the controller driver to
the NOR framework has caused the OSPI reset not to be triggered
in the Cadence driver's probe function. As a result, reading the
flash ID during SPI calibration is incorrect, and the
CQSPI_REG_RD_DATA_CAPTURE is set with an invalid value.This makes
it unable to read the flash ID properly.
To solve this problem, it's suggested to skip SPI calibration and
instead retrieve the read_delay directly from the device tree.

Skipping SPI calibration doesn't bring harm since there's no need
for the flash golden values stored during SPI calibration.
Instead, they are now read during the spi_nor_read_id call in the
NOR framework.

Signed-off-by: Tejas Bhumkar <tejas.arvind.bhumkar@amd.com>
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241114062045.17581-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 weeks agofastboot: properly handle unknown partition type
Caleb Connolly [Wed, 13 Nov 2024 05:05:59 +0000 (06:05 +0100)]
fastboot: properly handle unknown partition type

In getvar_partition_type() we attempt to find a filesystem driver for
the partition (of the list of driver enabled in U-Boot), on failure we
return the error to fastboot and completely bail out of the operation.

However, this should not be a failure, instead we should just default to
"raw". This allows commands like "fastboot format:ext4 userdata" to work
if userdata didn't already have an ext4 partition table (or if FS_EXT4
is disabled in U-Boot), as failing to determine the current partition
type is not an error in this case.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241113050607.1850472-1-caleb.connolly@linaro.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
4 weeks agotest: cmd/hash: check return value of ut_check_console_line
Heinrich Schuchardt [Sat, 16 Nov 2024 20:08:22 +0000 (21:08 +0100)]
test: cmd/hash: check return value of ut_check_console_line

ut_check_console_line() does include an assert.
Pass the result to ut_assertok().

Addresses-Coverity-ID:  514958 Error handling issues
Fixes: 7dfafcd65ef3 ("test: unit test for hash command")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>