Skip to content

Commit d819a05

Browse files
mkshevetskiyrobimarko
authored andcommitted
airoha: spi: update airoha-snfi patches and en7523 dts
Changes: * use upstream patches for airoha-snfi driver * update in kernel en7523 dts to add spinand support Signed-off-by: Mikhail Kshevetskiy <[email protected]> Link: openwrt/openwrt#21299 Signed-off-by: Robert Marko <[email protected]> (cherry picked from commit d9b1c74)
1 parent ffd0e5c commit d819a05

12 files changed

+198
-135
lines changed

target/linux/airoha/patches-6.12/029-02-spi-airoha-remove-unnecessary-restriction-length.patch renamed to target/linux/airoha/patches-6.12/029-05-v6.19-spi-airoha-remove-unnecessary-restriction-length.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
From 4658f57ba7f60c3bd8e14c1ca7acf2090aee8436 Mon Sep 17 00:00:00 2001
1+
From 661856ca131c8bf6724905966e02149805660abe Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Tue, 12 Aug 2025 06:21:35 +0300
4-
Subject: [PATCH v6 02/13] spi: airoha: remove unnecessary restriction length
3+
Date: Sun, 12 Oct 2025 15:16:53 +0300
4+
Subject: [PATCH 05/14] spi: airoha: remove unnecessary restriction length
55

66
The "length < 160" restriction is not needed because airoha_snand_write_data()
77
and airoha_snand_read_data() will properly handle data transfers above
88
SPI_MAX_TRANSFER_SIZE.
99

1010
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
1111
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
12+
Link: https://patch.msgid.link/[email protected]
13+
Signed-off-by: Mark Brown <[email protected]>
1214
---
1315
drivers/spi/spi-airoha-snfi.c | 7 -------
1416
1 file changed, 7 deletions(-)

target/linux/airoha/patches-6.12/029-04-spi-airoha-remove-unnecessary-switch-to-non-dma-m.patch renamed to target/linux/airoha/patches-6.12/029-06-v6.19-spi-airoha-remove-unnecessary-switch-to-non-dma-mode.patch

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
From fb41a3e3bc357592b28a8abb504df99dad642588 Mon Sep 17 00:00:00 2001
1+
From 7350f8dc15bfbb7abf1ce4babea6fcace1c574c5 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Mon, 11 Aug 2025 13:09:51 +0300
4-
Subject: [PATCH v6 04/13] spi: airoha: remove unnecessary switch to non-dma
5-
mode
3+
Date: Sun, 12 Oct 2025 15:16:55 +0300
4+
Subject: [PATCH 06/14] spi: airoha: remove unnecessary switch to non-dma mode
65

76
The code switches to dma at the start of dirmap operation and returns
87
to non-dma at the end of dirmap operation, so an additional switch to
@@ -11,6 +10,8 @@ non-dma at the start of dirmap write is not required.
1110
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
1211
Acked-by: Lorenzo Bianconi <[email protected]>
1312
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
13+
Link: https://patch.msgid.link/[email protected]
14+
Signed-off-by: Mark Brown <[email protected]>
1415
---
1516
drivers/spi/spi-airoha-snfi.c | 3 ---
1617
1 file changed, 3 deletions(-)

target/linux/airoha/patches-6.12/029-07-spi-airoha-unify-dirmap-read-write-code.patch renamed to target/linux/airoha/patches-6.12/029-07-v6.19-spi-airoha-unify-dirmap-read-write-code.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
From 995b1a65206ee28d5403db0518cb230f2ce429ef Mon Sep 17 00:00:00 2001
1+
From 233a22687411ea053a4b169c07324ee6aa33bf38 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Mon, 11 Aug 2025 19:57:43 +0300
4-
Subject: [PATCH v6 07/13] spi: airoha: unify dirmap read/write code
3+
Date: Sun, 12 Oct 2025 15:16:58 +0300
4+
Subject: [PATCH 07/14] spi: airoha: unify dirmap read/write code
55

66
Makes dirmap writing looks similar to dirmap reading. Just a minor
77
refactoring, no behavior change is expected.
88

99
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
10+
Link: https://patch.msgid.link/[email protected]
11+
Signed-off-by: Mark Brown <[email protected]>
1012
---
1113
drivers/spi/spi-airoha-snfi.c | 50 ++++++++++++++++++++++-------------
1214
1 file changed, 32 insertions(+), 18 deletions(-)

