RE: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
> -Original Message- > From: Schrempf Frieder > Sent: Tuesday, December 4, 2018 8:15 AM > To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- > s...@vger.kernel.org; Marek Vasut ; Mark Brown > ; Han Xu > Cc: dw...@infradead.org; computersforpe...@gmail.com; > rich...@nod.at; miquel.ray...@bootlin.com; David Wolfe > ; Fabio Estevam ; > Prabhakar Kushwaha ; Yogesh Narayan > Gaur ; shawn...@kernel.org; Schrempf > Frieder ; linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI > controller > > From: Frieder Schrempf > > This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. > It > uses the new SPI memory interface of the SPI framework to issue flash > memory operations to up to four connected flash chips (2 buses with 2 CS > each). > > The controller does not support generic SPI messages. > > This patch also disables the build of the "old" driver and reuses its Kconfig > option CONFIG_SPI_FSL_QUADSPI to replace it. > > Signed-off-by: Frieder Schrempf > --- > drivers/mtd/spi-nor/Kconfig | 9 - > drivers/mtd/spi-nor/Makefile | 1 - > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-fsl-qspi.c | 966 > ++ > 5 files changed, 978 insertions(+), 10 deletions(-) > > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index > 6cc9c92..d1ca307 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI > device with a Cadence QSPI controller and want to access the > Flash as an MTD device. > > -config SPI_FSL_QUADSPI > - tristate "Freescale Quad SPI controller" > - depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > - depends on HAS_IOMEM > - help > - This enables support for the Quad SPI controller in master mode. > - This controller does not support generic SPI. It only supports > - SPI NOR. > - > config SPI_HISI_SFC > tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile > index f4c61d2..3f160c2e3 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o > obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o > obj-$(CONFIG_SPI_CADENCE_QUADSPI)+= cadence-quadspi.o > -obj-$(CONFIG_SPI_FSL_QUADSPI)+= fsl-quadspi.o > obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 > 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI > help > This enables Freescale i.MX LPSPI controllers in master mode. > > +config SPI_FSL_QUADSPI > + tristate "Freescale QSPI controller" > + depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > + depends on HAS_IOMEM > + help > + This enables support for the Quad SPI controller in master mode. > + Up to four flash chips can be connected on two buses with two > + chipselects each. > + This controller does not support generic SPI messages. It only > + supports the high-level SPI memory interface. > + > config SPI_GPIO > tristate "GPIO-based bitbanging SPI Master" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index > 3575205..5377e61 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- > dspi.o > obj-$(CONFIG_SPI_FSL_LIB)+= spi-fsl-lib.o > obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o > obj-$(CONFIG_SPI_FSL_LPSPI) += spi-fsl-lpspi.o > +obj-$(CONFIG_SPI_FSL_QUADSPI)+= spi-fsl-qspi.o > obj-$(CONFIG_SPI_FSL_SPI)+= spi-fsl-spi.o > obj-$(CONFIG_SPI_GPIO) += spi-gpio.o > obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o > diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new file > mode > 100644 index 000..f0a3400 > --- /dev/null > +++ b/drivers/spi/spi-fsl-qspi.c > @@ -0,0 +1,966 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/* > + * Freescale QuadSPI driver. > + * > + * Copyright (C) 2013 Freescale Semiconductor, Inc. > + * Copyright (C) 2018 Bootlin > + * Copyright (C) 2018 exceet electronics GmbH > + * Copyright (C) 2018 Kontron Electronics GmbH > + * > + * Transition to SPI MEM interface: > + * Authors: > + * Boris Brezillion > + * Frieder Schrempf > + * Yogesh Gaur > + * Suresh Gupta > + * > + * Based
Re: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
On 07.12.18 06:46, Yogesh Narayan Gaur wrote: > Hi Frieder, > >> -Original Message- >> From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] >> Sent: Tuesday, December 4, 2018 7:45 PM >> To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- >> s...@vger.kernel.org; Marek Vasut ; Mark Brown >> ; Han Xu >> Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; >> miquel.ray...@bootlin.com; David Wolfe ; Fabio >> Estevam ; Prabhakar Kushwaha >> ; Yogesh Narayan Gaur >> ; shawn...@kernel.org; Schrempf Frieder >> ; linux-kernel@vger.kernel.org >> Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI >> controller >> >> From: Frieder Schrempf >> >> This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. >> It >> uses the new SPI memory interface of the SPI framework to issue flash memory >> operations to up to four connected flash chips (2 buses with 2 CS each). >> >> The controller does not support generic SPI messages. >> >> This patch also disables the build of the "old" driver and reuses its >> Kconfig option >> CONFIG_SPI_FSL_QUADSPI to replace it. >> >> Signed-off-by: Frieder Schrempf >> --- >> drivers/mtd/spi-nor/Kconfig | 9 - >> drivers/mtd/spi-nor/Makefile | 1 - >> drivers/spi/Kconfig | 11 + >> drivers/spi/Makefile | 1 + >> drivers/spi/spi-fsl-qspi.c | 966 ++ >> 5 files changed, 978 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index >> 6cc9c92..d1ca307 100644 >> --- a/drivers/mtd/spi-nor/Kconfig >> +++ b/drivers/mtd/spi-nor/Kconfig >> @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI >>device with a Cadence QSPI controller and want to access the >>Flash as an MTD device. >> >> -config SPI_FSL_QUADSPI >> -tristate "Freescale Quad SPI controller" >> -depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || >> COMPILE_TEST >> -depends on HAS_IOMEM >> -help >> - This enables support for the Quad SPI controller in master mode. >> - This controller does not support generic SPI. It only supports >> - SPI NOR. >> - >> config SPI_HISI_SFC >> tristate "Hisilicon SPI-NOR Flash Controller(SFC)" >> depends on ARCH_HISI || COMPILE_TEST >> diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile >> index >> f4c61d2..3f160c2e3 100644 >> --- a/drivers/mtd/spi-nor/Makefile >> +++ b/drivers/mtd/spi-nor/Makefile >> @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR)+= spi-nor.o >> obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o >> obj-$(CONFIG_SPI_ATMEL_QUADSPI)+= atmel-quadspi.o >> obj-$(CONFIG_SPI_CADENCE_QUADSPI) += cadence-quadspi.o >> -obj-$(CONFIG_SPI_FSL_QUADSPI) += fsl-quadspi.o >> obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o >> obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o >> obj-$(CONFIG_SPI_NXP_SPIFI)+= nxp-spifi.o >> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 >> 100644 >> --- a/drivers/spi/Kconfig >> +++ b/drivers/spi/Kconfig >> @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI >> help >>This enables Freescale i.MX LPSPI controllers in master mode. >> >> +config SPI_FSL_QUADSPI >> +tristate "Freescale QSPI controller" >> +depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || >> COMPILE_TEST >> +depends on HAS_IOMEM >> +help >> + This enables support for the Quad SPI controller in master mode. >> + Up to four flash chips can be connected on two buses with two >> + chipselects each. >> + This controller does not support generic SPI messages. It only >> + supports the high-level SPI memory interface. >> + >> config SPI_GPIO >> tristate "GPIO-based bitbanging SPI Master" >> depends on GPIOLIB || COMPILE_TEST >> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index >> 3575205..5377e61 >> 100644 >> --- a/drivers/spi/Makefile >> +++ b/drivers/spi/Makefile >> @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- >> dspi.o >> obj-$(CONFIG_SPI_FSL_LIB) += spi-fsl-lib.o >> obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o >> obj-$(CONFIG_SPI_FSL_LPSPI)+= spi-fsl-lpspi.o >> +obj-$(CONFIG_SPI_FSL_QUADSPI) += spi-fsl-qspi.o >> obj-$(CONFIG_SPI_FSL_SPI) += spi-fsl-spi.o >> obj-$(CONFIG_SPI_GPIO) += spi-gpio.o >> obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o >> diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new >> file mode >> 100644 index 000..f0a3400 >> --- /dev/null >> +++ b/drivers/spi/spi-fsl-qspi.c >> @@ -0,0 +1,966 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> + >> +/* >> + * Freescale QuadSPI driver. >> + * >> + * Copyright (C) 2013 Freescale Semiconductor, Inc. >> + * Copyright (C) 2018 Bootlin >> + * Copyright (C) 2018 exceet electronics GmbH >> + * Copyright (C)
Re: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
On 07.12.18 06:46, Yogesh Narayan Gaur wrote: > Hi Frieder, > >> -Original Message- >> From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] >> Sent: Tuesday, December 4, 2018 7:45 PM >> To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- >> s...@vger.kernel.org; Marek Vasut ; Mark Brown >> ; Han Xu >> Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; >> miquel.ray...@bootlin.com; David Wolfe ; Fabio >> Estevam ; Prabhakar Kushwaha >> ; Yogesh Narayan Gaur >> ; shawn...@kernel.org; Schrempf Frieder >> ; linux-kernel@vger.kernel.org >> Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI >> controller >> >> From: Frieder Schrempf >> >> This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. >> It >> uses the new SPI memory interface of the SPI framework to issue flash memory >> operations to up to four connected flash chips (2 buses with 2 CS each). >> >> The controller does not support generic SPI messages. >> >> This patch also disables the build of the "old" driver and reuses its >> Kconfig option >> CONFIG_SPI_FSL_QUADSPI to replace it. >> >> Signed-off-by: Frieder Schrempf >> --- >> drivers/mtd/spi-nor/Kconfig | 9 - >> drivers/mtd/spi-nor/Makefile | 1 - >> drivers/spi/Kconfig | 11 + >> drivers/spi/Makefile | 1 + >> drivers/spi/spi-fsl-qspi.c | 966 ++ >> 5 files changed, 978 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index >> 6cc9c92..d1ca307 100644 >> --- a/drivers/mtd/spi-nor/Kconfig >> +++ b/drivers/mtd/spi-nor/Kconfig >> @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI >>device with a Cadence QSPI controller and want to access the >>Flash as an MTD device. >> >> -config SPI_FSL_QUADSPI >> -tristate "Freescale Quad SPI controller" >> -depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || >> COMPILE_TEST >> -depends on HAS_IOMEM >> -help >> - This enables support for the Quad SPI controller in master mode. >> - This controller does not support generic SPI. It only supports >> - SPI NOR. >> - >> config SPI_HISI_SFC >> tristate "Hisilicon SPI-NOR Flash Controller(SFC)" >> depends on ARCH_HISI || COMPILE_TEST >> diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile >> index >> f4c61d2..3f160c2e3 100644 >> --- a/drivers/mtd/spi-nor/Makefile >> +++ b/drivers/mtd/spi-nor/Makefile >> @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR)+= spi-nor.o >> obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o >> obj-$(CONFIG_SPI_ATMEL_QUADSPI)+= atmel-quadspi.o >> obj-$(CONFIG_SPI_CADENCE_QUADSPI) += cadence-quadspi.o >> -obj-$(CONFIG_SPI_FSL_QUADSPI) += fsl-quadspi.o >> obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o >> obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o >> obj-$(CONFIG_SPI_NXP_SPIFI)+= nxp-spifi.o >> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 >> 100644 >> --- a/drivers/spi/Kconfig >> +++ b/drivers/spi/Kconfig >> @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI >> help >>This enables Freescale i.MX LPSPI controllers in master mode. >> >> +config SPI_FSL_QUADSPI >> +tristate "Freescale QSPI controller" >> +depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || >> COMPILE_TEST >> +depends on HAS_IOMEM >> +help >> + This enables support for the Quad SPI controller in master mode. >> + Up to four flash chips can be connected on two buses with two >> + chipselects each. >> + This controller does not support generic SPI messages. It only >> + supports the high-level SPI memory interface. >> + >> config SPI_GPIO >> tristate "GPIO-based bitbanging SPI Master" >> depends on GPIOLIB || COMPILE_TEST >> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index >> 3575205..5377e61 >> 100644 >> --- a/drivers/spi/Makefile >> +++ b/drivers/spi/Makefile >> @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- >> dspi.o >> obj-$(CONFIG_SPI_FSL_LIB) += spi-fsl-lib.o >> obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o >> obj-$(CONFIG_SPI_FSL_LPSPI)+= spi-fsl-lpspi.o >> +obj-$(CONFIG_SPI_FSL_QUADSPI) += spi-fsl-qspi.o >> obj-$(CONFIG_SPI_FSL_SPI) += spi-fsl-spi.o >> obj-$(CONFIG_SPI_GPIO) += spi-gpio.o >> obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o >> diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new >> file mode >> 100644 index 000..f0a3400 >> --- /dev/null >> +++ b/drivers/spi/spi-fsl-qspi.c >> @@ -0,0 +1,966 @@ >> +// SPDX-License-Identifier: GPL-2.0+ >> + >> +/* >> + * Freescale QuadSPI driver. >> + * >> + * Copyright (C) 2013 Freescale Semiconductor, Inc. >> + * Copyright (C) 2018 Bootlin >> + * Copyright (C) 2018 exceet electronics GmbH >> + * Copyright (C)
RE: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
Hi Frieder, > -Original Message- > From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] > Sent: Tuesday, December 4, 2018 7:45 PM > To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- > s...@vger.kernel.org; Marek Vasut ; Mark Brown > ; Han Xu > Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; > miquel.ray...@bootlin.com; David Wolfe ; Fabio > Estevam ; Prabhakar Kushwaha > ; Yogesh Narayan Gaur > ; shawn...@kernel.org; Schrempf Frieder > ; linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI > controller > > From: Frieder Schrempf > > This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. > It > uses the new SPI memory interface of the SPI framework to issue flash memory > operations to up to four connected flash chips (2 buses with 2 CS each). > > The controller does not support generic SPI messages. > > This patch also disables the build of the "old" driver and reuses its Kconfig > option > CONFIG_SPI_FSL_QUADSPI to replace it. > > Signed-off-by: Frieder Schrempf > --- > drivers/mtd/spi-nor/Kconfig | 9 - > drivers/mtd/spi-nor/Makefile | 1 - > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-fsl-qspi.c | 966 ++ > 5 files changed, 978 insertions(+), 10 deletions(-) > > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index > 6cc9c92..d1ca307 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI > device with a Cadence QSPI controller and want to access the > Flash as an MTD device. > > -config SPI_FSL_QUADSPI > - tristate "Freescale Quad SPI controller" > - depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > - depends on HAS_IOMEM > - help > - This enables support for the Quad SPI controller in master mode. > - This controller does not support generic SPI. It only supports > - SPI NOR. > - > config SPI_HISI_SFC > tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index > f4c61d2..3f160c2e3 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o > obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o > obj-$(CONFIG_SPI_CADENCE_QUADSPI)+= cadence-quadspi.o > -obj-$(CONFIG_SPI_FSL_QUADSPI)+= fsl-quadspi.o > obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 > 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI > help > This enables Freescale i.MX LPSPI controllers in master mode. > > +config SPI_FSL_QUADSPI > + tristate "Freescale QSPI controller" > + depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > + depends on HAS_IOMEM > + help > + This enables support for the Quad SPI controller in master mode. > + Up to four flash chips can be connected on two buses with two > + chipselects each. > + This controller does not support generic SPI messages. It only > + supports the high-level SPI memory interface. > + > config SPI_GPIO > tristate "GPIO-based bitbanging SPI Master" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index > 3575205..5377e61 > 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- > dspi.o > obj-$(CONFIG_SPI_FSL_LIB)+= spi-fsl-lib.o > obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o > obj-$(CONFIG_SPI_FSL_LPSPI) += spi-fsl-lpspi.o > +obj-$(CONFIG_SPI_FSL_QUADSPI)+= spi-fsl-qspi.o > obj-$(CONFIG_SPI_FSL_SPI)+= spi-fsl-spi.o > obj-$(CONFIG_SPI_GPIO) += spi-gpio.o > obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o > diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new file > mode > 100644 index 000..f0a3400 > --- /dev/null > +++ b/drivers/spi/spi-fsl-qspi.c > @@ -0,0 +1,966 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/* > + * Freescale QuadSPI driver. > + * > + * Copyright (C) 2013 Freescale Semiconductor, Inc. > + * Copyright (C) 2018 Bootlin > + * Copyright (C) 2018 exceet electronics GmbH > + * Copyright (C) 2018 Kontron Electronics GmbH > + * > + * Transition to SPI MEM interface: > + * Authors: > + * Boris Brezillion > + * Frieder Schrempf > + * Yogesh
RE: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
Hi Frieder, > -Original Message- > From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] > Sent: Tuesday, December 4, 2018 7:45 PM > To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- > s...@vger.kernel.org; Marek Vasut ; Mark Brown > ; Han Xu > Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; > miquel.ray...@bootlin.com; David Wolfe ; Fabio > Estevam ; Prabhakar Kushwaha > ; Yogesh Narayan Gaur > ; shawn...@kernel.org; Schrempf Frieder > ; linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI > controller > > From: Frieder Schrempf > > This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. > It > uses the new SPI memory interface of the SPI framework to issue flash memory > operations to up to four connected flash chips (2 buses with 2 CS each). > > The controller does not support generic SPI messages. > > This patch also disables the build of the "old" driver and reuses its Kconfig > option > CONFIG_SPI_FSL_QUADSPI to replace it. > > Signed-off-by: Frieder Schrempf > --- > drivers/mtd/spi-nor/Kconfig | 9 - > drivers/mtd/spi-nor/Makefile | 1 - > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-fsl-qspi.c | 966 ++ > 5 files changed, 978 insertions(+), 10 deletions(-) > > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index > 6cc9c92..d1ca307 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI > device with a Cadence QSPI controller and want to access the > Flash as an MTD device. > > -config SPI_FSL_QUADSPI > - tristate "Freescale Quad SPI controller" > - depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > - depends on HAS_IOMEM > - help > - This enables support for the Quad SPI controller in master mode. > - This controller does not support generic SPI. It only supports > - SPI NOR. > - > config SPI_HISI_SFC > tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index > f4c61d2..3f160c2e3 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o > obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o > obj-$(CONFIG_SPI_CADENCE_QUADSPI)+= cadence-quadspi.o > -obj-$(CONFIG_SPI_FSL_QUADSPI)+= fsl-quadspi.o > obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 > 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI > help > This enables Freescale i.MX LPSPI controllers in master mode. > > +config SPI_FSL_QUADSPI > + tristate "Freescale QSPI controller" > + depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > + depends on HAS_IOMEM > + help > + This enables support for the Quad SPI controller in master mode. > + Up to four flash chips can be connected on two buses with two > + chipselects each. > + This controller does not support generic SPI messages. It only > + supports the high-level SPI memory interface. > + > config SPI_GPIO > tristate "GPIO-based bitbanging SPI Master" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index > 3575205..5377e61 > 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- > dspi.o > obj-$(CONFIG_SPI_FSL_LIB)+= spi-fsl-lib.o > obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o > obj-$(CONFIG_SPI_FSL_LPSPI) += spi-fsl-lpspi.o > +obj-$(CONFIG_SPI_FSL_QUADSPI)+= spi-fsl-qspi.o > obj-$(CONFIG_SPI_FSL_SPI)+= spi-fsl-spi.o > obj-$(CONFIG_SPI_GPIO) += spi-gpio.o > obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o > diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new file > mode > 100644 index 000..f0a3400 > --- /dev/null > +++ b/drivers/spi/spi-fsl-qspi.c > @@ -0,0 +1,966 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/* > + * Freescale QuadSPI driver. > + * > + * Copyright (C) 2013 Freescale Semiconductor, Inc. > + * Copyright (C) 2018 Bootlin > + * Copyright (C) 2018 exceet electronics GmbH > + * Copyright (C) 2018 Kontron Electronics GmbH > + * > + * Transition to SPI MEM interface: > + * Authors: > + * Boris Brezillion > + * Frieder Schrempf > + * Yogesh
RE: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
Hi, Verified patch on LS1088ardb this board is having two connected flash slave devices on CS0 and CS1. Verified with simple Read/Write/Erase operations along with JFFS2 mounting and booting from flash MTD partition for both slave devices. > -Original Message- > From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] > Sent: Tuesday, December 4, 2018 7:45 PM > To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- > s...@vger.kernel.org; Marek Vasut ; Mark Brown > ; Han Xu > Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; > miquel.ray...@bootlin.com; David Wolfe ; Fabio > Estevam ; Prabhakar Kushwaha > ; Yogesh Narayan Gaur > ; shawn...@kernel.org; Schrempf Frieder > ; linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI > controller > > From: Frieder Schrempf > > This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. > It > uses the new SPI memory interface of the SPI framework to issue flash memory > operations to up to four connected flash chips (2 buses with 2 CS each). > > The controller does not support generic SPI messages. > > This patch also disables the build of the "old" driver and reuses its Kconfig > option > CONFIG_SPI_FSL_QUADSPI to replace it. > > Signed-off-by: Frieder Schrempf Reviewed-by: Yogesh Gaur Tested-by: Yogesh Gaur -- Thanks Yogesh Gaur > --- > drivers/mtd/spi-nor/Kconfig | 9 - > drivers/mtd/spi-nor/Makefile | 1 - > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-fsl-qspi.c | 966 ++ > 5 files changed, 978 insertions(+), 10 deletions(-) > > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index > 6cc9c92..d1ca307 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI > device with a Cadence QSPI controller and want to access the > Flash as an MTD device. > > -config SPI_FSL_QUADSPI > - tristate "Freescale Quad SPI controller" > - depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > - depends on HAS_IOMEM > - help > - This enables support for the Quad SPI controller in master mode. > - This controller does not support generic SPI. It only supports > - SPI NOR. > - > config SPI_HISI_SFC > tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index > f4c61d2..3f160c2e3 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o > obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o > obj-$(CONFIG_SPI_CADENCE_QUADSPI)+= cadence-quadspi.o > -obj-$(CONFIG_SPI_FSL_QUADSPI)+= fsl-quadspi.o > obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 > 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI > help > This enables Freescale i.MX LPSPI controllers in master mode. > > +config SPI_FSL_QUADSPI > + tristate "Freescale QSPI controller" > + depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > + depends on HAS_IOMEM > + help > + This enables support for the Quad SPI controller in master mode. > + Up to four flash chips can be connected on two buses with two > + chipselects each. > + This controller does not support generic SPI messages. It only > + supports the high-level SPI memory interface. > + > config SPI_GPIO > tristate "GPIO-based bitbanging SPI Master" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index > 3575205..5377e61 > 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- > dspi.o > obj-$(CONFIG_SPI_FSL_LIB)+= spi-fsl-lib.o > obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o > obj-$(CONFIG_SPI_FSL_LPSPI) += spi-fsl-lpspi.o > +obj-$(CONFIG_SPI_FSL_QUADSPI)+= spi-fsl-qspi.o > obj-$(CONFIG_SPI_FSL_SPI)+= spi-fsl-spi.o > obj-$(CONFIG_SPI_GPIO) += spi-gpio.o > obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o > diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new file > mode > 100644 index 000..f0a3400 > --- /dev/null > +++ b/drivers/spi/spi-fsl-qspi.c > @@ -0,0 +1,966 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/* > + * Freescale QuadSPI driver. > + * > + *
RE: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI controller
Hi, Verified patch on LS1088ardb this board is having two connected flash slave devices on CS0 and CS1. Verified with simple Read/Write/Erase operations along with JFFS2 mounting and booting from flash MTD partition for both slave devices. > -Original Message- > From: Schrempf Frieder [mailto:frieder.schre...@kontron.de] > Sent: Tuesday, December 4, 2018 7:45 PM > To: linux-...@lists.infradead.org; boris.brezil...@bootlin.com; linux- > s...@vger.kernel.org; Marek Vasut ; Mark Brown > ; Han Xu > Cc: dw...@infradead.org; computersforpe...@gmail.com; rich...@nod.at; > miquel.ray...@bootlin.com; David Wolfe ; Fabio > Estevam ; Prabhakar Kushwaha > ; Yogesh Narayan Gaur > ; shawn...@kernel.org; Schrempf Frieder > ; linux-kernel@vger.kernel.org > Subject: [PATCH v7 3/9] spi: Add a driver for the Freescale/NXP QuadSPI > controller > > From: Frieder Schrempf > > This driver is derived from the SPI NOR driver at mtd/spi-nor/fsl-quadspi.c. > It > uses the new SPI memory interface of the SPI framework to issue flash memory > operations to up to four connected flash chips (2 buses with 2 CS each). > > The controller does not support generic SPI messages. > > This patch also disables the build of the "old" driver and reuses its Kconfig > option > CONFIG_SPI_FSL_QUADSPI to replace it. > > Signed-off-by: Frieder Schrempf Reviewed-by: Yogesh Gaur Tested-by: Yogesh Gaur -- Thanks Yogesh Gaur > --- > drivers/mtd/spi-nor/Kconfig | 9 - > drivers/mtd/spi-nor/Makefile | 1 - > drivers/spi/Kconfig | 11 + > drivers/spi/Makefile | 1 + > drivers/spi/spi-fsl-qspi.c | 966 ++ > 5 files changed, 978 insertions(+), 10 deletions(-) > > diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig index > 6cc9c92..d1ca307 100644 > --- a/drivers/mtd/spi-nor/Kconfig > +++ b/drivers/mtd/spi-nor/Kconfig > @@ -59,15 +59,6 @@ config SPI_CADENCE_QUADSPI > device with a Cadence QSPI controller and want to access the > Flash as an MTD device. > > -config SPI_FSL_QUADSPI > - tristate "Freescale Quad SPI controller" > - depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > - depends on HAS_IOMEM > - help > - This enables support for the Quad SPI controller in master mode. > - This controller does not support generic SPI. It only supports > - SPI NOR. > - > config SPI_HISI_SFC > tristate "Hisilicon SPI-NOR Flash Controller(SFC)" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile index > f4c61d2..3f160c2e3 100644 > --- a/drivers/mtd/spi-nor/Makefile > +++ b/drivers/mtd/spi-nor/Makefile > @@ -3,7 +3,6 @@ obj-$(CONFIG_MTD_SPI_NOR) += spi-nor.o > obj-$(CONFIG_SPI_ASPEED_SMC) += aspeed-smc.o > obj-$(CONFIG_SPI_ATMEL_QUADSPI) += atmel-quadspi.o > obj-$(CONFIG_SPI_CADENCE_QUADSPI)+= cadence-quadspi.o > -obj-$(CONFIG_SPI_FSL_QUADSPI)+= fsl-quadspi.o > obj-$(CONFIG_SPI_HISI_SFC) += hisi-sfc.o > obj-$(CONFIG_MTD_MT81xx_NOR)+= mtk-quadspi.o > obj-$(CONFIG_SPI_NXP_SPIFI) += nxp-spifi.o > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7d3a5c9..8c84186 > 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -259,6 +259,17 @@ config SPI_FSL_LPSPI > help > This enables Freescale i.MX LPSPI controllers in master mode. > > +config SPI_FSL_QUADSPI > + tristate "Freescale QSPI controller" > + depends on ARCH_MXC || SOC_LS1021A || ARCH_LAYERSCAPE || > COMPILE_TEST > + depends on HAS_IOMEM > + help > + This enables support for the Quad SPI controller in master mode. > + Up to four flash chips can be connected on two buses with two > + chipselects each. > + This controller does not support generic SPI messages. It only > + supports the high-level SPI memory interface. > + > config SPI_GPIO > tristate "GPIO-based bitbanging SPI Master" > depends on GPIOLIB || COMPILE_TEST > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index > 3575205..5377e61 > 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -44,6 +44,7 @@ obj-$(CONFIG_SPI_FSL_DSPI) += spi-fsl- > dspi.o > obj-$(CONFIG_SPI_FSL_LIB)+= spi-fsl-lib.o > obj-$(CONFIG_SPI_FSL_ESPI) += spi-fsl-espi.o > obj-$(CONFIG_SPI_FSL_LPSPI) += spi-fsl-lpspi.o > +obj-$(CONFIG_SPI_FSL_QUADSPI)+= spi-fsl-qspi.o > obj-$(CONFIG_SPI_FSL_SPI)+= spi-fsl-spi.o > obj-$(CONFIG_SPI_GPIO) += spi-gpio.o > obj-$(CONFIG_SPI_IMG_SPFI) += spi-img-spfi.o > diff --git a/drivers/spi/spi-fsl-qspi.c b/drivers/spi/spi-fsl-qspi.c new file > mode > 100644 index 000..f0a3400 > --- /dev/null > +++ b/drivers/spi/spi-fsl-qspi.c > @@ -0,0 +1,966 @@ > +// SPDX-License-Identifier: GPL-2.0+ > + > +/* > + * Freescale QuadSPI driver. > + * > + *