]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: cadence_xspi: enable automatic platform data allocation
authorChen Huei Lok <chen.huei.lok@altera.com>
Mon, 9 Feb 2026 08:10:07 +0000 (16:10 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 15 Apr 2026 19:36:44 +0000 (13:36 -0600)
Enable automatic allocation of platform data for the Cadence XSPI
controller by setting .plat_auto.

Without this, dev_get_plat() may return invalid or uninitialized
platform data when multiple XSPI controllers are present, leading
to incorrect IOBASE/SDMABASE/AUXBASE values and causing SPI flash
probe failures.

Setting .plat_auto ensures each controller instance receives a
properly sized cdns_xspi_plat structure, allowing SF probe to work
correctly.

Tested on an Altera Simics platform with multiple XSPI controllers.

Signed-off-by: Chen Huei Lok <chen.huei.lok@altera.com>
drivers/spi/cadence_xspi.c

index 717f226b709a27ab35afd2934e71d9ceeacb5484..8a894025d0217f20cd5f32130bcff7d03798716a 100644 (file)
@@ -441,6 +441,7 @@ static const struct udevice_id cdns_xspi_of_match[] = {
 U_BOOT_DRIVER(cadence_xspi) = {
        .name = CDNS_XSPI_NAME,
        .id = UCLASS_SPI,
+       .plat_auto = sizeof(struct cdns_xspi_plat),
        .of_match = cdns_xspi_of_match,
        .ops = &cdns_xspi_ops,
        .probe = cdns_xspi_probe,