]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
2 months agousb: xhci: Define 'XHCI_MAX_HALT_USEC' macro only once
Bhupesh Sharma [Wed, 23 Aug 2023 15:41:23 +0000 (21:11 +0530)]
usb: xhci: Define 'XHCI_MAX_HALT_USEC' macro only once

Right now xhci header file defines XHCI_MAX_HALT_USEC macro
twice. Fix the same.

Cc: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Reviewed-by: Marek Vasut <marex@denx.de>
2 months agousb: xhci: pet watchdog during transfers
Godfrey Mwangi [Fri, 4 Aug 2023 19:00:39 +0000 (12:00 -0700)]
usb: xhci: pet watchdog during transfers

On some platforms with low USB throughput, tranfers
of huge files take a long time and watchdog timer can
expire resulting in hardware reset. Avoid this by
petting the watchdog as long as we have pending transfers.

Signed-off-by: Godfrey Mwangi <godmwan@microsoft.com>
Reviewed-by: Marek Vasut <marex@denx.de>
2 months agoMerge tag 'u-boot-ufs-next-20241014' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 14 Oct 2024 14:15:15 +0000 (08:15 -0600)]
Merge tag 'u-boot-ufs-next-20241014' of https://source.denx.de/u-boot/custodians/u-boot-ufs

- Set of fixes/updated on UFS core
 - Fix dcache/flush
 - Update & Sync Quirks
 - Backport fixes from Linux
 - Add missing memory barriers
 - Remove link_startup_again logic
 - Add Neil to UFS maintainers
- Add UFS DesignWare Controller for AMD vers2 platforms
- Add UFS Qualcomm controller driver

2 months agoMerge tag 'u-boot-amlogic-next-20241014' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 14 Oct 2024 14:14:46 +0000 (08:14 -0600)]
Merge tag 'u-boot-amlogic-next-20241014' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Add Libre Computer boards into proper libre-computer board directory
- Add new Boards:
 - Libre Computer aml-s905d3-cc
 - Libre Computer aml-a311d-cc
- Add capsule update to libretech-ac and the new boards since they have an onboard SPI nor flash
- Fix HDMI support after sync to v6.11 and regulator enable from Marek
- Fix khadas-vim3 android config for android-mainline kernel
- Disable meson64 boot targets when configs are not eavailable

2 months agoMerge branch 'u-boot-nand-20241012' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Mon, 14 Oct 2024 14:13:23 +0000 (08:13 -0600)]
Merge branch 'u-boot-nand-20241012' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

This merge request add support for BCMBCA raw nand driver for bcm96846
board that switch using OF_UPSTREAM and allow use onfi ecc params when
they are available in the atmel nand controller

The patches pass the pipeline CI:
https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/22638

2 months agoconfigs: meson64: Ensure commands for boot targets are available
Callum Parsey [Sat, 12 Oct 2024 08:03:51 +0000 (08:03 +0000)]
configs: meson64: Ensure commands for boot targets are available

When populating BOOT_TARGET_DEVICES on Amlogic Meson platforms, verify
that the shell commands for accessing the relevant media have been
enabled in the build configuration.

This was already being done for USB, NVME and SCSI devices, but not
for MMC devices or network boot. This meant that configuring U-Boot
without the networking or MMC subsystems/drivers would cause an error
to be thrown during preprocessing.

Signed-off-by: Callum Parsey <callum@neoninteger.au>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241012080340.2596-1-callum@neoninteger.au
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoconfigs: meson64_android: Remove dtbo support
Mattijs Korpershoek [Fri, 11 Oct 2024 15:51:03 +0000 (17:51 +0200)]
configs: meson64_android: Remove dtbo support

The device tree overlays are not part of the
Android Common Kernel code [1]

Historically, they existed to enable some Android specific
features but they have been removed.

Remove the dtbos logic since these files do no longer exist.

[1] https://android.googlesource.com/kernel/common/+/ac2ea0bb91a3b5f5e71eba66c441e58beca6767e/arch/arm64/boot/dts/amlogic/

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241011-yukawa-aosp-parts-v1-2-7d74aa13ff8e@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoconfigs: khadas-vim3{l}: Increase boot/recovery partition size
Mattijs Korpershoek [Fri, 11 Oct 2024 15:51:02 +0000 (17:51 +0200)]
configs: khadas-vim3{l}: Increase boot/recovery partition size

The Android Common Kernel is over 34MiB now [1]. This does not
include any kernel modules nor the Android ramdisk.

To make sure we are future proof, increase both recovery
and boot partitions to 64 MiB.

[1] https://source.android.com/docs/core/architecture/kernel/gki-android15-6_6-release-builds

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241011-yukawa-aosp-parts-v1-1-7d74aa13ff8e@baylibre.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agopower/domain: meson-ee-pwrc: make sure to not enable a domain twice
Neil Armstrong [Wed, 9 Oct 2024 09:15:21 +0000 (11:15 +0200)]
power/domain: meson-ee-pwrc: make sure to not enable a domain twice

The upstream Device Tree for GXBB/GXL/G12A was updated with VPU domain
shared between the VPU and HDMI node, causing a double enable.

Simply store the enable state and avoid enabling twice, fixing
HDMI output on all platforms.

Link: https://lore.kernel.org/r/20241009-u-boot-topic-fix-hdmi-v1-2-2479cd90c4ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoclk: meson: gxbb: add HDMI clocks
Neil Armstrong [Wed, 9 Oct 2024 09:15:20 +0000 (11:15 +0200)]
clk: meson: gxbb: add HDMI clocks

Align with g12a driver to handle the CLKID_HDMI, CLKID_HDMI_SEL
and CLKID_HDMI_DIV clocks since they were added to the upstream
GXBB/GXL Devicetree on v6.11 with [1]

[1] https://lore.kernel.org/all/20240626152733.1350376-1-jbrunet@baylibre.com/

Link: https://lore.kernel.org/r/20241009-u-boot-topic-fix-hdmi-v1-1-2479cd90c4ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agovideo: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled
Neil Armstrong [Wed, 9 Oct 2024 08:01:56 +0000 (10:01 +0200)]
video: meson: dw-hdmi: do not fail probe if HDMI regulator is already enabled

