Skip to content

Add PlutoSDR, ADALM2000, and Sidekiq Z2 board support#85

Merged
mhennerich merged 18 commits intoadi-xlnx-u-boot-2025.1-yfrom
adi-xlnx-u-boot-2025.1-y-pluto-m2k
Apr 21, 2026
Merged

Add PlutoSDR, ADALM2000, and Sidekiq Z2 board support#85
mhennerich merged 18 commits intoadi-xlnx-u-boot-2025.1-yfrom
adi-xlnx-u-boot-2025.1-y-pluto-m2k

Conversation

@mhennerich
Copy link
Copy Markdown

Summary

  • Add device trees for PlutoSDR and Sidekiq Z2
  • Add board config headers and defconfigs for PlutoSDR, ADALM2000 (M2K), and Sidekiq Z2
  • Add ADI board init support for Zynq (hardware reference detection, calibration data)
  • Add bottom 1MB SPI-NOR flash protection for ADI boards
  • Always treat FPGA bitstream as full for Xilinx
  • Add set command alias for ADI board environment variables
  • Add ADALM2000 (M2K) board support

Test plan

  • Build and boot PlutoSDR
  • Build and boot ADALM2000 (M2K)
  • Build and boot Sidekiq Z2
  • Verify SPI-NOR flash protection works correctly
  • Verify FPGA bitstream loading

Add device trees for Analog Devices PlutoSDR (ADALM-PLUTO) and
Epiq Solutions SidekiqZ2 boards:
- 512MB RAM, QSPI flash with jedec,spi-nor compatible
- 4 partitions: fsbl-uboot, uboot-env, nvmfs, linux
- UART1 console, USB0 host mode
- Nulldev serial device for silent console support

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Add adi_hwref, xadc, and envversion commands for Analog Devices
PlutoSDR, M2K, and SidekiqZ2 boards:
- adi_hwref: Detect board revision via XADC voltage divider,
  set fit_config accordingly. Detect Rev.A via SPI flash JEDEC ID.
- xadc: Read raw XADC channel voltage
- envversion: Export u-boot version string to environment

Uses standalone Xilinx XADC driver (xadcps.c) with bare-metal
register access. Controlled by CONFIG_CMD_ADI_HWREF Kconfig option.

Also adds CONFIG_SPI_FLASH_LOCK_ADI Kconfig option (used by
spi-nor-core.c in a later commit).

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Add CFG_EXTRA_ENV_SETTINGS for both boards with:
- QSPI boot flow (qspiboot, qspiboot_verbose, ramboot_verbose)
- AD936x device tree patching (adi_loadvals, adi_loadvals_pluto)
- DFU firmware update support (RAM and SPI flash)
- Silent console via CONFIG_SILENT_CONSOLE
- Environment version tracking for upgrade compatibility
- Reset cause handling via SLCR registers

PlutoSDR header shared by Pluto and M2K (differ only in USB PID).
SidekiqZ2 has separate header with GPIO 48 DFU button, different
adi_loadvals (no RevC-specific logic), and maxcpus=2.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Based on xilinx_zynq_virt_defconfig with board-specific settings:
- QSPI-only (no MMC/NET/I2C), USB DFU, SPL+FIT, LED GPIO
- SPI flash multi-vendor (ISSI, Macronix, Spansion, STMicro, Winbond)
- CONFIG_CMD_ADI_HWREF, CONFIG_SPI_FLASH_LOCK_ADI
- CONFIG_MISC_INIT_R for factory reset and env version check
- CONFIG_SILENT_CONSOLE, CONFIG_NULLDEV_SERIAL
- CONFIG_BOOTCOMMAND="run $modeboot"
- CONFIG_ZYNQ_SERIAL, CONFIG_ARM_DCC
- FIT_SIGNATURE disabled (existing FIT images use @ in node names)
- TOOLS_MKEFICAPSULE disabled (requires gnutls, not needed)

Differences between targets:
  Pluto:     USB 0x0456:0xb674, zynq_pluto_sdr config
  M2K:       USB 0x0456:0xb675, zynq_pluto_sdr config, M2k prompt
  SidekiqZ2: USB 0x2fa2:0x5a32, zynq_zc70x_sidekiqz2 config

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
When CONFIG_CMD_ADI_HWREF is enabled:
- misc_init_r: Factory reset via GPIO 14 button press, with
  automatic env save. Environment version check resets env to
  defaults when env_version mismatches (firmware upgrade path).
