0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-10-31 11:35:51 +00:00
Files
openwrt/target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-make-compatible-with-EN7523-SoC.patch
Mikhail Kshevetskiy a626b7e74d airoha: spi: use airoha snfi driver for EN7523
There are two spi drivers for en7523/an7581/an7583:
 * en7581-snand (spi-airoha-snfi.c)
 * en7523-spi (spi-en7523.c)
The first one supports DMA, but until recently it has several nasty
issues. The second do things properly but does not support DMA.
Recently the first driver was greatly improved, so there is no sence
keep both drivers anymore.

This patch removes en7523-spi driver and use DMA capable driver instead.
Unfortunately there is a nasty en7523 specific issue.

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
to booting in RESERVED boot mode. It was found that some flashes operates
incorrectly in RESERVED mode if DMA used.

This patch also adds a hack that turns off DMA and prints big fat warning
if booting in reserved mode was detected. This slow down flash operations
but does not kill your data.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/20365
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-10-10 10:30:10 +02:00

28 lines
932 B
Diff

From 12664d09a94bd0f50f31a3811447f70275ea9bb8 Mon Sep 17 00:00:00 2001
From: Mikhail Kshevetskiy <mikhail.kshevetskiy@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@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 */ }
};