If the regulator is already enabled, this happens if the regulator
is set in regulator-always-on, regulator_set_enable() return -EALREADY.

Ignore the -EALREADY return since it's not an error.

Suggested-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20241009-u-boot-video-fix-hdmi-supply-already-on-v2-1-4478a28d1f49@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agodts: meson-g12-common-u-boot: do not disable canvas
Neil Armstrong [Tue, 8 Oct 2024 16:23:42 +0000 (18:23 +0200)]
dts: meson-g12-common-u-boot: do not disable canvas

We were disabling canvas, which causes meson vpu probe failure,
just stop and leave canvas alone.

Fixes: ce9fa7bffc5 ("ARM: dts: meson-g12a: add U-Boot specific DT for graphics")
Link: https://lore.kernel.org/r/20241008-u-boot-topic-g12-do-not-disable-canvas-v1-1-b89659370012@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoARM: meson: add support for Libre Computer aml-s905d3-cc
Neil Armstrong [Fri, 20 Sep 2024 13:33:34 +0000 (15:33 +0200)]
ARM: meson: add support for Libre Computer aml-s905d3-cc

Add support for the Libre Computer aml-s905d3-cc "Solitude" board:
https://libre.computer/products/aml-s905d3-cc/

The Solitude board has a Credit Card form factor, similar to the
the previous "Le Potato" card, but with the Amlogic A311D SoC,
MIPI DSI and CSI connectors. PoE header and a single USB2 Type-C
connector replacing the microUSB one for power and USB 2.0.

The board has an embedded SPI NOR flash, and EFI Capsule support
is added.

The GUID is dynamically generated for the board, to get it:
=> efidebug capsule esrt
========================================
ESRT: fw_resource_count=1
ESRT: fw_resource_count_max=1
ESRT: fw_resource_version=1
[entry 0]==============================
ESRT: fw_class=4302C3CB-2502-5EFE-87E0-894A8A322893
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
========================================

On the host (with the aml_encrypt_g12a result binary):
$ eficapsule --guid 4302C3CB-2502-5EFE-87E0-894A8A322893 -i 1 u-boot.bin u-boot.cap

On the board (from USB disk containing u-boot.cap at root):
=> load usb 0:1 $kernel_addr_r u-boot.cap
=> efidebug capsule update $kernel_addr_r

The binary will then be flashed on the SPI.

Link: https://lore.kernel.org/r/20240920-u-boot-topic-libre-computer-solitude-alta-v1-2-8915b108840b@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoARM: meson: add support for Libre Computer aml-a311d-cc
Neil Armstrong [Fri, 20 Sep 2024 13:33:33 +0000 (15:33 +0200)]
ARM: meson: add support for Libre Computer aml-a311d-cc

Add support for the Libre Computer aml-a311d-cc "Alta" board:
https://libre.computer/products/aml-a311d-cc/

The Alta board has a Credit Card form factor, similar to the
the prvevious "Le Potato" card, but with the Amlogic A311D SoC,
MIPI DSI and CSI connectors. PoE header and a single USB2 Type-C
connector replacing the microUSB one for power and USB 2.0.

The board has an embedded SPI NOR flash, and EFI Capsule support
is added.

The GUID is dynamically generated for the board, to get it:
=> efidebug capsule esrt
========================================
ESRT: fw_resource_count=1
ESRT: fw_resource_count_max=1
ESRT: fw_resource_version=1
[entry 0]==============================
ESRT: fw_class=17E07D9D-4D91-53F4-8780-1D91F279C1A5
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
========================================

On the host (with the aml_encrypt_g12a result binary):
$ eficapsule --guid 17E07D9D-4D91-53F4-8780-1D91F279C1A5 -i 1 u-boot.bin u-boot.cap

On the board (from USB disk containing u-boot.cap at root):
=> load usb 0:1 $kernel_addr_r u-boot.cap
=> efidebug capsule update $kernel_addr_r

The binary will then be flashed on the SPI.

Link: https://lore.kernel.org/r/20240920-u-boot-topic-libre-computer-solitude-alta-v1-1-8915b108840b@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoboard: libre-computer: aml-s805x-cc: Enable capsule updates
Neil Armstrong [Tue, 17 Sep 2024 12:34:46 +0000 (14:34 +0200)]
board: libre-computer: aml-s805x-cc: Enable capsule updates

Since the aml-s805-cc works well using EFI, and now the capsule updates
backend has been merged, let's enable the missing configs and add
the required structures to support it.

The GUID is dynamically generated for the board, to get it:
=> efidebug capsule esrt
========================================
ESRT: fw_resource_count=1
ESRT: fw_resource_count_max=1
ESRT: fw_resource_version=1
[entry 0]==============================
ESRT: fw_class=B8079027-9B2C-57D4-86AA-CC782ADA598C
ESRT: fw_type=unknown
ESRT: fw_version=0
ESRT: lowest_supported_fw_version=0
ESRT: capsule_flags=0
ESRT: last_attempt_version=0
ESRT: last_attempt_status=success
========================================

On the host (with the aml_encrypt_gxl result binary):
$ eficapsule --guid B8079027-9B2C-57D4-86AA-CC782ADA598C -i 1 u-boot.bin u-boot.cap

On the board (from USB disk containing u-boot.cap at root):
=> load usb 0:1 $kernel_addr_r u-boot.cap
=> efidebug capsule update $kernel_addr_r

The binary will then be flashed on the SPI.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Link: https://lore.kernel.org/r/20240917-u-boot-topic-dynamic-uuid-v2-2-416e39c6e271@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoboard: libretech-ac: move board support into dedicated directory
Neil Armstrong [Tue, 17 Sep 2024 12:34:45 +0000 (14:34 +0200)]
board: libretech-ac: move board support into dedicated directory

The libretech-ac aka aml-s805x-ac supports mainline U-boot
from a dedicated SPI flash, move the board support into
a dedicated vendor/board subdirectory in order to support
vendor specific customization.

It also aligns with the vendor downstream changes.