target/linux/airoha/patches-6.12/029-08-spi-airoha-support-of-dualio-quadio-flash-reading.patch renamed to target/linux/airoha/patches-6.12/029-08-v6.19-spi-airoha-support-of-dualio-quadio-flash-reading-co.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From baaba9b8d3d907575323cbb7fabeae23db2a542b Mon Sep 17 00:00:00 2001
1+
From 80b09137aeab27e59004383058f8cc696a9ee048 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Mon, 11 Aug 2025 20:52:34 +0300
4-
Subject: [PATCH v6 08/13] spi: airoha: support of dualio/quadio flash reading
3+
Date: Sun, 12 Oct 2025 15:16:59 +0300
4+
Subject: [PATCH 08/14] spi: airoha: support of dualio/quadio flash reading
55
commands
66

77
Airoha snfi spi controller supports acceleration of DUAL/QUAD
@@ -12,6 +12,8 @@ DUAL_IO/QUAD_IO one.
1212

1313
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
1414
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
15+
Link: https://patch.msgid.link/[email protected]
16+
Signed-off-by: Mark Brown <[email protected]>
1517
---
1618
drivers/spi/spi-airoha-snfi.c | 28 ++++++++++++++++++++++------
1719
1 file changed, 22 insertions(+), 6 deletions(-)

target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch renamed to target/linux/airoha/patches-6.12/029-09-v6.19-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG_SP.patch

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
From 4abbbc74306598159fe1dc545f929ae594bf4dd1 Mon Sep 17 00:00:00 2001
1+
From 70eec454f2d6cdfab547c262781acd38328e11a1 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Thu, 14 Aug 2025 18:00:32 +0300
4-
Subject: [PATCH v6 10/13] spi: airoha: avoid setting of page/oob sizes in
3+
Date: Sun, 12 Oct 2025 15:17:00 +0300
4+
Subject: [PATCH 09/14] spi: airoha: avoid setting of page/oob sizes in
55
REG_SPI_NFI_PAGEFMT
66

77
spi-airoha-snfi uses custom sector size in REG_SPI_NFI_SECCUS_SIZE
88
register, so setting of page/oob sizes in REG_SPI_NFI_PAGEFMT is not
99
required.
1010

1111
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
12+
Link: https://patch.msgid.link/[email protected]
13+
Signed-off-by: Mark Brown <[email protected]>
1214
---
1315
drivers/spi/spi-airoha-snfi.c | 38 -----------------------------------
1416
1 file changed, 38 deletions(-)

target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch renamed to target/linux/airoha/patches-6.12/029-10-v6.19-spi-airoha-reduce-the-number-of-modification-of-REG_.patch

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 0d8f58869192df0acdba286d233b57a4feeaf94b Mon Sep 17 00:00:00 2001
1+
From d1ff30df1d9a4eb4c067795abb5e2a66910fd108 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Thu, 14 Aug 2025 18:49:34 +0300
4-
Subject: [PATCH v6 11/13] spi: airoha: reduce the number of modification of
3+
Date: Sun, 12 Oct 2025 15:17:01 +0300
4+
Subject: [PATCH 10/14] spi: airoha: reduce the number of modification of
55
REG_SPI_NFI_CNFG and REG_SPI_NFI_SECCUS_SIZE registers
66

77
This just reduce the number of modification of REG_SPI_NFI_CNFG and
@@ -12,6 +12,8 @@ from SNFI registers during driver startup.
1212

1313
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
1414
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
15+
Link: https://patch.msgid.link/[email protected]
16+
Signed-off-by: Mark Brown <[email protected]>
1517
---
1618
drivers/spi/spi-airoha-snfi.c | 135 +++++++++++++++++++++++++---------
1719
1 file changed, 102 insertions(+), 33 deletions(-)
@@ -103,7 +105,7 @@ Reviewed-by: AngeloGioacchino Del Regno <[email protected]
103105
err = regmap_write(as_ctrl->regmap_nfi, REG_SPI_NFI_CMD, 0x0);
104106
if (err)
105107
goto error_dma_unmap;
106-
@@ -819,7 +855,48 @@ static ssize_t airoha_snand_dirmap_write
108+
@@ -815,7 +851,48 @@ static ssize_t airoha_snand_dirmap_write
107109
if (err < 0)
108110
return err;
109111

@@ -153,7 +155,7 @@ Reviewed-by: AngeloGioacchino Del Regno <[email protected]
153155
if (err)
154156
goto error_dma_mode_off;
155157

156-
@@ -835,8 +912,16 @@ static ssize_t airoha_snand_dirmap_write
158+
@@ -831,8 +908,16 @@ static ssize_t airoha_snand_dirmap_write
157159
if (err)
158160
goto error_dma_unmap;
159161

@@ -172,7 +174,7 @@ Reviewed-by: AngeloGioacchino Del Regno <[email protected]
172174
err = regmap_update_bits(as_ctrl->regmap_nfi,
173175
REG_SPI_NFI_SNF_MISC_CTL2,
174176
SPI_NFI_PROG_LOAD_BYTE_NUM, val);
175-
@@ -861,22 +946,6 @@ static ssize_t airoha_snand_dirmap_write
177+
@@ -857,22 +942,6 @@ static ssize_t airoha_snand_dirmap_write
176178
if (err)
177179
goto error_dma_unmap;
178180

target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch renamed to target/linux/airoha/patches-6.12/029-11-v6.19-spi-airoha-set-custom-sector-size-equal-to-flash-pag.patch

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
From 893ee23d650ca9ee36541b9a5ae0bc18be01a11f Mon Sep 17 00:00:00 2001
1+
From fb81b5cecb8553e3ca2b45288cf340d43c9c2991 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Thu, 14 Aug 2025 22:47:17 +0300
4-
Subject: [PATCH v6 12/13] spi: airoha: set custom sector size equal to flash
5-
page size
3+
Date: Sun, 12 Oct 2025 15:17:02 +0300
4+
Subject: [PATCH 11/14] spi: airoha: set custom sector size equal to flash page
5+
size
66

77
Set custom sector size equal to flash page size including oob. Thus we
88
will always read a single sector. The maximum custom sector size is
@@ -13,6 +13,8 @@ from SNFI registers during driver startup.
1313

1414
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
1515
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
16+
Link: https://patch.msgid.link/[email protected]
17+
Signed-off-by: Mark Brown <[email protected]>
1618
---
1719
drivers/spi/spi-airoha-snfi.c | 35 +++++++++++++++++++----------------
1820
1 file changed, 19 insertions(+), 16 deletions(-)
@@ -102,7 +104,7 @@ Reviewed-by: AngeloGioacchino Del Regno <[email protected]
102104
opcode = desc->info.op_tmpl.cmd.opcode;
103105
switch (opcode) {
104106
case SPI_NAND_OP_PROGRAM_LOAD_SINGLE:
105-
@@ -884,18 +889,17 @@ static ssize_t airoha_snand_dirmap_write
107+
@@ -880,18 +885,17 @@ static ssize_t airoha_snand_dirmap_write
106108
goto error_dma_mode_off;
107109

108110
/* Set number of sector will be written */
@@ -124,7 +126,7 @@ Reviewed-by: AngeloGioacchino Del Regno <[email protected]
124126
SPI_NFI_CUS_SEC_SIZE_EN);
125127
if (err)
126128
goto error_dma_mode_off;
127-
@@ -920,11 +924,10 @@ static ssize_t airoha_snand_dirmap_write
129+
@@ -916,11 +920,10 @@ static ssize_t airoha_snand_dirmap_write
128130
* = NFI_SNF_MISC_CTL2.write_data_byte_number =
129131
* = NFI_CON.sector_number * NFI_SECCUS.custom_sector_size
130132
*/

target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch renamed to target/linux/airoha/patches-6.12/029-12-v6.19-spi-airoha-avoid-reading-flash-page-settings-from-SN.patch

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 64a4d6e84145227211485067022cd4e5cf052e04 Mon Sep 17 00:00:00 2001
1+
From 902c0ea18a97b1a6eeee5799cb1fd9a79ef9208e Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Thu, 14 Aug 2025 23:56:24 +0300
4-
Subject: [PATCH v6 13/13] spi: airoha: avoid reading flash page settings from
3+
Date: Sun, 12 Oct 2025 15:17:03 +0300
4+
Subject: [PATCH 12/14] spi: airoha: avoid reading flash page settings from
55
SNFI registers during driver startup
66

