Skip to contentSkip to conversation

arm: sunxi: Allwinner A10 SPI driver

PATCH Superseded Stefan Mavrodiev 3 participants 7 messages Dec 8, 2017 – Dec 20, 2017

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---
Changes for v2:
- Updated copyright including original owners
- Remove write/read register function. They are replaced with direct opts
- Some coding style changes

Tested with A20-OLinuXino-Lime2 with W25Q128 chip. The output is:
=> sspi

=> sf probe
SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 MiB => sf test 0 100000
SPI flash test:
0 erase: 11373 ticks, 90 KiB/s 0.720 Mbps
1 check: 8883 ticks, 115 KiB/s 0.920 Mbps
2 write: 10769 ticks, 95 KiB/s 0.760 Mbps
3 read: 8871 ticks, 115 KiB/s 0.920 Mbps
Test passed
0 erase: 11373 ticks, 90 KiB/s 0.720 Mbps
1 check: 8883 ticks, 115 KiB/s 0.920 Mbps
2 write: 10769 ticks, 95 KiB/s 0.760 Mbps
3 read: 8871 ticks, 115 KiB/s 0.920 Mbps
=>

 drivers/spi/Kconfig     |   5 +
 drivers/spi/Makefile    |   1 +
 drivers/spi/sun4i_spi.c | 456 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 462 insertions(+)
 create mode 100644 drivers/spi/sun4i_spi.c
drivers/spi/Kconfig +5 -0
index 88da9a4..d78253a 100644
@@ -132,6 +132,11 @@ config STM32_QSPI
 	  used to access the SPI NOR flash chips on platforms embedding
 	  this ST IP core.
 
+config SUN4I_SPI
+	bool "Allwinner A10 SoCs SPI controller"
+	help
+	  SPI driver for Allwinner sun4i, sun5i and sun7i SoCs
+
 config TEGRA114_SPI
 	bool "nVidia Tegra114 SPI driver"
 	help
drivers/spi/Makefile +1 -0
index ad56203..04ba305 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
 obj-$(CONFIG_SH_SPI) += sh_spi.o
 obj-$(CONFIG_SH_QSPI) += sh_qspi.o
 obj-$(CONFIG_STM32_QSPI) += stm32_qspi.o
+obj-$(CONFIG_SUN4I_SPI) += sun4i_spi.o
 obj-$(CONFIG_TEGRA114_SPI) += tegra114_spi.o
 obj-$(CONFIG_TEGRA20_SFLASH) += tegra20_sflash.o
 obj-$(CONFIG_TEGRA20_SLINK) += tegra20_slink.o
drivers/spi/sun4i_spi.c new file +456 -0

456 lines not on this page · raw message

Signature · 1 line
2.7.4
#1 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 5 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#2 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 8 lines · Jagan Teki
Quoted 5 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---

Are you planning to send dts and configs changes for this? I'm enough confident to apply only when it tested.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#3 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 5 lines · Jagan Teki
Quoted 4 lines · Jagan Teki
Quoted 3 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

Quoted 7 lines
Quoted 3 lines
Quoted 2 lines

---

Are you planning to send dts and configs changes for this? I'm enough confident to apply only when it tested.

thanks!

I'm not sure I understand you.

I've made the test with Lime2, but the spi flash is optional in production. Thus I'm not sure if changes in the dts and config should be made.
I've tried pushing spi node to mainline kernel dts, but the patch wasn't accepted. https://patchwork.kernel.org/patch/10076721/

I can update sun4i, sun5i and sun7i dtsi files to add spi0_pins_b, if this is the point of your question.

Regards,
Stefan Mavrodiev

#4 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 22 lines · Stefan Mavrodiev
Quoted 13 lines · Jagan Teki
Quoted 10 lines · Jagan Teki
Quoted 6 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---

Quoted 6 lines
Quoted 1 line

Are you planning to send dts and configs changes for this? I'm enough confident to apply only when it tested.

thanks!

Quoted 6 lines

I'm not sure I understand you.

I've made the test with Lime2, but the spi flash is optional in production. Thus I'm not sure if changes in the dts and config should be made. I've tried pushing spi node to mainline kernel dts, but the patch wasn't accepted. https://patchwork.kernel.org/patch/10076721/

Yes I've seen.

Quoted 3 lines

I can update sun4i, sun5i and sun7i dtsi files to add spi0_pins_b, if this is the point of your question.

But it should accept Linux first for dts updates.

thanks!

Signature · 4 lines
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
#5 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 23 lines · Jagan Teki
Quoted 14 lines · Stefan Mavrodiev
Quoted 13 lines · Jagan Teki
Quoted 8 lines · Jagan Teki
Quoted 5 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---

Are you planning to send dts and configs changes for this? I'm enough confident to apply only when it tested.

Quoted 8 lines
Quoted 1 line

thanks!

I'm not sure I understand you.

I've made the test with Lime2, but the spi flash is optional in production. Thus I'm not sure if changes in the dts and config should be made. I've tried pushing spi node to mainline kernel dts, but the patch wasn't accepted. https://patchwork.kernel.org/patch/10076721/

Quoted 7 lines

Yes I've seen.

Quoted 2 lines

I can update sun4i, sun5i and sun7i dtsi files to add spi0_pins_b, if this is the point of your question.

But it should accept Linux first for dts updates.

thanks!

I guess there won't be any changes in the device tree files as described here:
https://patchwork.kernel.org/patch/10109445/

Best regards,
Stefan Mavrodiev

#6 lore raw

PATCH v2 1/1 arm: sunxi: Allwinner A10 SPI driver

Quoted 41 lines · Stefan Mavrodiev
Quoted 40 lines · Jagan Teki
Quoted 23 lines · Stefan Mavrodiev
Quoted 13 lines · Jagan Teki
Quoted 10 lines · Jagan Teki
Quoted 6 lines · Stefan Mavrodiev

Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is adapted from mailine kernel (currently 4.15.0-rc1).

---

Quoted 6 lines
Quoted 1 line

Are you planning to send dts and configs changes for this? I'm enough confident to apply only when it tested.

thanks!

Quoted 7 lines

I'm not sure I understand you.

I've made the test with Lime2, but the spi flash is optional in production.
Thus I'm not sure if changes in the dts and config should be made. I've tried pushing spi node to mainline kernel dts, but the patch wasn't accepted. https://patchwork.kernel.org/patch/10076721/

Yes I've seen.

Quoted 3 lines

I can update sun4i, sun5i and sun7i dtsi files to add spi0_pins_b, if this
is the point of your question.

Quoted 8 lines
Quoted 3 lines

But it should accept Linux first for dts updates.

thanks!

I guess there won't be any changes in the device tree files as described here:
https://patchwork.kernel.org/patch/10109445/

ok then send the dts sync as separate patch, will test and try to submit all together.