Skip to content

Commit 976a2db

Browse files
marcanjannau
authored andcommitted
spi: apple: Add driver for Apple SPI controller
This SPI controller is present in Apple SoCs such as the M1 (t8103) and M1 Pro/Max (t600x). It is a relatively straightforward design with two 16-entry FIFOs, arbitrary transfer sizes (up to 2**32 - 1) and fully configurable word size up to 32 bits. It supports one hardware CS line which can also be driven via the pinctrl/GPIO driver instead, if desired. TX and RX can be independently enabled. There are a surprising number of knobs for tweaking details of the transfer, most of which we do not use right now. Hardware CS control is available, but we haven't found a way to make it stay low across multiple logical transfers, so we just use software CS control for now. There is also a shared DMA offload coprocessor that can be used to handle larger transfers without requiring an IRQ every 8-16 words, but that feature depends on a bunch of scaffolding that isn't ready to be upstreamed yet, so leave it for later. The hardware shares some register bit definitions with spi-s3c24xx which suggests it has a shared legacy with Samsung SoCs, but it is too different to warrant sharing a driver. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent e0544d6 commit 976a2db

3 files changed

Lines changed: 553 additions & 0 deletions

File tree

drivers/spi/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ config SPI_AMLOGIC_SPIFC_A1
8686
This enables master mode support for the SPIFC (SPI flash
8787
controller) available in Amlogic A1 (A113L SoC).
8888

89+
config SPI_APPLE
90+
tristate "Apple SoC SPI Controller platform driver"
91+
depends on ARCH_APPLE || COMPILE_TEST
92+
help
93+
This enables support for the SPI controller present on
94+
many Apple SoCs, including the t8103 (M1) and t600x
95+
(M1 Pro/Max).
96+
8997
config SPI_AR934X
9098
tristate "Qualcomm Atheros AR934X/QCA95XX SPI controller driver"
9199
depends on ATH79 || COMPILE_TEST

drivers/spi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ obj-$(CONFIG_SPI_ALTERA) += spi-altera-platform.o
1818
obj-$(CONFIG_SPI_ALTERA_CORE) += spi-altera-core.o
1919
obj-$(CONFIG_SPI_ALTERA_DFL) += spi-altera-dfl.o
2020
obj-$(CONFIG_SPI_AMLOGIC_SPIFC_A1) += spi-amlogic-spifc-a1.o
21+
obj-$(CONFIG_SPI_APPLE) += spi-apple.o
2122
obj-$(CONFIG_SPI_AR934X) += spi-ar934x.o
2223
obj-$(CONFIG_SPI_ARMADA_3700) += spi-armada-3700.o
2324
obj-$(CONFIG_SPI_ASPEED_SMC) += spi-aspeed-smc.o

0 commit comments

Comments
 (0)