Link: https://lore.kernel.org/r/20240917-u-boot-topic-dynamic-uuid-v2-1-416e39c6e271@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Add Support for Qualcomm UFS HC driver
Bhupesh Sharma [Tue, 10 Sep 2024 09:50:13 +0000 (11:50 +0200)]
ufs: Add Support for Qualcomm UFS HC driver

Add Support for the Host Controller driver for UFS HC
present on Qualcomm Snapdragon SoCs.

It has been successfully tested on SDM845, SM8250,
SM8550 ant SM8650 SoCs.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> #rb3gen2
Link: https://lore.kernel.org/r/20240910-topic-ufs-qcom-controller-v1-4-54c0d2231b10@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: allow UFSHCI version 4.0
Neil Armstrong [Tue, 10 Sep 2024 09:50:12 +0000 (11:50 +0200)]
ufs: allow UFSHCI version 4.0

Add UFSHCI version 4.0 found on the recent Qualcomm UFS Controllers.

Tested-by: Julius Lehmann <lehmanju@devpi.de>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> #rb3gen2
Link: https://lore.kernel.org/r/20240910-topic-ufs-qcom-controller-v1-3-54c0d2231b10@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: add get_max_pwr_mode callback
Neil Armstrong [Tue, 10 Sep 2024 09:50:11 +0000 (11:50 +0200)]
ufs: add get_max_pwr_mode callback

Add a new get_max_pwr_mode callback to permit the UFS controller
driver manipulate the max_pwr_mode struct right before setting
the new pwr_mode to the UFS device.

It can be used to limit the HS Gear with errata and hardware
limitations on some UFS controllers.

Tested-by: Julius Lehmann <lehmanju@devpi.de>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> #rb3gen2
Link: https://lore.kernel.org/r/20240910-topic-ufs-qcom-controller-v1-2-54c0d2231b10@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: add device_reset callback
Neil Armstrong [Tue, 10 Sep 2024 09:50:10 +0000 (11:50 +0200)]
ufs: add device_reset callback

Add device_reset op to permit resetting the UFS device if
the UFS controller drivers supports the operation.

Tested-by: Julius Lehmann <lehmanju@devpi.de>
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> #rb3gen2
Link: https://lore.kernel.org/r/20240910-topic-ufs-qcom-controller-v1-1-54c0d2231b10@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoconfigs: versal2: Add support for AMD UFS platform driver
Venkatesh Yadav Abbarapu [Fri, 20 Sep 2024 04:16:51 +0000 (09:46 +0530)]
configs: versal2: Add support for AMD UFS platform driver

Enable AMD UFS platform driver.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240920041651.18173-4-venkatesh.abbarapu@amd.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: ufs-amd-versal2: Add support for AMD UFS controller
Venkatesh Yadav Abbarapu [Fri, 20 Sep 2024 04:16:50 +0000 (09:46 +0530)]
ufs: ufs-amd-versal2: Add support for AMD UFS controller

Add UFS AMD platform support on top of the UFS DWC
and UFS platform driver. UFS AMD platform requires
some platform specific configurations like M-PHY/RMMI/UniPro
and vendor specific registers programming before doing the LINKSTARTUP.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240920041651.18173-3-venkatesh.abbarapu@amd.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: add support for DesignWare Controller
Venkatesh Yadav Abbarapu [Fri, 20 Sep 2024 04:16:49 +0000 (09:46 +0530)]
ufs: add support for DesignWare Controller

This patch has the goal to add support for DesignWare UFS Controller
specific operations.

This is based on linux kernel commit:
"drivers/scsi/ufs/ufshcd-dwc.c: ufs: add support for DesignWare
Controller" (sha1: 4b9ffb5a353bdee49f1f477ffe2b95ab3f9cbc0c)
It is ported from linux kernel 6.11-rc1.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240920041651.18173-2-venkatesh.abbarapu@amd.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoMAINTAINERS: Add myself to the list of UFS maintainers
Neil Armstrong [Mon, 30 Sep 2024 12:44:35 +0000 (14:44 +0200)]
MAINTAINERS: Add myself to the list of UFS maintainers

Adding myself to continue Bhupesh's work to enhance and fix UFS
support in U-Boot, especially for Qualcomm SoCs, and help review
patches and maintain the UFS subsystem.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-13-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: remove link_startup_again logic
Neil Armstrong [Mon, 30 Sep 2024 12:44:34 +0000 (14:44 +0200)]
ufs: core: remove link_startup_again logic

The link_startup_again logic was added in Linux to handle device
that were set in LinkDown state, which should not be the case since U-boot
doesn't set LinkDown state are init, and Linux sets the device active
in ufshcd_init() for the first link startup.

ufshcd_set_ufs_dev_active(hba) is called at ufshcd_init() right before
scheduling an ufshcd_async_scan that will call ufshcd_device_init() then ufshcd_link_startup().

The comment in probe says:
    /*
     * We are assuming that device wasn't put in sleep/power-down
     * state exclusively during the boot stage before kernel.
     * This assumption helps avoid doing link startup twice during
     * ufshcd_probe_hba().
     */
we can assume the same from U-Boot.

While it worked to far, it breaks link startup for Qualcomm Controllers v5,
let's just remove the logic.

Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-12-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Fix debug message in 'ufs_start'
Bhupesh Sharma [Mon, 30 Sep 2024 12:44:33 +0000 (14:44 +0200)]
ufs: Fix debug message in 'ufs_start'

Minor typo fix and rewording of printf message
inside 'ufs_start' which announces the availability
of the UFS device.

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-11-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Add missing memory barriers
Bhupesh Sharma [Mon, 30 Sep 2024 12:44:32 +0000 (14:44 +0200)]
ufs: Add missing memory barriers

Add missing wmb() and mb() barriers in the u-boot UFS core
framework driver to allow registers updates to happen before
follow-up read operations.

This makes the barrier placement similar to the Linux UFS driver,
synced from the Linux v6.9 release.

Starting from the v6.10 release, the barriers were replaced with a register
read-back in [1], this will ported to u-boot in a second time.

