[openwrt/openwrt] airoha: spi: update en7523 airoha snfi patches & dts
LEDE Commits
lede-commits at lists.infradead.org
Thu Nov 20 14:08:45 PST 2025
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/6e3867e5b154caac8227faa154c708e0ace41c93
commit 6e3867e5b154caac8227faa154c708e0ace41c93
Author: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
AuthorDate: Sun Oct 12 15:00:13 2025 +0300
airoha: spi: update en7523 airoha snfi patches & dts
Use latest patch version
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20400
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
target/linux/airoha/dts/en7523.dtsi | 4 +-
...ha-snfi-en7523-workaround-flash-damaging.patch} | 54 +++++++++++-----------
...roha-snfi-make-compatible-with-EN7523-SoC.patch | 27 -----------
3 files changed, 29 insertions(+), 56 deletions(-)
diff --git a/target/linux/airoha/dts/en7523.dtsi b/target/linux/airoha/dts/en7523.dtsi
index c58cc7f467..98c902f6f9 100644
--- a/target/linux/airoha/dts/en7523.dtsi
+++ b/target/linux/airoha/dts/en7523.dtsi
@@ -204,8 +204,8 @@
};
};
- spi_ctrl: spi_controller at 1fa10000 {
- compatible = "airoha,en7523-snand";
+ spi_ctrl: spi at 1fa10000 {
+ compatible = "airoha,en7523-snand", "airoha,en7581-snand";
reg = <0x1fa10000 0x140>,
<0x1fa11000 0x160>;
diff --git a/target/linux/airoha/patches-6.12/029-15-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch b/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
similarity index 64%
rename from target/linux/airoha/patches-6.12/029-15-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
rename to target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
index 0b8fc4c0b0..c40645b002 100644
--- a/target/linux/airoha/patches-6.12/029-15-spi-airoha-snfi-en7523-workaround-flash-damaging-if-.patch
+++ b/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch
@@ -1,8 +1,8 @@
-From 0299de52cbb2274345e12518298a8014adb56411 Mon Sep 17 00:00:00 2001
+From 86f88e604305186aec1fb6eebbf8f0a42c2435d3 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
Date: Thu, 9 Oct 2025 19:33:23 +0300
-Subject: [PATCH 2/2] spi: airoha-snfi: en7523: workaround flash damaging if
- UART_TXD was short to GND
+Subject: [PATCH] spi: airoha-snfi: en7523: workaround flash damaging
+ if UART_TXD was short to GND
We found that some serial console may pull TX line to GROUND during board
boot time. Airoha uses TX line as one of it's BOOT pins. This will lead
@@ -27,8 +27,8 @@ fat warning.
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
---
- drivers/spi/spi-airoha-snfi.c | 38 ++++++++++++++++++++++++++++++++---
- 1 file changed, 35 insertions(+), 3 deletions(-)
+ drivers/spi/spi-airoha-snfi.c | 40 ++++++++++++++++++++++++++++++-----
+ 1 file changed, 35 insertions(+), 5 deletions(-)
--- a/drivers/spi/spi-airoha-snfi.c
+++ b/drivers/spi/spi-airoha-snfi.c
@@ -44,49 +44,49 @@ Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
static int airoha_snand_setup(struct spi_device *spi)
{
struct airoha_snand_ctrl *as_ctrl;
-@@ -1059,7 +1064,10 @@ static int airoha_snand_probe(struct pla
+@@ -1058,7 +1063,8 @@ static int airoha_snand_probe(struct pla
struct device *dev = &pdev->dev;
struct spi_controller *ctrl;
void __iomem *base;
- int err;
+ int err, dma_enabled;
-+#if defined(CONFIG_ARM)
+ u32 sfc_strap;
-+#endif
ctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));
if (!ctrl)
-@@ -1093,12 +1101,36 @@ static int airoha_snand_probe(struct pla
+@@ -1092,12 +1098,36 @@ static int airoha_snand_probe(struct pla
return dev_err_probe(dev, PTR_ERR(as_ctrl->spi_clk),
"unable to get spi clk\n");
- err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
+- if (err)
+- return err;
+ dma_enabled = 1;
-+#if defined(CONFIG_ARM)
-+ err = regmap_read(as_ctrl->regmap_ctrl,
-+ REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
- if (err)
- return err;
-
-+ if (!(sfc_strap & 0x04)) {
-+ dma_enabled = 0;
-+ printk(KERN_WARNING "\n"
-+ "=== WARNING ======================================================\n"
-+ "Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
-+ "This mode is known for incorrect DMA reading of some flashes.\n"
-+ "Usage of DMA for flash operations will be disabled to prevent data\n"
-+ "damage. Unplug your serial console and power cycle the board\n"
-+ "to boot with full performance.\n"
-+ "==================================================================\n\n");
++ if (device_is_compatible(dev, "airoha,en7523-snand")) {
++ err = regmap_read(as_ctrl->regmap_ctrl,
++ REG_SPI_CTRL_SFC_STRAP, &sfc_strap);
++ if (err)
++ return err;
++
++ if (!(sfc_strap & 0x04)) {
++ dma_enabled = 0;
++ printk(KERN_WARNING "\n"
++ "=== WARNING ======================================================\n"
++ "Detected booting in RESERVED mode (UART_TXD was short to GND).\n"
++ "This mode is known for incorrect DMA reading of some flashes.\n"
++ "Usage of DMA for flash operations will be disabled to prevent data\n"
++ "damage. Unplug your serial console and power cycle the board\n"
++ "to boot with full performance.\n"
++ "==================================================================\n\n");
++ }
+ }
-+#endif
+
+ if (dma_enabled) {
+ err = dma_set_mask(as_ctrl->dev, DMA_BIT_MASK(32));
+ if (err)
+ return err;
+ }
-+
+
ctrl->num_chipselect = 2;
- ctrl->mem_ops = &airoha_snand_mem_ops;
+ ctrl->mem_ops = dma_enabled ?
diff --git a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-make-compatible-with-EN7523-SoC.patch b/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-make-compatible-with-EN7523-SoC.patch
deleted file mode 100644
index 5e0c59ef67..0000000000
--- a/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-make-compatible-with-EN7523-SoC.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 12664d09a94bd0f50f31a3811447f70275ea9bb8 Mon Sep 17 00:00:00 2001
-From: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
-Date: Thu, 9 Oct 2025 19:49:18 +0300
-Subject: [PATCH 1/2] spi: airoha-snfi: make compatible with EN7523 SoC
-
-The driver is fully compatible with EN7523 based SoCs, so add
-corresponding compatible string.
-
-This driver is better than en7523-spi because it supports DMA.
-Measurements shows that DMA based flash reading is 4 times faster
-than non-dma one.
-
-Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy at iopsys.eu>
----
- drivers/spi/spi-airoha-snfi.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/spi/spi-airoha-snfi.c
-+++ b/drivers/spi/spi-airoha-snfi.c
-@@ -1047,6 +1047,7 @@ static const struct regmap_config spi_nf
- };
-
- static const struct of_device_id airoha_snand_ids[] = {
-+ { .compatible = "airoha,en7523-snand" },
- { .compatible = "airoha,en7581-snand" },
- { /* sentinel */ }
- };
More information about the lede-commits
mailing list