[qcom-next] arm: dts: talos: Disable SD card controller - #71
[qcom-next] arm: dts: talos: Disable SD card controller#71balajiselvanathan wants to merge 70 commits into
Conversation
Add clock support for SDCC1 (eMMC) and SDCC2 (SD card) controllers on QCS615 platform. This enables proper clock configuration for both storage interfaces. Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The block device removable flag should reflect whether the MMC device is physically removable (SD card) or soldered (eMMC). This information is specified in the device tree via the "non-removable" property and stored in the MMC_CAP_NONREMOVABLE capability flag. Update the removable flag in the block device descriptor during controller probe to properly reflect the device's removable status. This allows the block layer and upper layers (particularly EFI boot manager) to distinguish between eMMC and SD cards for appropriate handling. The default removable=1 is set in mmc_bind(), and this change overrides it only for non-removable devices after mmc_of_parse() has set the MMC_CAP_NONREMOVABLE capability from the device tree. Reviewed-by: Varadarajan Narayanan <varadarajan.narayanan@oss.qualcomm.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
…r timeout Set CONFIG_SYS_MMC_MAX_BLK_COUNT to 16384 blocks to limit the maximum transfer size per operation. This prevents controller timeouts. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
NVMEM cells currently only support byte-level access. Many hardware
registers pack multiple fields into single bytes, requiring bit-level
granularity. For example, Qualcomm PMIC PON registers store a 7-bit
reboot reason field within a single byte, with bit 0 reserved for other
purposes.
Add support for the optional 'bits' property in NVMEM cell device tree
bindings. This property specifies <bit_offset num_bits> to define a bit
field within the cell's register space.
Implement bit‑field handling in the driver to max u32 size
Example device tree usage:
reboot-reason@48 {
reg = <0x48 0x01>;
bits = <0x01 0x07>; /* 7 bits starting at bit 1 */
};
This reads bits [7:1] from the byte at offset 0x48, leaving bit 0
untouched during write operations.
Cells without the 'bits' property continue to work unchanged, ensuring
backward compatibility with existing device trees.
Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Qualcomm PMICs include SDAM (Shared Direct Access Memory) regions which are used to store persistent data like reboot reasons that must survive across reboots. Without this driver, U-Boot cannot access PMIC storage, preventing reboot-to-bootloader functionality and other features that rely on persistent state. Add qcom-spmi-sdam driver that: - Probes SDAM regions from device tree compatible "qcom,spmi-sdam" - Implements NVMEM provider interface for standard cell-based access - Uses SPMI register read/write operations for data access This enables reboot-mode and other subsystems to access PMIC storage through standard NVMEM APIs. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Add REBOOT_MODE_ENV_UPDATE Kconfig option and implement automatic reboot-mode env variable update at last stage init. When enabled, the reboot-mode uclass registers an EVT_LAST_STAGE_INIT event handler that probes the first reboot-mode device and calls dm_reboot_mode_update() to set the reboot-mode environment variable. EVT_LAST_STAGE_INIT fires after the environment is fully initialized. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Update preboot to check the reboot-mode environment variable and automatically enter fastboot mode when the reboot reason is "bootloader". This enables 'adb reboot bootloader' functionality on Qualcomm platforms. The reboot-mode variable is set by the reboot-mode uclass via EVT_LAST_STAGE_INIT before preboot runs. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Enable reboot-mode functionality for all Qualcomm platforms that define reboot-mode device tree nodes. The drivers gracefully handle platforms without reboot-mode configuration, making it safe to enable globally. Add config options: CONFIG_DM_REBOOT_MODE=y - Core reboot-mode framework CONFIG_REBOOT_MODE_NVMEM=y - NVMEM-based storage backend CONFIG_QCOM_SPMI_SDAM=y - Qualcomm PMIC SDAM/PON access CONFIG_REBOOT_MODE_ENV_UPDATE=y - Auto-update reboot-mode env Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Add a mock I2C EEPROM device (nvmem-test@50) to the sandbox device tree to support NVMEM bit field operation testing. Add test coverage for NVMEM bit field read and write operations to validate the new bit field support in the NVMEM subsystem. Test cases include: - 1-byte cell with 7-bit field (Qualcomm SDAM reboot reason use case) - 2-byte cell with 12-bit field spanning a byte boundary - 4-byte cell without a bit field (legacy byte-level access) - 4-byte cell with a 16-bit field in the upper 2 bytes Error validation tests cover: - Bit field exceeding the cell size - Bit field exceeding the 32-bit maximum - Invalid bit_offset and nbits combinations - Buffer size mismatch in non-bit-field mode The tests verify: - Correct bit extraction during read operations - Read-modify-write behavior preserving unrelated bits - Proper error handling for invalid configurations Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Update the nvmem_cell_read() and nvmem_cell_write() documentation to describe the new bit field operation mode. The documentation now clearly explains: For bit field mode (nbits > 0): - Read: extracts the bit field from raw hardware bytes - Write: performs read-modify-write to preserve other bits - Requirements: buffer size must be sizeof(u32), cell size <= 4 bytes For non-bit-field mode (nbits == 0): - Read/Write: direct byte-level access - Requirements: buffer size must equal the cell size This helps developers understand when to use each mode and the associated buffer size requirements. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
The PM8150 PMIC on this platform uses the older PON (Power On) register architecture rather than dedicated SDAM regions found in newer PMIC generations. To enable reboot-mode functionality with the unified NVMEM-based approach, add a compatibility wrapper that exposes PON registers through the SDAM NVMEM interface. Add device tree configuration: - NVMEM node with compatible "qcom,spmi-sdam" wrapping PON registers - Uses 'ranges' property to map the PON register block at offset 0x800 - NVMEM cell at offset 0x8F (PON_SOFT_RB_SPARE register) - 7-bit field (bits [7:1]) for reboot reason, preserving bit 0 - Mode mappings: bootloader=0x02, recovery=0x01 This wrapper allows the SDAM NVMEM driver to access PON registers transparently, providing a unified interface for both PON-based (older) and SDAM-based (newer) PMIC generations. The PON_SOFT_RB_SPARE register persists across warm resets and is automatically cleared on power cycle. This will be maintained in uboot untill it is upstreamed in kernel dts Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Reorder compatible strings in stub_clk_ids to maintain alphabetical order for easier maintenance. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add RPMH clock compatible strings for QCS615 and SA8775P SoCs to enable clock framework support on these platforms. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add UFS clock support for SA8775P including register definitions, rate configuration, and gate clocks. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add UFS clock support for qcs615 including register definitions, rate configuration, and gate clocks. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add UFS clock support for sc7280 including register definitions, rate configuration, and gate clocks. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Move UFS clock initialization and enabling before hardware setup to ensure clocks are running when accessing UFS registers. Previously, U-Boot depended on earlier bootloader stages to initialize UFS clocks. When these bootloaders failed to do so, UFS registers became inaccessible, causing initialization to fail. This change makes U-Boot initialize and enable UFS clocks early in the init sequence, removing the dependency on previous bootloaders. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
The ufs_qcom_init() function was calling ufs_qcom_setup_clocks() with POST_CHANGE twice. The first call after setting PA_TXHSADAPTTYPE correctly enables the device reference clock. The second call after ufs_qcom_advertise_quirks() is redundant as the clock is already enabled. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Implement device selection syntax allowing users to specify the target block device using "N:partition" format, where N is the device number. When no device is specified, the default from CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID is used. Modify fastboot_block_get_part_info() to use the new parsing function, enabling operations like "fastboot flash 0:boot boot.img" to write to specific devices while maintaining backward compatibility with the existing "fastboot flash boot boot.img" syntax. Example usage: fastboot flash 0:boot boot.img # Flash to device 0 fastboot flash 1:system system.img # Flash to device 1 fastboot flash boot boot.img # Use default device Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add fastboot_flash_gpt_partition_table() and fastboot_flash_mbr_partition_table() helper functions that handle flashing of GPT and MBR partition tables to block devices. The MMC backend now uses these helper functions for GPT and MBR operations, simplifying the code while maintaining the same functionality. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add support for flashing GPT and MBR partition tables to the fastboot block backend. This enables operations like "fastboot flash gpt gpt.img" and "fastboot flash mbr mbr.img" for block devices. The implementation validates partition table names and rejects invalid input formats such as ":gpt" or ":mbr" where the device prefix is missing. Valid formats include "gpt", "mbr", "0:gpt", and "1:mbr". Update Kconfig dependencies to allow FASTBOOT_GPT_NAME and FASTBOOT_MBR_NAME to work with both MMC and block backends.` Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add documentation for the device selection syntax in fastboot block device operations. Users can now specify target devices using "N:partition" format where N is the device number. Document usage examples for regular partition operations like "fastboot flash 0:boot boot.img" and partition table operations like "fastboot flash 1:gpt gpt.img". When no device number is specified, the default from CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID is used. Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Rename qcom_qcs9100_defconfig to qcom_lemans_defconfig and update the defconfig to select lemans-evk DTS instead of qcs9100-ride-r3. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Replace MMC-specific fastboot flash configuration with generic block device support for Qualcomm platforms. This change switches from MMC device 0 to SCSI interface with device ID 4, enabling fastboot operations on UFS storage instead of eMMC. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Introduce part_get_info_by_type_guid() function to enable partition lookup using partition type GUID. This complements the existing UUID lookup functionality and provides more flexible partition discovery mechanisms. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Introduce scsi_get_blk_by_type_guid() function to enable SCSI partition discovery using partition type GUID. This function scans all available SCSI devices and searches for a partition matching the specified type GUID. Reviewed-by: Simon Glass <simon.glass@canonical.com> Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Compute blk_find_max_devnum(UCLASS_SCSI) only once instead of on every loop iteration for better performance. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Change the default value from integer 0 to string "0" to match the string type of the configuration option. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Add support for locating SCSI environment partition using GPT type GUID. Introduce a Kconfig choice statement to select between three mutually exclusive partition lookup methods: UUID-based (default), type GUID-based, and hardware partition number. Reorganize existing configs to depend on their respective choice options. Update ENV_IS_IN_SCSI help text to document the new configuration structure. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Update env/scsi.c to support the new partition selection methods introduced in the Kconfig. Replace runtime string checks with compile-time preprocessor conditionals. Implement support for all three partition selection methods: - TYPE_GUID: Uses scsi_get_blk_by_type_guid() - UUID: Uses scsi_get_blk_by_uuid() - HW: Uses blk_get_device_part_str() Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
Drop Linux headers for the U-Boot ones. Signed-off-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Port over the smem code to U-Boot and ensure the smem region gets mapped after dcache is enabled. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Implement socinfo support to fetch the serial number if available. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Allow smem to be optional for Qualcomm platforms by providing stub functions. Signed-off-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Build the new SMEM driver port, and select it when ARCH_SNAPDRAGON is selected, since it will be a hard dependency for Qualcomm platforms. Signed-off-by: Casey Connolly <casey.connolly@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This code is getting a bit complicated, split it out to try and keep things a bit better organised as we're going to be supporting populating the memory layout from various other sources. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
It is possible to derive the memory map for a Qualcomm platform from the SMEM shared memory region. The memory map is populated by the preloader. Introduce support for parsing this data and using it to populate U-Boot's memory map. Since we aren't yet sure if this will work for every platform, it is not yet used in all cases, if U-Boot is booted with an internal FDT which has the memory map defined, this will be used instead. If the FDT is internal FDT with no memory map defined, then U-Boot will try to use SMEM. This should remove the need to define the memory map statically in a U-Boot overlay for boards that don't chainload. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
If available, otherwise fall back to cmdline. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
Add a defconfig for running on sm8650 as the first stage bootloader and associated debug config fragment. Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
With SMEM based memory information available, let's drop memory node U-Boot DT override for RB3Gen2. Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Implement multi DTB selection from FIT images based on hardware detection via SMEM. The implementation provides: 1. Hardware Detection: Reads SoC parameters from SMEM including chip ID, version, platform ID, OEM variant, DDR size, and storage type from IMEM. 2. Metadata DTB Processing: Parses a metadata DTB (first image in FIT) to build a "bucket list" of hardware-specific node names that match the detected hardware parameters. 3. FIT Configuration Matching: Uses standard FIT mechanisms to find the configuration with the most matching tokens in its compatible string compared to the hardware-derived bucket list. 4. DTB Loading and Overlays: Loads the base DTB and applies any DTBOs specified in the selected configuration using standard FIT overlay application. 5. EFI Integration: Loads selected dtb from qclinux_fit.img and sets fdt_addr for use by the EFI boot flow. This enables multi DTB selection across hardware variants. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
EDK2-based bootloaders on Qualcomm platforms place the FIT image (qclinux_fit.img) on a FAT filesystem partition rather than a raw GPT partition. Add a FAT loading path as a workaround to maintain compatibility with such bootloaders. This FAT loading path is a temporary workaround and will be removed once EDK2 and other bootloaders are updated to place the FIT image in the raw dtb partitions. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Enable CONFIG_QCOM_FIT_MULTIDTB by default for Qualcomm Snapdragon platforms to provide automatic DTB selection from qclinux_fit.img with overlay support. This allows U-Boot to automatically select the appropriate device tree based on hardware parameters detected from SMEM, improving boot compatibility across different hardware variants and reducing the need for board-specific DTB selection logic. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
On Qcom platforms, cmd-db and SMEM regions are required to be mapped as
uncached regions especially when executing at EL2. Otherwise in case of
CMD-DB, an xPU violation can be triggered due to cache operations as
descibed by a similar fix for the kernel here:
Commit f9bb896eab22 ("soc: qcom: cmd-db: Map shared memory as WC, not WB")
So, let's map CMD-DB and SMEM regions as unmapped to avoid any issues
while booting U-Boot in EL2 mode.
Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
With SMEM based memory information available, let's drop memory node U-Boot DT override for talos-evk. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Fix issue where dcache_status() returns true before MMU initialization, causing mmu_map_region() to be called prematurely. Replace with mmu_status() which correctly checks if MMU and page tables are ready. This is semantically correct since we're checking if MMU operations are safe, not specifically if data cache is enabled. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Prepare for supporting alternative boot0.h per-SoC by splitting out the existing msm8916-specific code. There is now a selection mechanism to choose a specific boot0.h in the Kconfig. BOOT0_MSM8916_PSCI_WORKAROUND is the only option right now, but more can be added. The toplevel boot0.h additionally enables conditionally performing the include only in u-boot proper, or only in SPL. Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
Add support for exiting Gunyah hypervisor and switching to EL2 during early boot. This is required for platforms that boot U-Boot in a hypervisor guest environment where U-Boot needs to run at EL2 to enable other hypervisors like KVM. The switch is performed via TrustZone SMC call before EL register configuration in start.S. The implementation: - Checks current exception level and only executes at EL1 - Uses TrustZone SMC to exit Gunyah and transition to EL2 - Integrates with existing boot0.h workaround infrastructure A new Kconfig option CONFIG_QCOM_EL2_GUNYAH_EXIT_SUPPORT enables this functionality. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Enable Gunyah EL2 exit handling and ARM SoC boot0 hook in Qualcomm defconfigs (qcm6490, qcom_lemans, qcom_qcs615) to support early EL2 transitions and platform boot flow requirements. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
efivar.py currently stores authenticated variables including the EFI_VARIABLE_AUTHENTICATION_2 descriptor (timestamp + WIN_CERTIFICATE) along with the payload. When variables are set via U-Boot, SetVariable() validates and strips this authentication descriptor before persisting the variable data, resulting in only the payload being stored and returned by GetVariable(). This mismatch causes efivar.py-generated stores to differ from U-Boot runtime behavior and leads to incorrect GetVariable() results. Update efivar.py to strip the authentication descriptor and store only the payload for authenticated variables, ensuring consistency with U-Boot behavior and compliance with UEFI expectations. Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
The Qualcomm default environment currently boots only with 'bootefi bootmgr'. This bypasses the standard boot flow used to discover extlinux and script boot entries, which are commonly used for FIT-based Linux boots. Switch do_boot to 'bootflow scan -lb' so bootstd handles boot method selection. This keeps EFI support available through the EFI boot methods while also enabling extlinux/boot.scr based bootflows by default. Upstream-Status: Submitted [https://lists.denx.de/pipermail/u-boot/2026-May/618641.html] Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
The Talos EVK does not have SD card support. So, disable the sdhc_2 node in the U-Boot device tree to prevent unnecessary initialization attempts and eliminate boot warnings. Signed-off-by: Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>
|
balajiselvanathan can you check why the Linux DT enabled it in first place if it's not supported? I guess we might be missing something. |
|
Hi Sumit, I meant in uboot sd card is not yet supported. |
I suppose only clk settings might be missing like you did for Lemans. Can you rather properly fix it? |
I had added the clk settings, but getting this warning log during boot: |
Let's have a proper fix for the SD clocks instead of a DT workaround. The warning can be ignored by the user as it's not functional currently. |
5a77d46 to
71c43ff
Compare
beb3440 to
b0c0c8e
Compare
7a854f4 to
03312c4
Compare
The Talos EVK does not have SD card support. So, disable the sdhc_2 node in the U-Boot device tree to prevent unnecessary initialization attempts and eliminate boot warnings.