[1] https://lore.kernel.org/all/20240329-ufs-reset-ensure-effect-before-delay-v5-0-181252004586@redhat.com/

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-10-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Sync possible UFS Quirks with Linux UFS driver
Bhupesh Sharma [Mon, 30 Sep 2024 12:44:31 +0000 (14:44 +0200)]
ufs: Sync possible UFS Quirks with Linux UFS driver

Sync u-boot UFS driver to add all possible UFS Quirks
as supported by Linux UFS driver as well.

Synced with include/ufs/ufshcd.h from Linux v6.11 release

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-9-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP
Bhupesh Sharma [Mon, 30 Sep 2024 12:44:30 +0000 (14:44 +0200)]
ufs: Clear UECPA once due to LINERESET has happened during LINK_STARTUP

Clear UECPA once in u-boot UFS driver due to LINERESET has happened
during LINK_STARTUP. This makes the u-boot ufs driver behavior related
to UECPA similar to Linux UFS driver.

Ported from Linux kernel commit:
2355b66ed20c ("scsi: ufs: Handle LINERESET indication in err handler")

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-8-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs/ufs.h: Add definition of 'ufshcd_rmwl()'
Bhupesh Sharma [Mon, 30 Sep 2024 12:44:29 +0000 (14:44 +0200)]
ufs/ufs.h: Add definition of 'ufshcd_rmwl()'

Add definition of 'ufshcd_rmwl()' helper function
which would be later used by Qualcomm UFS driver
to read-modify-write registers.

Ported from Linux kernel commits:
e785060ea3a1 ("ufs: definitions for phy interface")
cff91daf52d3 ("scsi: ufs: Fix kernel-doc syntax in ufshcd.h")

Signed-off-by: Bhupesh Sharma <bhupesh.sharma@linaro.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-7-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO
Marek Vasut [Mon, 30 Sep 2024 12:44:28 +0000 (14:44 +0200)]
ufs: Add UFSHCD_QUIRK_HIBERN_FASTAUTO

Add UFSHCD_QUIRK_HIBERN_FASTAUTO quirk for host controllers which supports
auto-hibernate the capability but only FASTAUTO mode.

Ported from Linux kernel commit
2f11bbc2c7f3 ("scsi: ufs: core: Add UFSHCD_QUIRK_HIBERN_FASTAUTO")

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-6-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS
Marek Vasut [Mon, 30 Sep 2024 12:44:27 +0000 (14:44 +0200)]
ufs: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS

Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS for host controllers which do not
support 64-bit addressing.

Ported from Linux kernel commit
6554400d6f66 ("scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_64BIT_ADDRESS")
with ufs_scsi_buffer_aligned() based on U-Boot generic bounce buffer.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-5-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: use dcache helpers for scsi_cmd data and only invalidate if necessary
Neil Armstrong [Mon, 30 Sep 2024 12:44:26 +0000 (14:44 +0200)]
ufs: use dcache helpers for scsi_cmd data and only invalidate if necessary

Now we have proper flush and invalidate helpers, we can use them
directly to operate on the scsi_cmd data.

Likewise, we do not need to flush then invalidate, just flush _or_
invalidate depending on the data direction.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-4-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: split flush and invalidate to only invalidate when required
Neil Armstrong [Mon, 30 Sep 2024 12:44:25 +0000 (14:44 +0200)]
ufs: split flush and invalidate to only invalidate when required

There is no need to flush and invalidate all data updated by the
driver, mainly because on ARM platforms flush also invalidates
the cachelines.

Split the function in two and add the appropriate cacheline
invalidates after the UFS DMA operation finishes to make sure
we read from memory.

Flushing then invalidating cacheline unaligned data causes data
corruption issues on Qualcomm platforms, and is largely unnecessary
anyway, so let's cleanup the cache operations.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-3-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: fix dcache flush and invalidate range calculation
Neil Armstrong [Mon, 30 Sep 2024 12:44:24 +0000 (14:44 +0200)]
ufs: fix dcache flush and invalidate range calculation

The current calculation will omit doing a flush/invalidate on the last
cacheline if the base address is not aligned with DMA_MINALIGN.

This causes commands failures and write corruptions on Qualcomm
platforms.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-2-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: allocate descriptors with size aligned with DMA_MINALIGN
Neil Armstrong [Mon, 30 Sep 2024 12:44:23 +0000 (14:44 +0200)]
ufs: allocate descriptors with size aligned with DMA_MINALIGN

Align the allocation size with DMA_MINALIGN to make sure we do not
flush/invalidate data from following allocations.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Tested-by: Julius Lehmann <lehmanju@devpi.de>
Link: https://lore.kernel.org/r/20240930-topic-ufs-enhancements-v3-1-58234f84ab89@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Mon, 14 Oct 2024 02:25:41 +0000 (20:25 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

This switches all boards with the Allwinner H616/H618/H313/H700 SoCs over to
use OF_UPSTREAM. We are doing it for this SoC family only since the DTs
between the U-Boot and the kernel repo are exactly identical, whereas other
families have one compatibility fix in U-Boot to allow booting older kernels.
Other will follow if this plays out well.

The biggest chunk otherwise is adding support for an Anbernic game console,
using the H700 SoC. For that we need to enhance the DRAM support code, and
pick two DT commits from the mainline kernel/DT rebasing repo, followed
by the defconfig patch.

On top of that two small fixes for the old Allwinner A80.

Gitlab CI passed, and I booted that briefly on some boards, including an
H616 and an H618 one (with LPDDR4).

2 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 14 Oct 2024 02:25:22 +0000 (20:25 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

2 months agoMerge tag 'u-boot-imx-master-20241013' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sun, 13 Oct 2024 22:25:01 +0000 (16:25 -0600)]
Merge tag 'u-boot-imx-master-20241013' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Add fast authentication method for i.MX8M signing.
- Migrate imx8mp-debix-model-a to OF_UPSTREAM.
- Update MAINTAINERS file globs for i.MX6/i.MX8MP DHSOM.
- Improve ELE driver.
- Add i.MX8MP Dummy clk to fix regression.

2 months agoclk: renesas: Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.10.9
Marek Vasut [Thu, 12 Sep 2024 23:53:59 +0000 (01:53 +0200)]
clk: renesas: Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.10.9

