[openwrt/openwrt] kernel: add support for DesignWare SPI MMIO controller

LEDE Commits lede-commits at lists.infradead.org
Mon Jun 9 02:43:58 PDT 2025


noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/82d20a0fbde937365f2ad6b4f9b754971c5c6ab2

commit 82d20a0fbde937365f2ad6b4f9b754971c5c6ab2
Author: Albrecht Lohofener <albrechtloh at gmx.de>
AuthorDate: Sun Jun 8 09:23:42 2025 +0200

    kernel: add support for DesignWare SPI MMIO controller
    
    Add kernel packages for DesignWare SPI core and MMIO controllers.
    This is needed for the RP1 SoC found on RPi 5 devices.
    
    Tested with a Microchip ENC28J60 Ethernet controller on a RPi 5.
    
    Signed-off-by: Albrecht Lohofener <albrechtloh at gmx.de>
    Link: https://github.com/openwrt/openwrt/pull/19049
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 package/kernel/linux/modules/spi.mk | 38 +++++++++++++++++++++++++++++++++++++
 target/linux/generic/config-6.12    |  5 +++++
 target/linux/generic/config-6.6     |  5 +++++
 3 files changed, 48 insertions(+)

diff --git a/package/kernel/linux/modules/spi.mk b/package/kernel/linux/modules/spi.mk
index 78a1c8a032..5e8ab03b18 100644
--- a/package/kernel/linux/modules/spi.mk
+++ b/package/kernel/linux/modules/spi.mk
@@ -73,3 +73,41 @@ define KernelPackage/spi-dev/description
 endef
 
 $(eval $(call KernelPackage,spi-dev))
+
+
+define KernelPackage/spi-dw
+  SUBMENU:=$(SPI_MENU)
+  TITLE:=DesignWare SPI controller driver (core)
+  KCONFIG:=\
+    CONFIG_SPI=y \
+    CONFIG_SPI_DESIGNWARE \
+    CONFIG_SPI_DYNAMIC=y \
+    CONFIG_SPI_MASTER=y
+  FILES:=\
+    $(LINUX_DIR)/drivers/spi/spi-dw.ko
+  AUTOLOAD:=$(call AutoProbe,spi-dw)
+endef
+
+define KernelPackage/spi-dw/description
+ This package contains the DesignWare SPI core driver.
+endef
+
+$(eval $(call KernelPackage,spi-dw))
+
+
+define KernelPackage/spi-dw-mmio
+  SUBMENU:=$(SPI_MENU)
+  TITLE:=DesignWare SPI controller driver (MMIO)
+  DEPENDS:=+kmod-spi-dw
+  KCONFIG:=\
+    CONFIG_SPI_DW_MMIO
+  FILES:=\
+    $(LINUX_DIR)/drivers/spi/spi-dw-mmio.ko
+  AUTOLOAD:=$(call AutoProbe,spi-dw-mmio)
+endef
+
+define KernelPackage/spi-dw-mmio/description
+ This package contains the DesignWare SPI MMIO driver.
+endef
+
+$(eval $(call KernelPackage,spi-dw-mmio))
diff --git a/target/linux/generic/config-6.12 b/target/linux/generic/config-6.12
index 594c016528..cb6faac20c 100644
--- a/target/linux/generic/config-6.12
+++ b/target/linux/generic/config-6.12
@@ -6329,6 +6329,11 @@ CONFIG_SND_X86=y
 # CONFIG_SPI_CH341 is not set
 # CONFIG_SPI_DEBUG is not set
 # CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_DW_BT1 is not set
+# CONFIG_SPI_DW_BT1_DIRMAP is not set
+# CONFIG_SPI_DW_DMA is not set
+# CONFIG_SPI_DW_MMIO is not set
+# CONFIG_SPI_DW_PCI is not set
 # CONFIG_SPI_FSL_DSPI is not set
 # CONFIG_SPI_FSL_ESPI is not set
 # CONFIG_SPI_FSL_SPI is not set
diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6
index 6bb3dcf1e6..fa9ab09cf3 100644
--- a/target/linux/generic/config-6.6
+++ b/target/linux/generic/config-6.6
@@ -6217,6 +6217,11 @@ CONFIG_SND_X86=y
 # CONFIG_SPI_CADENCE_XSPI is not set
 # CONFIG_SPI_DEBUG is not set
 # CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_DW_BT1 is not set
+# CONFIG_SPI_DW_BT1_DIRMAP is not set
+# CONFIG_SPI_DW_DMA is not set
+# CONFIG_SPI_DW_MMIO is not set
+# CONFIG_SPI_DW_PCI is not set
 # CONFIG_SPI_FSL_DSPI is not set
 # CONFIG_SPI_FSL_ESPI is not set
 # CONFIG_SPI_FSL_SPI is not set




More information about the lede-commits mailing list