19 Commits

Author SHA1 Message Date
Chen-Yu Tsai
76089c82d0
Merge pull request #173 from apritzel/f1c100
Allwinner F1C100 support
2022-03-29 21:10:49 +08:00
Icenowy Zheng
db0fba3fd0 fel-spiflash: add support for suniv SoCs
The suniv SoCs has a SPI controller like the one in H3, but with base
address like sun4i and no SPI module clock in CCU.

Add support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Andre Przywara <osp@andrep.de>
2022-03-06 00:48:11 +00:00
Daniel Kucera
458a2c6d25 add V536 SoC support
HW very similar to V831, for the purpose of fel practically identical
2021-12-16 07:53:58 +01:00
Andre Przywara
63ce5ad517 spi: Add H616 support
The H616 SPI is very similar to the H6, only differs in the GPIOs
(again).
Add the SoC-ID at the right places and add the GPIOs according to the
manual.

Tested on OrangePi Zero 2.

Signed-off-by: Andre Przywara <osp@andrep.de>
2020-11-19 20:22:24 +00:00
Andre Przywara
205e208a70 spi: Observe proper clock initialisation order
The CCU section in all Allwinner manuals asks to de-assert the reset
signal first, then to ungate the bus clock.
On a nearby note it also requires to switch dividers before changing the
clock source.

The SPI flash code violated those two rules, fix this to make the code
more robust.

Signed-off-by: Andre Przywara <osp@andrep.de>
2020-11-10 10:58:57 +00:00
Andre Przywara
de784a7c7b spi: Avoid signed shifts
Shifting signed types to the left is dodgy, especially by 31 bits, since
it depends on the result type whether the result is undefined or not.

Do not take any chances here, and mark those shift bases as unsigned where
we can or will hit bit 31, to avoid undefined behaviour.

Signed-off-by: Andre Przywara <osp@andrep.de>
2020-11-10 10:58:57 +00:00
Andre Przywara
6814036708 spi: Add support for H6
As Icenowy rightfully assumed, the V831 SPI support covers the H6 as
well. The only difference was a slight deviation in the pinmux setup:
the H6 has the SPI0-CS on pin PC5, the V831 on pin PC1.

Just add the right SoC ID and tweak the pinmux setup to enable it.

Tested on a Pine H64.

Signed-off-by: Andre Przywara <osp@andrep.de>
2020-11-10 10:58:08 +00:00
Andre Przywara
47b611ccdc spi: Add support for R40
The R40 is closely related to the A20, but has in fact a newer
generation SPI controller.
Add the R40 SoC ID to the right places to enable SPI support.

Tested on a Bananapi M2 Berry with SPI flash attached to header pins.

Signed-off-by: Andre Przywara <osp@andrep.de>
2020-11-10 00:08:12 +00:00
Nazım Gediz Aydındoğmuş
4e3eeb5d6d spi: fix GPIO base address
Resolve typo for GPIO base address for SoCs other than V831.

Signed-off-by: Nazım Gediz Aydındoğmuş <gedizaydindogmus@gmail.com>
2020-10-19 22:13:13 +03:00
Chen-Yu Tsai
7cc37c883b
Merge pull request #140 from Icenowy/v831
V831 SoC support
2020-09-29 17:39:49 +08:00
Icenowy Zheng
eac43cf7e9 spi: add support for V831
The Allwinner V831 SoC has similar memory map and CCU with H6.

Add support for it by make the code to dynamically acquire the SPI0
memory base and add clock setup for V831.

These code should work on H6 too, but I am too lazy to test it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2020-09-29 14:28:12 +08:00
Chen-Yu Tsai
2783524e6f
Merge pull request #141 from Icenowy/eon-flash
fel: SPI: add Eon support
2020-09-29 14:20:16 +08:00
Icenowy Zheng
bf02fd31f5 fel: SPI: add Eon support
Add the JEDEC manufacturer ID for Eon to the list of recognized
vendors, also add the EN25QH series to the list of supported chips.
Those chips are used on some internal boards with V831 from Sipeed now,
but the chips themselves are widely available on the market. Tag the
struct definition with the member names on the way to improve readability
of the SPI flash chip description.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2020-09-20 07:44:29 +08:00
Icenowy Zheng
b330eeb844 spi: add support for V3s SoC
The Allwinner V3s SoC have the same SPI0 pinmux configuration, SPI clock
configuration and SPI controller (base address and the controller) with
H3.

Add spiflash support for it.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
2020-09-20 07:41:10 +08:00
Adrian Nistor
2767489196 Add support for reading A10 SPI flash 2020-09-14 10:23:57 +03:00
Priit Laes
5831d54aa9 spi: Add A20 pinmux configuration
A20 (as does A10) uses pins 0,1,2 and 23 in bank C
for SPI 0.

Signed-off-by: Priit Laes <priit.laes@paf.com>
2019-01-08 16:55:46 +02:00
Priit Laes
5325533ce7 spi: Be more verbose in case of unsupported SoCs
Signed-off-by: Priit Laes <priit.laes@paf.com>
2019-01-08 15:54:18 +02:00
Andre Przywara
fbe2dee762 fel: SPI: add Macronix support
Add the JEDEC manufacturer ID for Macronix to the list of recognized
vendors, also add the MX25L series to the list of supported chips.
Those chips are used on the OrangePi PC 2 boards, for instance.
Tag the struct definition with the member names on the way to improve
readability of the SPI flash chip description.

Signed-off-by: Andre Przywara <osp@andrep.de>
2018-07-09 09:16:25 +01:00
Siarhei Siamashka
3c9bc29f39 fel: Add SPI flash programmer implementation
Using the new AAPCS function remote execution support, add support to
read from and write to SPI flash connected to a device.
This allows flashing boot code to a device.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
[Andre: adjust to upstream changes]
Signed-off-by: Andre Przywara <osp@andrep.de>
2018-07-09 09:16:24 +01:00