spi: altera: Add DFL bus support for Altera SPI
Subsystems (2)
v3 cover spi: altera: Add DFL bus support for Altera SPI
From: Matthew Gerlach <[email protected]>
This patch set adds Device Feature List (DFL) bus support for the Altera SPI Master controller.
Patch 1 separates spi-altera.c into spi-altera-core.c and spi-altera-platform.c.
Patch 2 adds spi-altera-dfl.c.
Matthew Gerlach (2):
spi: altera: separate core code from platform code
spi: altera: Add DFL bus driver for Altera API Controller
drivers/spi/Kconfig | 18 +- drivers/spi/Makefile | 4 +- drivers/spi/spi-altera-core.c | 222 ++++++++++++++++++++++ drivers/spi/spi-altera-dfl.c | 204 ++++++++++++++++++++ drivers/spi/spi-altera-platform.c | 172 +++++++++++++++++ drivers/spi/spi-altera.c | 378 -------------------------------------- include/linux/spi/altera.h | 21 +++ 7 files changed, 639 insertions(+), 380 deletions(-) create mode 100644 drivers/spi/spi-altera-core.c create mode 100644 drivers/spi/spi-altera-dfl.c create mode 100644 drivers/spi/spi-altera-platform.c delete mode 100644 drivers/spi/spi-altera.c
Signature · 1 line
1.8.3.1
PATCH v3 1/2 spi: altera: separate core code from platform code
From: Matthew Gerlach <[email protected]>
In preparation of adding support for a new bus type, separate the core spi-altera code from the platform driver code.
--- drivers/spi/Kconfig | 9 +- drivers/spi/Makefile | 3 +- drivers/spi/spi-altera-core.c | 222 ++++++++++++++++++++++ drivers/spi/spi-altera-platform.c | 172 +++++++++++++++++ drivers/spi/spi-altera.c | 378 -------------------------------------- include/linux/spi/altera.h | 21 +++ 6 files changed, 425 insertions(+), 380 deletions(-) create mode 100644 drivers/spi/spi-altera-core.c create mode 100644 drivers/spi/spi-altera-platform.c delete mode 100644 drivers/spi/spi-altera.c
drivers/spi/Kconfig +8 -1
@@ -58,11 +58,18 @@ config SPI_MEM comment "SPI Master Controller Drivers" config SPI_ALTERA - tristate "Altera SPI Controller" + tristate "Altera SPI Controller platform driver" + select SPI_ALTERA_CORE select REGMAP_MMIO help This is the driver for the Altera SPI Controller. +config SPI_ALTERA_CORE + tristate "Altera SPI Controller core code" + select REGMAP + help + "The core code for the Altera SPI Controller" + config SPI_AR934X tristate "Qualcomm Atheros AR934X/QCA95XX SPI controller driver" depends on ATH79 || COMPILE_TEST
drivers/spi/Makefile +2 -1
@@ -14,7 +14,8 @@ obj-$(CONFIG_SPI_SPIDEV) += spidev.o obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o # SPI master controller drivers (bus) -obj-$(CONFIG_SPI_ALTERA) += spi-altera.o +obj-$(CONFIG_SPI_ALTERA) += spi-altera-platform.o +obj-$(CONFIG_SPI_ALTERA_CORE) += spi-altera-core.o obj-$(CONFIG_SPI_AR934X) += spi-ar934x.o obj-$(CONFIG_SPI_ARMADA_3700) += spi-armada-3700.o obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o
drivers/spi/spi-altera-core.c new file +222 -0
222 lines not on this page · raw message
drivers/spi/spi-altera-platform.c new file +172 -0
172 lines not on this page · raw message
drivers/spi/spi-altera.c deleted +0 -378
378 lines not on this page · raw message
include/linux/spi/altera.h +21 -0
@@ -5,10 +5,13 @@#ifndef __LINUX_SPI_ALTERA_H#define __LINUX_SPI_ALTERA_H +#include <linux/interrupt.h> #include <linux/regmap.h> #include <linux/spi/spi.h> #include <linux/types.h> +#define ALTERA_SPI_MAX_CS 32 +/** * struct altera_spi_platform_data - Platform data of the Altera SPI driver * @mode_bits: Mode bits of SPI master.
@@ -26,4 +29,22 @@ struct altera_spi_platform_data { struct spi_board_info *devices; }; +struct altera_spi { +int irq; +int len; +int count; +int bytes_per_word; +u32 imr; + +/* data buffers */ +const unsigned char *tx; +unsigned char *rx; + +struct regmap *regmap; +u32 regoff; +struct device *dev; +}; + +extern irqreturn_t altera_spi_irq (int irq,void *dev); +extern void altera_spi_init_master (struct spi_master *master);#endif /* __LINUX_SPI_ALTERA_H */
Signature · 1 line
1.8.3.1
PATCH v3 2/2 spi: altera: Add DFL bus driver for Altera API Controller
In reply to [email protected]From: Matthew Gerlach <[email protected]>
This patch adds a Device Feature List (DFL) bus driver for the Altera SPI Master controller. The SPI master is connected to an Intel SPI Slave to Avalon Bridge inside an Intel MAX10 BMC Chip.
---
v3: Instantiate SPI device instead of creating a sub-platform device.
Changed comment style as per Mark Brown.
v2: moved drivers/fpga/dfl-spi-altera.c to drivers/spi/spi-altera-dfl.c
--- drivers/spi/Kconfig | 9 ++ drivers/spi/Makefile | 1 + drivers/spi/spi-altera-dfl.c | 204 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 drivers/spi/spi-altera-dfl.c
drivers/spi/Kconfig +9 -0
@@ -70,6 +70,15 @@ config SPI_ALTERA_CORE help "The core code for the Altera SPI Controller" +config SPI_ALTERA_DFL + tristate "DFL bus driver for Altera SPI Controller" + depends on FPGA_DFL + select SPI_ALTERA_CORE + help + This is a Device Feature List (DFL) bus driver for the + Altera SPI master controller. The SPI master is connected + to a SPI slave to Avalon bridge in a Intel MAX BMC. + config SPI_AR934X tristate "Qualcomm Atheros AR934X/QCA95XX SPI controller driver" depends on ATH79 || COMPILE_TEST
drivers/spi/Makefile +1 -0
@@ -16,6 +16,7 @@ obj-$(CONFIG_SPI_LOOPBACK_TEST) += spi-loopback-test.o # SPI master controller drivers (bus) obj-$(CONFIG_SPI_ALTERA) += spi-altera-platform.o obj-$(CONFIG_SPI_ALTERA_CORE) += spi-altera-core.o +obj-$(CONFIG_SPI_ALTERA_DFL) += spi-altera-dfl.o obj-$(CONFIG_SPI_AR934X) += spi-ar934x.o obj-$(CONFIG_SPI_ARMADA_3700) += spi-armada-3700.o obj-$(CONFIG_SPI_ATMEL) += spi-atmel.o
drivers/spi/spi-altera-dfl.c new file +204 -0
204 lines not on this page · raw message
Signature · 1 line
1.8.3.1
Mark Brown
maintainerQuoted 9 lines · On Fri, 16 Apr 2021 09:57:18 -0700, [email protected] wrote:
This patch set adds Device Feature List (DFL) bus support for the Altera SPI Master controller.
Patch 1 separates
spi-altera.cintospi-altera-core.candspi-altera-platform.c.Patch 2 adds
spi-altera-dfl.c.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/2] spi: altera: separate core code from platform code
commit: b0c3d9354de1f87eebc00694d5218b6611265933
[2/2] spi: altera: Add DFL bus driver for Altera API Controller
commit: ba2fc167e9447596a812e828842d0130ea9cd0e4All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark