[PATCH v2 2/2] spi: sun6i: Add dual read support for the H616
From: Arun Iyengar via B4 Relay
Date: Mon Nov 16 2026 - 00:55:33 EST
From: Arun Iyengar <aiyengar1990@xxxxxxxxx>
The H616 SPI controllers bind through the "allwinner,sun8i-h3-spi"
fallback, which advertises no dual or quad modes, although the H616
manual documents the dual read (DRM, SPI_BCC bit 28) and quad (Quad_EN,
bit 29) controls that the driver already programs for the R329.
Match "allwinner,sun50i-h616-spi" with the H3 clock control and dual
reads. Dual writes and quad mode are left out: untested on the H616.
Tested on an Orange Pi Zero2 (2 MiB Macronix SPI NOR, flash node with
spi-rx-bus-width = <2>): 1-1-2 reads (opcode 0x3b), the whole flash in
0.30 s instead of 0.52 s, repeated reads identical.
Signed-off-by: Arun Iyengar <aiyengar1990@xxxxxxxxx>
---
drivers/spi/spi-sun6i.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index 6b7a05dd0de8..3a77ade87fbe 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -778,6 +778,12 @@ static const struct sun6i_spi_cfg sun8i_h3_spi_cfg = {
.has_clk_ctl = true,
};
+static const struct sun6i_spi_cfg sun50i_h616_spi_cfg = {
+ .fifo_depth = SUN8I_FIFO_DEPTH,
+ .has_clk_ctl = true,
+ .mode_bits = SPI_RX_DUAL,
+};
+
static const struct sun6i_spi_cfg sun50i_r329_spi_cfg = {
.fifo_depth = SUN8I_FIFO_DEPTH,
.mode_bits = SPI_RX_DUAL | SPI_TX_DUAL | SPI_RX_QUAD | SPI_TX_QUAD,
@@ -786,6 +792,7 @@ static const struct sun6i_spi_cfg sun50i_r329_spi_cfg = {
static const struct of_device_id sun6i_spi_match[] = {
{ .compatible = "allwinner,sun6i-a31-spi", .data = &sun6i_a31_spi_cfg },
{ .compatible = "allwinner,sun8i-h3-spi", .data = &sun8i_h3_spi_cfg },
+ { .compatible = "allwinner,sun50i-h616-spi", .data = &sun50i_h616_spi_cfg },
{ .compatible = "allwinner,sun50i-r329-spi", .data = &sun50i_r329_spi_cfg },
/*
* A523's SPI controller has a combined RX buffer + FIFO counter
--
2.55.0