Synchronize R-Car R8A779H0 V4M clock tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoclk: renesas: Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.10.9
Marek Vasut [Thu, 12 Sep 2024 23:53:58 +0000 (01:53 +0200)]
clk: renesas: Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.10.9

Synchronize R-Car R8A779G0 V4H clock tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoclk: renesas: Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.10.9
Marek Vasut [Thu, 12 Sep 2024 23:53:57 +0000 (01:53 +0200)]
clk: renesas: Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.10.9

Synchronize R-Car R8A779F0 S4 clock tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoclk: renesas: Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.10.9
Marek Vasut [Thu, 12 Sep 2024 23:53:56 +0000 (01:53 +0200)]
clk: renesas: Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.10.9

Synchronize R-Car R8A779A0 V3U clock tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agopinctrl: renesas: Synchronize R-Car R8A779H0 V4M PFC tables with Linux 6.10.9
Marek Vasut [Wed, 11 Sep 2024 21:09:39 +0000 (23:09 +0200)]
pinctrl: renesas: Synchronize R-Car R8A779H0 V4M PFC tables with Linux 6.10.9

Synchronize R-Car R8A779H0 V4M PFC tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agopinctrl: renesas: Synchronize R-Car R8A779G0 V4H PFC tables with Linux 6.10.9
Marek Vasut [Wed, 11 Sep 2024 21:09:38 +0000 (23:09 +0200)]
pinctrl: renesas: Synchronize R-Car R8A779G0 V4H PFC tables with Linux 6.10.9

Synchronize R-Car R8A779G0 V4H PFC tables with Linux 6.10.9,
commit 1611860f184a2c9e74ed593948d43657734a7098 .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agosh: cache: Fill in invalidate_icache_all()
Marek Vasut [Mon, 9 Sep 2024 23:18:09 +0000 (01:18 +0200)]
sh: cache: Fill in invalidate_icache_all()