- env_get_location: Always return SPI flash for ADI boards,
  regardless of boot mode register (Pluto/M2K/SidekiqZ2 have
  no MMC, avoids "Bad device specification mmc 0" errors).

All changes guarded by #ifdef CONFIG_CMD_ADI_HWREF to avoid
affecting other Zynq boards.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Port flash protection from old u-boot-xlnx commit d944d98b52ef.

When CONFIG_SPI_FLASH_LOCK_ADI is enabled:
- Intercept sf protect lock/unlock with ofs=0 len=1MB in
  stm_lock/stm_unlock and write SR directly with BP2|BP0|TB
  (0x34) for lock, clear all BP/TB bits for unlock
- Skip micron_flash_lock assignment so stm_lock is used
  (micron_flash_lock does not handle bottom protection)

This preserves full backward compatibility with old env scripts
that use "sf protect lock 0 100000" / "sf protect unlock 0 100000".

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Compressed bitstreams are smaller than the FPGA device size,
causing fpga_is_partial_data() to misidentify them as partial.
This skips zynq_slcr_devcfg_enable() (PS-PL bridge enable),
leaving the AXI bridges disabled and causing Linux to hang
when probing PL peripherals.

Always return 0 (full) so ps7_post_config runs after FPGA
programming from FIT images.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Old PlutoSDR/M2K/SidekiqZ2 firmware uses 'set' in saved environment
scripts. Modern u-boot removed the 'set' command alias. Re-add it
when CONFIG_CMD_ADI_HWREF is enabled to ensure old saved environments
work after firmware upgrade.

'setenv' continues to work in both old and new u-boot, so downgrade
compatibility is not affected.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Add device tree, defconfig, and config header for the Analog Devices
ADALM2000 (M2K) board. The M2K defconfig previously referenced the
Pluto SDR device tree and config header incorrectly.

- Add zynq-m2k.dts based on the original from u-boot-xlnx
- Add zynq_m2k.h config header with M2K-specific boot environment
- Update zynq_m2k_defconfig to reference M2K device tree and config
- Add zynq-m2k.dtb to the DTS Makefile

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich mhennerich force-pushed the adi-xlnx-u-boot-2025.1-y-pluto-m2k branch from 074db17 to f0fc756 Compare March 31, 2026 13:23
@pamolloy pamolloy requested a review from ozan956 March 31, 2026 13:36
Port board support from adi-xlnx-u-boot-2018.2.y, modernized for
u-boot 2025:

  - ADRV9361-Z7035: Zynq with Ethernet, SD, QSPI, USB
  - ADRV9364-Z7020: Zynq with Ethernet, SD, QSPI, USB
  - Cora Z7 (Digilent): Zynq with Ethernet, SD, USB
  - ADRV9009-ZU11EG with ADRV2CRR-FMC: ZynqMP with GbE, SD, QSPI,
    USB 3.0, SATA, DisplayPort, I2C muxes

Key changes from the 2018 originals:
  - Modernized defconfigs: DM-based I2C/SPI/GPIO, proper SPL config,
    FIT loading, CONFIG_TEXT_BASE, removed obsolete Kconfig symbols
  - DTS: SPDX headers, jedec,spi-nor flash compatible
  - ZU11EG DTS: removed FPGA AXI bus (JESD204, DMA, ADRV9009 cores)
    and SPI device config that reference Xilinx vendor clock labels
    not present in upstream zynqmp.dtsi (Linux-only, not needed for
    boot)
  - Simplified config headers with proper boot environments
  - Add Pluto/M2K defconfigs to CI workflow

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich mhennerich force-pushed the adi-xlnx-u-boot-2025.1-y-pluto-m2k branch from 47eb6e1 to 3f85611 Compare April 1, 2026 08:22
Port from analogdevicesinc/u-boot-xlnx jupiter-sdr branch, adapted
for upstream u-boot 2025:

  - Jupiter SDR: ZynqMP with GbE, SD, QSPI (dual parallel), USB 3.0,
    SATA, DisplayPort, I2C (LTC2945, EEPROM with MAC, USB-PD)
  - Kria KV260: uses upstream smk-k26-revA base with SD enabled

Jupiter DTS changes from the original:
  - Removed DP sound nodes (not in upstream zynqmp.dtsi)
  - Added QSPI dual parallel flash support (from c008efb94841)
  - Disabled random ethaddr (MAC read from EEPROM)

Defconfigs based on xilinx_zynqmp_virt_defconfig with board-specific
default device trees.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
CoraZ7:
  - Add SPL_MMC for SD card boot (board has no QSPI)
  - Remove CMD_SF (no SPI flash on board)
  - Add PHY_REALTEK for RTL8211E Ethernet PHY

