summaryrefslogtreecommitdiff
path: root/board/amd
AgeCommit message (Collapse)Author
5 daysarm64: versal2: Move SoC detection out of board codeMichal Simek
soc_detection() and soc_name_decode() read the PMC_TAP version/idcode registers and decode the platform. This is SoC information rather than board policy, and a firmware interface could provide it instead, so it does not belong in board code. Move both functions, together with the shared platform_id and platform_version state, into arch/arm/mach-versal2 where they still override the weak stubs in the Xilinx common board code. The board file drops the now unused linux/bitfield.h include. Signed-off-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/c332ab27f66f1c808f32a4bcb453d9e8da543331.1782219202.git.michal.simek@amd.com
5 daysarm64: versal2: Move board_early_init_r clock setup to mach codeMichal Simek
board_early_init_r() programmed the IOU switch clock and the system timestamp counter directly with readl()/writel() in board code. This is SoC register setup rather than board policy, and the same block is duplicated across the Xilinx SoCs. Move it into versal2_timer_setup() in arch/arm/mach-versal2 so the board hook only keeps the EL3 guard and calls the helper. Signed-off-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/08e835a183c39de6f666375ac390eee6a8f3f12e.1782219202.git.michal.simek@amd.com
5 daysarm64: versal2: Move bootmode decoding out of board codeMichal Simek
versal2_get_bootmode() lived in board code and accessed the CRP boot mode register with a direct readl(). To keep generic board code free of SoC register details and ready for firmware/SCMI based access, move the whole function, including the alt-shift and mask decoding, into arch/arm/mach-versal2 as a __weak default. Board code now simply calls versal2_get_bootmode(). When a firmware based implementation is available and tested it can provide a strong definition that overrides the weak one at link time; until then only the weak MMIO version is built. Signed-off-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/f3274ec77218373bc0452f6795a3ad6016be0058.1782219202.git.michal.simek@amd.com
5 daysarm64: versal2: Decouple multiboot register access from firmwareMichal Simek
versal2_multi_boot() in board code selected between the firmware call zynqmp_pm_get_pmc_multi_boot_reg() and a direct readl() based on an IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE) check. Generic board code should not carry firmware-specific ifdefs, and this becomes harder to maintain once SCMI introduces yet another access method. Introduce an overridable accessor versal2_pmc_multi_boot(). The weak default lives in arch/arm/mach-versal2 and performs the plain MMIO read (used at EL3 and when no firmware is present). When CONFIG_ZYNQMP_FIRMWARE is enabled, firmware-zynqmp.c provides a strong definition that issues the firmware call, falling back to the direct read at EL3 where the SMC path to firmware is unavailable. The shared MMIO read is factored into versal2_multi_boot_reg() so the firmware override does not duplicate it. versal2_multi_boot() keeps the generic JTAG/QEMU workaround and simply calls the accessor, so board code no longer references the firmware interface and the now unused zynqmp_firmware.h include is dropped. The firmware-vs-MMIO decision is selected at link time, and adding SCMI later only requires a third strong definition with no board-code changes. Signed-off-by: Michal Simek <[email protected]> Link: https://patch.msgid.link/0033a1fa8efb4ae0c3ac6a6f5c5c1b4e0f22f02c.1782219202.git.michal.simek@amd.com
5 daysamd: versal2: detect spi env bus from boot modeSuraj Kakade
Add spi_get_env_dev() to dynamically detect the correct SPI bus based on the actual boot mode at runtime. This ensures environment variables are always loaded from the correct SPI flash controller regardless of the bus numbering. For example, on some Versal Gen 2 boards, SPI is disabled in DTS leaving bus 0 empty in DM. Only QSPI is enabled at bus 1. The default CONFIG_ENV_SPI_BUS=0 causes U-Boot to search for environment at bus 0 which does not exist, triggering the warning "spi_flash_probe_bus_cs() failed, using default environment". Signed-off-by: Suraj Kakade <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2026-06-08board: amd: Add capsule and FWU supportPadmarao Begari
Add configure_capsule_updates() supporting MMC, SD and QSPI/OSPI boot modes for DFU string generation. Add set_dfu_alt_info() for FWU multi-bank mode to generate DFU alt info from NOR flash MTD partitions. Add XILINX_BOOT_IMAGE_GUID for the capsule updatable firmware image. Signed-off-by: Padmarao Begari <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2026-05-25arm64: versal2: Fix buffer overflow in soc_name_decodeFrancois Berder
The size of name buffer was not computed correctly. The suffix format is "--rel.-el" (9 chars instead of 6), and the longest platform name is "emu-mmd" (7 chars instead of 4). Fix comment and name size. Fixes: 40f5046c221a ("arm64: versal2: Add support for AMD Versal Gen 2") Signed-off-by: Francois Berder <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/BESP194MB280513B376D54A815F3FD507DA0E2@BESP194MB2805.EURP194.PROD.OUTLOOK.COM
2026-02-13arm64: versal2: Populate DRAM banks before page table size calculationPranav Sanwal
Move DRAM bank detection from fdtdec to custom implementation to ensure memory banks are populated before get_page_table_size() is called during MMU initialization. The current fdtdec-based approach populates gd->bd->bi_dram[] too late in the boot sequence, causing get_page_table_size() to be called with unpopulated DRAM information. This prevents dynamic page table sizing based on actual memory configuration. Parse /memory nodes in dram_init() to fill versal2_mem_map[] early enough for MMU setup. Supports up to CONFIG_NR_DRAM_BANKS (36) non-contiguous banks with high memory regions (>4GB) and use __weak get_page_table_size implementation to estimate page table size based on the populated DRAM banks. Signed-off-by: Pranav Sanwal <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2026-01-16arm64: versal2: Fix emmc boot mode boot_target issuePranav Tilak
The eMMC boot device controller on Versal2 requires device pointer initialization before accessing its sequence number. The EMMC_MODE case was using dev_seq(dev) on an uninitialized pointer, causing corrupted boot_targets entries (mmc7f7fbfbf instead of mmc0/mmc1). Add uclass_get_device_by_name() call to properly initialize the device pointer before reading the sequence number. The dev sequence number is determined at runtime based on DT aliases. Fix boot_targets corruption in eMMC boot mode, allowing proper boot device selection instead of falling back to JTAG mode. Signed-off-by: Pranav Tilak <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2025-12-19arm64: versal2: Read and show multiboot valueMichal Simek
SOC can boot from different boot medias and also different offsets that's why by default show multiboot value to be aware which image system is booting out of. It is especially useful for systems with A/B update enabled. Also limit zynqmp_pm_get_pmc_multi_boot_reg() usage only for Versal and Versal Gen 2. Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/fd7564ce2f51d965c273e939e98de01beb92e6f5.1764232124.git.michal.simek@amd.com
2025-07-08arm64: versal2: Do not define do_reset() if sysreset is enabledVenkatesh Yadav Abbarapu
If sysreset is enabled reset_cpu is defined in sysreset uclass that's why it can't be in platform/board code. Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-04-16board: amd: Read an eeprom after relocationPadmarao Begari
Read an eeprom after relocation which also shows information from eeprom wired via nvmem aliases. When DTB reselection is enabled eeprom is read before relocation too but information is not showed. The issue about two i2c reads in this case will be address separately. Signed-off-by: Padmarao Begari <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-04-16amd: versal2: Add support for saving env based on bootmodeVenkatesh Yadav Abbarapu
Enable saving variables to MMC(FAT) and SPI based on primary bootmode. If bootmode is JTAG, dont save env anywhere(NOWHERE). Enable ENV_FAT_DEVICE_AND_PART="0:auto" for Versal Gen 2 platform. Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-04-16xilinx: Free memory when variable is saved in boot_targets_setup()Michal Simek
When boot_targets variable is saved there is no reason to keep string in malloc area that's why free it. This change is already done in ZynqMP code. Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/fa10fc22193a1a23258466056b3d02f7496fccfe.1744270729.git.michal.simek@amd.com
2025-04-16arm64: versal2: Add PL bit stream load supportPrasad Kummari
Add support for loading the secure & non-secure pdi images and PL bitstream on the Versal Gen2 platform. The FPGA driver is enabled to load the bitstream in PDI format on the AMD Versal Gen2 device. PDI is the new programmable device image format for Versal Gen2, and the bitstream for the Versal Gen2 platform is generated exclusively in this format. With the enhanced SMC format in TF-A ensuring transparent payload forwarding for Versal Gen2, the u-boot driver must now handle the word swapping of PDI address that was previously done in TF-A for this API. The source code for the Versal2 loadpdi command and the CONFIG_CMD_VERSAL2 configuration has been removed. It now utilizes the fpga load <dev> <address> <length> command to load secure & non-secure pdi images. Signed-off-by: Prasad Kummari <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-04-16amd: versal2: Add the UFS boot mode supportVenkatesh Yadav Abbarapu
Add the UFS boot mode support and update the boot_targets with ufs mode. If the UFS device is not accessible from APU and running this is detected as a warning, as the device is not accessible. Signed-off-by: Venkatesh Yadav Abbarapu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2025-04-16versal2: Fix .*get_bootmode function nameMichal Simek
Function was c&p from Versal NET and should use soc specific name instead. Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/bd8cb2f9783bda47663927f78bf0bf908393334b.1739882445.git.michal.simek@amd.com
2024-06-26cmd: Make use of U_BOOT_LONGHELP when missingTom Rini
After adding the U_BOOT_LONGHELP macro some new commands came in still that were not making use if it. Switch these cases over and in a few places add missing newlines as well. Signed-off-by: Tom Rini <[email protected]>
2024-06-17arm64: versal2: Add support for AMD Versal Gen 2Michal Simek
Add support for AMD Versal Gen 2. SoC is based on Cortex-a78ae 4 cluster/2 cpu core each. A lot of IPs are shared with previous families. There are couple of new IP blocks where the most interesting from user point of view is UFS. Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/bc2b70831ce1031bd0fac32357bff84936e1310f.1716994063.git.michal.simek@amd.com