spi: sunxi: Add support for F1C100s SPI controller
authorAndre Przywara <andre.przywara@arm.com>
Tue, 26 Apr 2022 22:58:53 +0000 (23:58 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 18 Jul 2022 10:34:22 +0000 (11:34 +0100)
commit8649995c76bb38b9cbfd94169e41ce80c0d5f6ac
tree32d69a0d81a086be3a6d2cb7abb315801945a0fd
parentfcd6d936aac7bd934d125135a71192e3a3da9b48
spi: sunxi: Add support for F1C100s SPI controller

The SPI controllers in the Allwinner F1Cx00 series of SoCs are
compatible to the H3 IP. The only difference in the integration is
the missing mod clock in the F1C100, instead the SPI clock is directly
derived from the AHB clock.
We *should* be able to model this through the DT, but the addition of
get_rate() requires quite some refactoring, so it's not really worth in
this simple case: We programmed both the PLL_PERIPH to 600 MHz and the
PLL/AHB divider to 3 in the SPL, so we know the SPI base clock is 200
MHz. Since we used a hard coded fixed clock rate of 24 MHz for all the
other SoCs so far, we can as well do the same for the F1C100.

Define the SPI input clock and maximum frequency differently when
compiling for the F1C100 SoC.
Also adjust the power-of-2 divider programming, because that uses a
"minus one" encoding, compared to the other SoCs.

This allows to enable SPI flash support for the F1C100 boards.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/spi/spi-sunxi.c