Skip to contentSkip to conversation

sunxi: SPL SPI: add support for the V3s SoC

PATCH In review Michael Walle 2 participants 4 messages May 13, 2024 – Jul 11, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunxi: SPL SPI: add support for the V3s SoC

The V3s is identical regarding register layout, clocks and resets to the sun6i variants. Therefore, we can just add the MACH_SUN8I_V3S to the sun6i compatible ones.

SPI boot was tested on a custom board with a Gigadevice GD25Q64 8MiB SPI flash.

---
 arch/arm/mach-sunxi/Kconfig         | 2 +-
 arch/arm/mach-sunxi/spl_spi_sunxi.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-sunxi/Kconfig +1 -1
index ddf9414b08e..17666814c52 100644
@@ -1078,7 +1078,7 @@ config SPL_STACK_R_ADDR
 
 config SPL_SPI_SUNXI
 	bool "Support for SPI Flash on Allwinner SoCs in SPL"
-	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || SUN50I_GEN_H6 || MACH_SUNIV || SUNXI_GEN_NCAT2
+	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || MACH_SUN8I_V3S || SUN50I_GEN_H6 || MACH_SUNIV || SUNXI_GEN_NCAT2
 	help
 	  Enable support for SPI Flash. This option allows SPL to read from
 	  sunxi SPI Flash. It uses the same method as the boot ROM, so does
arch/arm/mach-sunxi/spl_spi_sunxi.c +2 -1
index 7acb44f52ae..d7abdc2e401 100644
@@ -140,7 +140,8 @@ static bool is_sun6i_gen_spi(void)
 {
 	return IS_ENABLED(CONFIG_SUNXI_GEN_SUN6I) ||
 	       IS_ENABLED(CONFIG_SUN50I_GEN_H6) ||
-	       IS_ENABLED(CONFIG_SUNXI_GEN_NCAT2);
+	       IS_ENABLED(CONFIG_SUNXI_GEN_NCAT2) ||
+	       IS_ENABLED(CONFIG_MACH_SUN8I_V3S);
 }
 
 static uintptr_t spi0_base_address(void)
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw

On Tue, 14 May 2024 01:43:19 +0200
Michael Walle <[email protected]> wrote:

Hi Michael,

Quoted 3 lines

The V3s is identical regarding register layout, clocks and resets to the sun6i variants. Therefore, we can just add the MACH_SUN8I_V3S to the sun6i compatible ones.

Interesting, I was a bit surprised that this would be all we need, but indeed everything else falls into place, when none of the newer SoCs are used.
Regression-tested on an H616.

Quoted 4 lines

SPI boot was tested on a custom board with a Gigadevice GD25Q64 8MiB SPI flash.

Cheers,
Andre

Quoted 32 lines
---
 arch/arm/mach-sunxi/Kconfig         | 2 +-
 arch/arm/mach-sunxi/spl_spi_sunxi.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-sunxi/Kconfig +1 -1
index ddf9414b08e..17666814c52 100644
@@ -1078,7 +1078,7 @@ config SPL_STACK_R_ADDR
 
 config SPL_SPI_SUNXI
 	bool "Support for SPI Flash on Allwinner SoCs in SPL"
-	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || SUN50I_GEN_H6 || MACH_SUNIV || SUNXI_GEN_NCAT2
+	depends on MACH_SUN4I || MACH_SUN5I || MACH_SUN7I || MACH_SUNXI_H3_H5 || MACH_SUN50I || MACH_SUN8I_R40 || MACH_SUN8I_V3S || SUN50I_GEN_H6 || MACH_SUNIV || SUNXI_GEN_NCAT2
 	help
 	  Enable support for SPI Flash. This option allows SPL to read from
 	  sunxi SPI Flash. It uses the same method as the boot ROM, so does
arch/arm/mach-sunxi/spl_spi_sunxi.c +2 -1
index 7acb44f52ae..d7abdc2e401 100644
@@ -140,7 +140,8 @@ static bool is_sun6i_gen_spi(void)
 {
 	return IS_ENABLED(CONFIG_SUNXI_GEN_SUN6I) ||
 	       IS_ENABLED(CONFIG_SUN50I_GEN_H6) ||
-	       IS_ENABLED(CONFIG_SUNXI_GEN_NCAT2);
+	       IS_ENABLED(CONFIG_SUNXI_GEN_NCAT2) ||
+	       IS_ENABLED(CONFIG_MACH_SUN8I_V3S);
 }
 
 static uintptr_t spi0_base_address(void)
#2 lore raw
In reply to Michael Walle
Quoted 6 lines · Michael Walle

The V3s is identical regarding register layout, clocks and resets to the sun6i variants. Therefore, we can just add the MACH_SUN8I_V3S to the sun6i compatible ones.

SPI boot was tested on a custom board with a Gigadevice GD25Q64 8MiB SPI flash.

Also here.. any news?

-michael

#3 lore raw
Quoted 9 lines · On Thu, 11 Jul 2024 15:40:47 +0200 "Michael Walle" <[email protected]> wrote:
Quoted 6 lines · Michael Walle

The V3s is identical regarding register layout, clocks and resets to the sun6i variants. Therefore, we can just add the MACH_SUN8I_V3S to the sun6i compatible ones.

SPI boot was tested on a custom board with a Gigadevice GD25Q64 8MiB SPI flash.

Also here.. any news?

I have all of them in my queue, to be part of the first pull request in the next few days.

Cheers,
Andre.

Quoted 2 lines

-michael