Skip to content

Commit e3228ed

Browse files
legoaterbroonie
authored andcommitted
spi: spi-mem: Convert Aspeed SMC driver to spi-mem
This SPI driver adds support for the Aspeed static memory controllers of the AST2600, AST2500 and AST2400 SoCs using the spi-mem interface. * AST2600 Firmware SPI Memory Controller (FMC) . BMC firmware . 3 chip select pins (CE0 ~ CE2) . Only supports SPI type flash memory . different segment register interface . single, dual and quad mode. * AST2600 SPI Flash Controller (SPI1 and SPI2) . host firmware . 2 chip select pins (CE0 ~ CE1) . different segment register interface . single, dual and quad mode. * AST2500 Firmware SPI Memory Controller (FMC) . BMC firmware . 3 chip select pins (CE0 ~ CE2) . supports SPI type flash memory (CE0-CE1) . CE2 can be of NOR type flash but this is not supported by the driver . single, dual mode. * AST2500 SPI Flash Controller (SPI1 and SPI2) . host firmware . 2 chip select pins (CE0 ~ CE1) . single, dual mode. * AST2400 New Static Memory Controller (also referred as FMC) . BMC firmware . New register set . 5 chip select pins (CE0 ∼ CE4) . supports NOR flash, NAND flash and SPI flash memory. . single, dual and quad mode. Each controller has a memory range on which flash devices contents are mapped. Each device is assigned a window that can be changed at bootime with the Segment Address Registers. Each SPI flash device can then be accessed in two modes: Command and User. When in User mode, SPI transfers are initiated with accesses to the memory segment of a device. When in Command mode, memory operations on the memory segment of a device generate SPI commands automatically using a Control Register for the settings. This initial patch adds support for User mode. Command mode needs a little more work to check that the memory window on the AHB bus fits the device size. It will come later when support for direct mapping is added. Single and dual mode RX transfers are supported. Other types than SPI are not supported. Reviewed-by: Joel Stanley <[email protected]> Tested-by: Joel Stanley <[email protected]> Tested-by: Tao Ren <[email protected]> Tested-by: Jae Hyun Yoo <[email protected]> Signed-off-by: Chin-Ting Kuo <[email protected]> Signed-off-by: Cédric Le Goater <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent ce9858e commit e3228ed

File tree

7 files changed

+730
-932
lines changed

7 files changed

+730
-932
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3107,6 +3107,7 @@ L: [email protected] (moderated for non-subscribers)
31073107
31083108
S: Maintained
31093109
F: Documentation/devicetree/bindings/spi/aspeed,ast2600-fmc.yaml
3110+
F: drivers/spi/spi-aspeed-smc.c
31103111

31113112
ASPEED VIDEO ENGINE DRIVER
31123113
M: Eddie James <[email protected]>

drivers/mtd/spi-nor/controllers/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
config SPI_ASPEED_SMC
3-
tristate "Aspeed flash controllers in SPI mode"
4-
depends on ARCH_ASPEED || COMPILE_TEST
5-
depends on HAS_IOMEM && OF
6-
help
7-
This enables support for the Firmware Memory controller (FMC)
8-
in the Aspeed AST2500/AST2400 SoCs when attached to SPI NOR chips,
9-
and support for the SPI flash memory controller (SPI) for
10-
the host firmware. The implementation only supports SPI NOR.
11-
122
config SPI_HISI_SFC
133
tristate "Hisilicon FMC SPI NOR Flash Controller(SFC)"
144
depends on ARCH_HISI || COMPILE_TEST
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o
32
obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o
43
obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o

0 commit comments

Comments
 (0)