Implement invalidate_icache_all() by clearing all V bits in
IC and OC. This is done by setting CCR cache control register
ICI and OCI bits.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
---
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de
2 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Tom Rini [Sun, 13 Oct 2024 16:19:05 +0000 (10:19 -0600)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra

Assorted Tegra enhancements. Merged with the recent XPL_BUILD changes,
resolve some whitespace issues and fix the name of the new apalis-tk1
env file by Tom.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agovideo: panel: add Sharp LQ101R1SX01 MIPI DSI panel driver
Svyatoslav Ryhel [Sat, 23 Dec 2023 19:50:31 +0000 (21:50 +0200)]
video: panel: add Sharp LQ101R1SX01 MIPI DSI panel driver

This module is a color active matrix LCD module incorporating
Oxide TFT (Thin Film Transistor). It is composed of a color TFT-LCD
panel, driver ICs, a control circuit and power supply circuit, and
a backlight unit. Graphics and texts can be displayed on a 2560×1600
dots panel with (16,777,216) colors by using MIPI DUAL DSI interface,
supplying +3.3V DC supply voltage for TFT-LCD panel driving and
supplying DC supply voltage for LED Backlight.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: tegra20: dsi: add ganged mode support
Svyatoslav Ryhel [Tue, 30 Jul 2024 10:35:45 +0000 (13:35 +0300)]
video: tegra20: dsi: add ganged mode support

Implement ganged mode support for the Tegra DSI driver. The DSI host
controller to gang up with is specified via a phandle in the device tree
and the resolved DSI host controller used for the programming of the
ganged-mode registers.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agovideo: tegra20: dc: remove DECLARE_GLOBAL_DATA_PTR use
Svyatoslav Ryhel [Tue, 30 Jul 2024 10:30:17 +0000 (13:30 +0300)]
video: tegra20: dc: remove DECLARE_GLOBAL_DATA_PTR use

It seems that DECLARE_GLOBAL_DATA_PTR use is not needed and video system
works perfectly fine without it.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agousb: host: tegra: get usb phy configuration from phy node
Svyatoslav Ryhel [Thu, 17 Aug 2023 17:15:18 +0000 (20:15 +0300)]
usb: host: tegra: get usb phy configuration from phy node

Obtain USB phy configuration from phy node if such exists
and is enabled. If no, set default values.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoarm: tegra: add AP20 and AP20H SKU
Ion Agorria [Tue, 24 Sep 2024 19:46:45 +0000 (21:46 +0200)]
arm: tegra: add AP20 and AP20H SKU

Add previously undocumented SKU - AP20H found in LG Optimus 2X (P990).
Correct existing T20_7 name as it's proper name is AP20.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoarm: tegra: fix typo in logging functions
Ion Agorria [Thu, 3 Oct 2024 07:52:12 +0000 (10:52 +0300)]
arm: tegra: fix typo in logging functions

Change %02X to %02x since it always displayed 00 otherwise.

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: asus: transformer: implement multi-DTB support
Svyatoslav Ryhel [Thu, 1 Aug 2024 13:50:41 +0000 (16:50 +0300)]
board: asus: transformer: implement multi-DTB support

Use board revision detection mechanism to choose correct DTB.
Adjust documentation and build setup accordingly.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: asus: grouper: implement multi-DTB support
Svyatoslav Ryhel [Thu, 1 Aug 2024 13:42:24 +0000 (16:42 +0300)]
board: asus: grouper: implement multi-DTB support

Use board revision detection mechanism to choose correct DTB.
Adjust documentation and build setup accordingly.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: htc: endeavoru: simplify RCM hook
Svyatoslav Ryhel [Fri, 9 Aug 2024 18:27:58 +0000 (21:27 +0300)]
board: htc: endeavoru: simplify RCM hook

Use SPL GPIO functions to simplify RCM hook on HTC One X.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: asus: grouper: dynamically detect correct SPL configuration
Svyatoslav Ryhel [Thu, 1 Aug 2024 16:11:17 +0000 (19:11 +0300)]
board: asus: grouper: dynamically detect correct SPL configuration

Use PMIC detection mechanism to find correct configuration.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agodrivers: tegra_gpio: add early SPL functions
Svyatoslav Ryhel [Fri, 9 Aug 2024 18:10:31 +0000 (21:10 +0300)]
drivers: tegra_gpio: add early SPL functions

In some cases access to GPIOs is needed so early that DM
is not ready even nearly. These functions are exactly for
this case.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra-u-boot: add recipe for multi-dtb image
Svyatoslav Ryhel [Fri, 2 Aug 2024 12:51:41 +0000 (15:51 +0300)]
ARM: tegra-u-boot: add recipe for multi-dtb image

Buildman has difficulties with constructing multi-dtb images, so
let's add a temporary custom recipe for it.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoARM: tegra: board2: add common dtb reselect logic
Svyatoslav Ryhel [Sat, 3 Aug 2024 17:01:29 +0000 (20:01 +0300)]
ARM: tegra: board2: add common dtb reselect logic

Add common logic for dynamic dtb switch and DM reload if board
features multi-dtb support.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoTegra30: Add funcmux for UART over SD slot
Jonas Schwöbel [Mon, 22 Jan 2024 12:40:27 +0000 (14:40 +0200)]
Tegra30: Add funcmux for UART over SD slot

Tegra 3 has UART-E exposable via SD card slot which may be
handy for debugging. This change only adds funcmux part, to
use UART-E on the device you additionally would need:
- set stdout-path to serial@70006400 (uarte)
- configure sdmmc1_dat3_py4 and sdmmc1_dat2_py5 pinmux for
  uarte
- disable or remove sdhci@7800000 node
- enable CONFIG_TEGRA_ENABLE_UARTE in defconfig
- set CFG_SYS_NS16550_COM to NV_PA_APB_UARTE_BASE in device
  header

Signed-off-by: Jonas Schwöbel <jonasschwoebel@yahoo.de>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoboard: tegra: convert boards to text env
Svyatoslav Ryhel [Mon, 24 Jun 2024 17:13:47 +0000 (20:13 +0300)]
board: tegra: convert boards to text env

Convert boards to use text based env. This is the first stage of
conversion, common inclusions should be converted next.

Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com> # Toradex Apalis TK1
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agodisk: add TegraPT support
Svyatoslav Ryhel [Wed, 31 Jul 2024 08:22:54 +0000 (11:22 +0300)]
disk: add TegraPT support

TegraPT is compatible with EFI part but it can't pass Protective MBR check.
Skip this check if CONFIG_TEGRA_PARTITION is enabled, storage uclass is MMC
and devnum is 0. Note, eMMC on supported devices MUST be aliased to mmc0.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoclk: imx8mp: Add i.MX8MP Dummy clk
Peng Fan [Sat, 12 Oct 2024 09:34:10 +0000 (17:34 +0800)]
clk: imx8mp: Add i.MX8MP Dummy clk

i.MX8MP SDHC use CLK_IMX8MP_DUMMY clk entry. Without the clk, the bulk
api will return failure.

The correct entry should be replaced with IMX8MP_IPG_ROOT clk in device
tree. This will be done in Kernel device tree and sync to U-Boot in
future:
https://lore.kernel.org/all/20241012025221.1728438-1-peng.fan@oss.nxp.com/

Fixes: 76332fae769 ("mmc: fsl_esdhc_imx: Enable AHB/IPG clk with clk bulk API")
Reported-by: Gilles Talis <gilles.talis@nxp.com>
Tested-by: Gilles TALIS <gilles.talis@gmail.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agoarm64: imx: imx8mp-debix-model-a: Migrate to OF_UPSTREAM
Gilles Talis [Thu, 10 Oct 2024 00:42:42 +0000 (20:42 -0400)]
arm64: imx: imx8mp-debix-model-a: Migrate to OF_UPSTREAM

Device tree for this board can be deleted. Device tree location
now points to the freescale/ directory.

Use absolute path to PMIC node entry and its regulators as
device tree in kernel does not provide corresponding labels

Signed-off-by: Gilles Talis <gilles.talis@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agoimx8: Correct the SCU API return value check
Peng Fan [Wed, 9 Oct 2024 08:29:36 +0000 (16:29 +0800)]
imx8: Correct the SCU API return value check

The SCU API alreay has been converted to return Linux error code,
using SCU error code is not correct here, although SC_ERR_NONE is value
as 0.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agobinman: add fast authentication method for i.MX8M signing
Brian Ruley [Tue, 1 Oct 2024 13:58:09 +0000 (16:58 +0300)]
binman: add fast authentication method for i.MX8M signing

Using the PKI tree with SRKs as intermediate CA isn't necessary or even
desirable in some situations (boot time, for example). Add the possibility
to use the "fast authentication" method where the image and CSF are both
signed using the SRK [1, p.63].

[1] https://community.nxp.com/pwmxy87654/attachments/pwmxy87654/imx-processors/202591/1/CST_UG.pdf

Signed-off-by: Brian Ruley <brian.ruley@gehealthcare.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
2 months agobinman: cosmetic: refactor `nxp_imx8mcst' etype code
Brian Ruley [Tue, 1 Oct 2024 13:58:08 +0000 (16:58 +0300)]
binman: cosmetic: refactor `nxp_imx8mcst' etype code

Simplify code and conform to the style guide used in the project by
making the following changes:
* Capitalize global constants
* Use single quotes for multiline strings (except docstrings)
* Fix line width to 79 cols
* Use f-string instead of formatting a regular string or using a
  complicated concatenation
* Move common suffix used in keys to a global variable "KEY_NAME"
  to reduce the likelihood of typos and making future changes
  easier

Signed-off-by: Brian Ruley <brian.ruley@gehealthcare.com>
Cc: Marek Vasut <marex@denx.de>
2 months agoARM: imx: Update MAINTAINERS file globs for i.MX8MP DHSOM
Marek Vasut [Sun, 6 Oct 2024 23:11:10 +0000 (01:11 +0200)]
ARM: imx: Update MAINTAINERS file globs for i.MX8MP DHSOM

Update the MAINTAINERS file glob to cover all of i.MX8MP DHSOM related files.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoARM: imx: Update MAINTAINERS file globs for i.MX6 DHSOM
Marek Vasut [Sun, 6 Oct 2024 23:11:09 +0000 (01:11 +0200)]
ARM: imx: Update MAINTAINERS file globs for i.MX6 DHSOM

Update the MAINTAINERS file glob to cover all of i.MX6 DHSOM related files.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agomisc: fuse: Update fuse driver
Ye Li [Sun, 6 Oct 2024 00:30:05 +0000 (08:30 +0800)]
misc: fuse: Update fuse driver

When OSCCA is enabled, FSB fuse shadow (offset 0x8000)
access is disabled for SOC. So update the driver to read fuse
from ELE API. The ELE has supported to read all shadow fuses like
FSB, reuse the table of FSB for the word index used by ELE API.

Add ELE shadow fuse read and write to current ELE fuse driver.
But when LC is OEM closed, the ELE read/write shadow fuse APIs are
forbidden. Reading from any fuse will return error. This causes
problem to u-boot which must read out some fuse no matter whatever LC.
So we have to change back to read from FSB and ELE common fuse read API.
For using ELE shadow read API for development purpose like checking
the ELE shadow fuse write result, user can set env variable
"enable_ele_shd" to y to switch it.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: fuse: Fix FSB redundancy fuse word check and clear res
Ye Li [Sun, 6 Oct 2024 00:30:04 +0000 (08:30 +0800)]
misc: fuse: Fix FSB redundancy fuse word check and clear res

There is a bug when checking fuse word with redundancy fuse in FSB
table. The redundancy fuses are combined into 4 words, so we can't
directly use word index to do the check, otherwise the high 4 words
will fail to match.

And When calling ELE API, res parameter will pass to ELE API to get ELE
response value for failure. So most of usage does not initialize
this variable and print it after calling ELE API.
However, when ELE API returns failure, we can't ensure this res is
always set because there may be other failure like MU failure.

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_api: Add read/write shadow fuse APIs
Ye Li [Sun, 6 Oct 2024 00:30:03 +0000 (08:30 +0800)]
misc: ele_api: Add read/write shadow fuse APIs

Add ELE APIs to support read and write shadow fuses

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_api: Update ELE read common fuse API
Peng Fan [Sun, 6 Oct 2024 00:30:02 +0000 (08:30 +0800)]
misc: ele_api: Update ELE read common fuse API

On iMX8ULP, the word index 1 is used to read OTP_UNIQ_ID with 4 words
data responsed. However this special index does not apply others.
So restrict the check to i.MX8ULP to avoid problem when reading from
fuse word 1 for others, such as i.MX93.

Also update header order

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_mu: Clear RR when initialize MU
Peng Fan [Sun, 6 Oct 2024 00:22:51 +0000 (08:22 +0800)]
misc: ele_mu: Clear RR when initialize MU

When OS is doing ELE API call, before OS get the response, OS is force
reseted, then it is possible that MU RR has data during initialization
in SPL stage. So clear the RR registers, otherwise SPL ELE API call will
work abnormal.

Cc: Alice Guo <alice.guo@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2 months agomisc: ele_mu: Update ELE MU to get TR/RR number from HW
Ye Li [Sun, 6 Oct 2024 00:22:50 +0000 (08:22 +0800)]
misc: ele_mu: Update ELE MU to get TR/RR number from HW

The MU parameter register can provide the TR and RR number.
For i.MX95 which has 8 RR is different with i.MX93 and i.MX8ULP,
so update the driver to read the PAR for exact TR and RR number.

Also update compatible string for i.MX95 ELE MU.

Cc: Alice Guo <alice.guo@nxp.com>
Cc: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
2 months agoboard: bcm96846: Switch to using OF_UPSTREAM
Linus Walleij [Fri, 11 Oct 2024 14:49:57 +0000 (16:49 +0200)]
board: bcm96846: Switch to using OF_UPSTREAM

This board clearly develops first in Linux which had more
hardware listed, so let's start to use OF_UPSTREAM.
This makes the NAND driver work.

Suggested-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 months agoboard: bcm96846: Enable NAND options
Linus Walleij [Fri, 11 Oct 2024 14:49:56 +0000 (16:49 +0200)]
board: bcm96846: Enable NAND options

This adds reasonable NAND options to the BCM96846 reference design:

- CMD_NAND, MTD_RAW_NAND
- Disable SYS_NAND_ONFI_DETECTION as this just give error messages
- MTD, MTDPARTS with DM and related config options
- CMD_UBI and CMD_UBIFS as this is likely used with ubi/ubifs

What I didn't add was something like the following:

CONFIG_MTDPARTS_DEFAULT="nand0:256k(cfi),257024k(image)"

Because I don't actually have a BCM96846 reference design. These
are only available to Broadcom and their customers  I think,
but perhaps the people at Broadcom can provide the detail of
the flash layout for BCM96846 so we can add this too so the
bcm96846_config is usable out of the box.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 months agodrivers: nand: bcmbca: Enable on BCM6846
Linus Walleij [Fri, 11 Oct 2024 14:49:55 +0000 (16:49 +0200)]
drivers: nand: bcmbca: Enable on BCM6846

The BCM6846 has the BRCMBCA NAND controller so enable
it.

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 months agomtd: rawnand: brcmnand: Add BCMBCA RAW NAND driver
Linus Walleij [Fri, 11 Oct 2024 14:49:54 +0000 (16:49 +0200)]
mtd: rawnand: brcmnand: Add BCMBCA RAW NAND driver

The Broadcom BCA platforms are broadband access SoCs.
This is a port of the upstream Linux driver to U-Boot.
It was based on drivers/mtd/nand/raw/brcmnand/bcmbca_nand.c
from Linux v6.11.

Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2 months agomtd: nand: raw: atmel: Use ONFI ECC params if available
Zixun LI [Sun, 21 Jul 2024 21:45:52 +0000 (23:45 +0200)]
mtd: nand: raw: atmel: Use ONFI ECC params if available

When ECC parameters are not specified in DT, first try ONFI ECC parameters
before fallback to maximum strength.

It's the Linux driver behavior since the driver rewriting in f88fc12.

From then 2 nand system refactors have been done in 6a1b66d6 and 53576c7b,
chip->ecc_strength_ds and chip->ecc_step_ds became
nanddev_get_ecc_requirements(). U-Boot didn't follow the refactor and
always use these 2 fields.

v2: Fix formatting, add upstream commit hash.

Signed-off-by: Zixun LI <zli@ogga.fr>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: Balamanikandan Gunasundar
2 months agoMerge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"
Tom Rini [Fri, 11 Oct 2024 18:23:25 +0000 (12:23 -0600)]
Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"

Simon Glass <sjg@chromium.org> says:

When the SPL build-phase was first created it was designed to solve a
particular problem (the need to init SDRAM so that U-Boot proper could
be loaded). It has since expanded to become an important part of U-Boot,
with three phases now present: TPL, VPL and SPL

Due to this history, the term 'SPL' is used to mean both a particular
phase (the one before U-Boot proper) and all the non-proper phases.
This has become confusing.

For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL'
phases, not just SPL. So code which can only be compiled for actual SPL,
for example, must use something like this:

   #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)

In Makefiles we have similar issues. SPL_ has been used as a variable
which expands to either SPL_ or nothing, to chose between options like
CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable
was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was
updated to support 'VPL_' as well.

This series starts a change in terminology and usage to resolve the
above issues:

- The word 'xPL' is used instead of 'SPL' to mean a non-proper build
- A new CONFIG_XPL_BUILD define indicates that the current build is an
  'xPL' build
- The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now
  defined for TPL and VPL phases
- The existing SPL_ Makefile variable is renamed to SPL_
- The existing SPL_TPL Makefile variable is renamed to PHASE_

It should be noted that xpl_phase() can generally be used instead of
the above CONFIGs without a code-space or run-time penalty.

This series does not attempt to convert all of U-Boot to use this new
terminology but it makes a start. In particular, renaming spl.h and
common/spl seems like a bridge too far at this point.

The series is fully bisectable. It has also been checked to ensure there
are no code-size changes on any commit.

2 months agoqconfig: Update tool for new Makefile variables
Simon Glass [Mon, 30 Sep 2024 01:49:56 +0000 (19:49 -0600)]
qconfig: Update tool for new Makefile variables

Take account of the new XPL_ and PHASE_ instead of the old SPL_ and
SPL_TPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agospl: Rename SPL_TPL_NAME and SPL_TPL_PROMPT
Simon Glass [Mon, 30 Sep 2024 01:49:55 +0000 (19:49 -0600)]
spl: Rename SPL_TPL_NAME and SPL_TPL_PROMPT

Rename these to use the word PHASE instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Rename SPL_TPL_ to PHASE_
Simon Glass [Mon, 30 Sep 2024 01:49:54 +0000 (19:49 -0600)]
global: Rename SPL_TPL_ to PHASE_

Use PHASE_ as the symbol to select a particular XPL build. This means
that SPL_TPL_ is no-longer set.

Update the comment in bootstage to refer to this symbol, instead of
SPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Rename SPL_ to XPL_
Simon Glass [Mon, 30 Sep 2024 01:49:53 +0000 (19:49 -0600)]
global: Rename SPL_ to XPL_

Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agokconfig: binman: Check for SPL instead of XPL
Simon Glass [Mon, 30 Sep 2024 01:49:52 +0000 (19:49 -0600)]
kconfig: binman: Check for SPL instead of XPL

Now that SPL means SPL (only) and is not defined for other phases,
update kconfig rules.

This is done in one patch since otherwise many Binman tests fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Define CONFIG_SPL_BUILD only for the SPL build
Simon Glass [Mon, 30 Sep 2024 01:49:51 +0000 (19:49 -0600)]
xpl: Define CONFIG_SPL_BUILD only for the SPL build

Make this define mean SPL only, not TPL, VPL, etc.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoglobal: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:50 +0000 (19:49 -0600)]
global: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Complete this rename for all directories outside arch/ board/ drivers/
and include/

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoinclude: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:49 +0000 (19:49 -0600)]
include: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodrivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:48 +0000 (19:49 -0600)]
drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoboard: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:47 +0000 (19:49 -0600)]
board: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoarch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Simon Glass [Mon, 30 Sep 2024 01:49:46 +0000 (19:49 -0600)]
arch: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD

Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Update init docs for the xPL changes
Simon Glass [Mon, 30 Sep 2024 01:49:45 +0000 (19:49 -0600)]
doc: Update init docs for the xPL changes

