]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
spi: cadence-xspi: Add COMPILE_TEST support
authorRosen Penev <rosenp@gmail.com>
Tue, 19 May 2026 00:56:14 +0000 (17:56 -0700)
committerMark Brown <broonie@kernel.org>
Wed, 20 May 2026 14:20:27 +0000 (15:20 +0100)
The Cadence XSPI driver uses readq() and writeq(), which are not provided
directly by all 32-bit architectures. Include the generic non-atomic 64-bit
I/O accessor fallback for non-64-bit builds so the driver can build there.

Drop the 64BIT dependency at the same time. The driver only needs MMIO
and the SPI memory interface at build time, and the fallback accessors
cover the 32-bit compile-test case.

Assisted-by: Codex:GPT-5.5
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://patch.msgid.link/20260519005614.628437-1-rosenp@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/Kconfig
drivers/spi/spi-cadence-xspi.c

index 8782514bb89b0f295ab4340978aedd50b305b14b..957c3e065b839461126cf27619d689d66e4e6452 100644 (file)
@@ -321,7 +321,8 @@ config SPI_CADENCE_QUADSPI
 
 config SPI_CADENCE_XSPI
        tristate "Cadence XSPI controller"
-       depends on OF && HAS_IOMEM && 64BIT
+       depends on HAS_IOMEM || COMPILE_TEST
+       depends on OF
        depends on SPI_MEM
        help
          Enable support for the Cadence XSPI Flash controller.
index 32fa19ebf7a99e67b79c939b995d70dfcbdb674f..c45b29c043bf30b2303272eb62e760b611d06b16 100644 (file)
 #include <linux/bitrev.h>
 #include <linux/util_macros.h>
 
+#ifndef CONFIG_64BIT
+#include <linux/io-64-nonatomic-lo-hi.h>
+#endif
+
 #define CDNS_XSPI_MAGIC_NUM_VALUE      0x6522
 #define CDNS_XSPI_MAX_BANKS            8
 #define CDNS_XSPI_NAME                 "cadence-xspi"