77
The spinand driver do 3 type of dirmap requests:
@@ -25,6 +25,8 @@ SNFI registers during driver startup. Also airoha_snand_adjust_op_size()
2525
function becomes unnecessary.
2626

2727
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
28+
Link: https://patch.msgid.link/[email protected]
29+
Signed-off-by: Mark Brown <[email protected]>
2830
---
2931
drivers/spi/spi-airoha-snfi.c | 115 ++--------------------------------
3032
1 file changed, 5 insertions(+), 110 deletions(-)
@@ -148,15 +150,15 @@ Signed-off-by: Mikhail Kshevetskiy <[email protected]>
148150

149151
opcode = desc->info.op_tmpl.cmd.opcode;
150152
switch (opcode) {
151-
@@ -1080,7 +1006,6 @@ static int airoha_snand_exec_op(struct s
153+
@@ -1076,7 +1002,6 @@ static int airoha_snand_exec_op(struct s
152154
}
153155

154156
static const struct spi_controller_mem_ops airoha_snand_mem_ops = {
155157
- .adjust_op_size = airoha_snand_adjust_op_size,
156158
.supports_op = airoha_snand_supports_op,
157159
.exec_op = airoha_snand_exec_op,
158160
.dirmap_create = airoha_snand_dirmap_create,
159-
@@ -1105,36 +1030,6 @@ static int airoha_snand_setup(struct spi
161+
@@ -1101,36 +1026,6 @@ static int airoha_snand_setup(struct spi
160162
return 0;
161163
}
162164

@@ -193,7 +195,7 @@ Signed-off-by: Mikhail Kshevetskiy <[email protected]>
193195
static const struct regmap_config spi_ctrl_regmap_config = {
194196
.name = "ctrl",
195197
.reg_bits = 32,
196-
@@ -1208,7 +1103,7 @@ static int airoha_snand_probe(struct pla
198+
@@ -1204,7 +1099,7 @@ static int airoha_snand_probe(struct pla
197199
ctrl->setup = airoha_snand_setup;
198200
device_set_node(&ctrl->dev, dev_fwnode(dev));
199201

target/linux/airoha/patches-6.12/029-09-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch renamed to target/linux/airoha/patches-6.12/029-13-v6.19-spi-airoha-buffer-must-be-0xff-ed-before-writing.patch

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
From 6ca9cd453cb5d8a6411791295771b4dbd1c623de Mon Sep 17 00:00:00 2001
1+
From 0743acf746a81e0460a56fd5ff847d97fa7eb370 Mon Sep 17 00:00:00 2001
22
From: Mikhail Kshevetskiy <[email protected]>
3-
Date: Mon, 11 Aug 2025 21:18:04 +0300
4-
Subject: [PATCH v6 09/13] spi: airoha: buffer must be 0xff-ed before writing
3+
Date: Sun, 12 Oct 2025 15:17:04 +0300
4+
Subject: [PATCH 13/14] spi: airoha: buffer must be 0xff-ed before writing
55

66
During writing, the entire flash page (including OOB) will be updated
77
with the values from the temporary buffer, so we need to fill the
88
untouched areas of the buffer with 0xff value to prevent accidental
99
data overwriting.
1010

1111
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
12+
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
13+
Link: https://patch.msgid.link/[email protected]
14+
Signed-off-by: Mark Brown <[email protected]>
1215
---
1316
drivers/spi/spi-airoha-snfi.c | 4 ++++
1417
1 file changed, 4 insertions(+)
1518

1619
--- a/drivers/spi/spi-airoha-snfi.c
1720
+++ b/drivers/spi/spi-airoha-snfi.c
18-
@@ -847,7 +847,11 @@ static ssize_t airoha_snand_dirmap_write
21+
@@ -776,7 +776,11 @@ static ssize_t airoha_snand_dirmap_write
1922
return -EOPNOTSUPP;
2023
}
2124

target/linux/airoha/patches-6.12/029-14-spi-airoha-snfi-en7523-workaround-flash-damaging.patch

Lines changed: 0 additions & 97 deletions
This file was deleted.

0 commit comments

Comments
 (0)