Update the documentation here to cover the meaning of xPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Move init-related things out of README
Simon Glass [Mon, 30 Sep 2024 01:49:44 +0000 (19:49 -0600)]
doc: Move init-related things out of README

Move this section to rst, changing it just enough so that it builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoREADME: Drop SoC-specific comment about SPL
Simon Glass [Mon, 30 Sep 2024 01:49:43 +0000 (19:49 -0600)]
README: Drop SoC-specific comment about SPL

This should not be in the generic README file, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agodoc: Update SPL docs for the xPL changes
Simon Glass [Mon, 30 Sep 2024 01:49:42 +0000 (19:49 -0600)]
doc: Update SPL docs for the xPL changes

Update the various references to SPL in this document. Make sure to
refer to 'phases' instead of 'stages', which is not a U-Boot term.

Fix a few U-boot typos and try to improve grammar a little while we are
here.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agolog: global: Rename warn_non_spl()
Simon Glass [Mon, 30 Sep 2024 01:49:41 +0000 (19:49 -0600)]
log: global: Rename warn_non_spl()

This should now refer to xPL rather than SPL, so update it throughout
the tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_phase_prefix() and spl_phase_name()
Simon Glass [Mon, 30 Sep 2024 01:49:40 +0000 (19:49 -0600)]
xpl: Rename spl_phase_prefix() and spl_phase_name()

Use simpler names for these functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2 months agoxpl: Rename spl_next_phase() and spl_prev_phase()
Simon Glass [Mon, 30 Sep 2024 01:49:39 +0000 (19:49 -0600)]
xpl: Rename spl_next_phase() and spl_prev_phase()

Rename this to use the xpl prefix.

Signed-off-by: Simon Glass <sjg@chromium.org>