ADRV9361/ADRV9364:
  - Add NULLDEV_SERIAL for consistency with Pluto/M2K

ADRV9009-ZU11EG:
  - Add DFU_SF for firmware updates via SPI flash

Jupiter/KV260:
  - Switch from OF_BOARD/OF_LIST to OF_EMBED for dedicated board
    defconfigs, fixing binman failure caused by custom DTs not being
    in the inherited virt OF_LIST

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich mhennerich force-pushed the adi-xlnx-u-boot-2025.1-y-pluto-m2k branch from 622940a to d9cf0d3 Compare April 1, 2026 09:22
@pamolloy pamolloy mentioned this pull request Apr 2, 2026
5 tasks
Two unrelated boot failures on the ADRV9009-ZU11EG/ADRV2CRR-FMC:

1) Synchronous external abort early in U-Boot relocation, around the top
   of the low DDR bank. The PS-config reserves the top 1 MiB of the low
   bank (xparameters: XPAR_PSU_DDR_0_S_AXI_HIGHADDR=0x7FEFFFFF), so the
   FSBL's XFsbl_DdrEccInit() only scrubs 0x00000000-0x7FEFFFFF. With
   ECC enabled, a cache-line fill that crosses into the unscrubbed
   0x7FF00000-0x7FFFFFFF range returns an uncorrectable ECC error that
   the interconnect reports as a sync external abort.

   Shrink the low DDR bank in the DT to match what the FSBL actually
   initializes. High bank (0x8_00000000) remains full 2 GiB.

2) "CPU: UNKNOWN" and GEM/reset probes silently missing, because the
   defconfig was missing the ZynqMP SoC, power-domain and reset
   drivers. Add them.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
env_get_location() for ZYNQ_BM_SD only returned ENVL_FAT / ENVL_EXT4,
falling through to ENVL_NOWHERE for boards that store env in SPI flash
but boot from SD. The ADI Zynq boards (ADRV9361/9364, ...) hit this:
saveenv reported "Saving Environment to nowhere... not possible".

Prefer ENV_IS_IN_SPI_FLASH as a fallback in the SD case when no
filesystem-based env is configured.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
- DISTRO_DEFAULTS=y brings in 'load', filesystem helpers and the
  distro_bootcmd plumbing that the default bootcmd references.
- CMD_MII=y so the MDIO bus can be inspected interactively.
- Drop CMD_ADI_HWREF and the matching MISC_INIT_R hook. These were
  copy-pasted from the PlutoSDR/M2K/SidekiqZ2 defconfigs; they enable
  the xadc / adi_hwref / envversion commands and wire up misc_init_r()
  which assumes Pluto's env schema (env_version=="2") and factory-reset
  button on GPIO14. On ADRV9361/9364 the env_version check kept wiping
  the environment on every boot.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The on-module Marvell PHY on the Z7035/Z7020 SoMs sits at MDIO
address 0, not 7. The previous DTS referenced addr 7 which caused
"Could not get PHY for eth0: addr 7" on every dhcp attempt.

Update the phy node accordingly and add the marvell,reg-init
sequence that matches the Linux -userspace variant for this SoM.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The host tool mkeficapsule pulls in gnutls headers, which aren't
available on a default Ubuntu host without libgnutls28-dev. Every
other ADI defconfig already disables it; align these two that were
added in the same series.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Three small DT fixes so gem3 comes up properly in U-Boot:

- eeprom@50: add "atmel,24c16a" alongside "atmel,24c16". U-Boot's
  drivers/misc/i2c_eeprom.c match table only knows the "a" suffix; the
  Linux at24 driver accepts either. Without this the i2c_eeprom driver
  doesn't bind, the nvmem cell walk fails and gem3 gets no MAC despite
  the on-board EEPROM being programmed at offset 0xB.
- Add #address-cells/#size-cells on the gem3 MDIO bus so phy@f:reg
  validates cleanly (fixes the dtc "invalid length (4 bytes)" warning
  inherited from the axi default 2/1).
- Set adi,rx/tx-internal-delay-ps = <2000> on the ADIN1300 PHY so the
  U-Boot adin driver stops defaulting the internal delays to 0.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich mhennerich merged commit e532e1f into adi-xlnx-u-boot-2025.1-y Apr 21, 2026
9 checks passed
@mhennerich mhennerich deleted the adi-xlnx-u-boot-2025.1-y-pluto-m2k branch April 21, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants