diff mbox

[RFC,v2,5/6] spi: Add QuadSPI driver for Atmel SAMA5D2

Message ID 20180627131609.13681-6-bugalski.piotr@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Piotr Bugalski June 27, 2018, 1:16 p.m. UTC
Kernel contains QSPI driver strongly tied to MTD and nor-flash memory.
New spi-mem interface allows usage also other memory types, especially
much larger NAND with SPI interface. This driver works as SPI controller
and is not related to MTD, however can work with NAND-flash or other
peripherals using spi-mem interface.

Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Piotr Bugalski <pbu@cryptera.com>
---
 drivers/mtd/spi-nor/Kconfig                  | 9 ---------
 drivers/mtd/spi-nor/Makefile                 | 1 -
 drivers/spi/Kconfig                          | 9 +++++++++
 drivers/spi/Makefile                         | 1 +
 drivers/{mtd/spi-nor => spi}/atmel-quadspi.c | 0
 5 files changed, 10 insertions(+), 10 deletions(-)
 rename drivers/{mtd/spi-nor => spi}/atmel-quadspi.c (100%)

Comments

Mark Brown Aug. 1, 2018, 5:27 p.m. UTC | #1
On Wed, Jun 27, 2018 at 03:16:08PM +0200, Piotr Bugalski wrote:
> Kernel contains QSPI driver strongly tied to MTD and nor-flash memory.
> New spi-mem interface allows usage also other memory types, especially
> much larger NAND with SPI interface. This driver works as SPI controller
> and is not related to MTD, however can work with NAND-flash or other
> peripherals using spi-mem interface.

This is fine from a SPI point of view but I'd like to apply it directly
to the SPI tree rather than ack it for merge via the MTD tree - can we
work something out with a shared branch or something?
Boris Brezillon Aug. 1, 2018, 7:57 p.m. UTC | #2
Hi Mark,

On Wed, 1 Aug 2018 18:27:47 +0100
Mark Brown <broonie@kernel.org> wrote:

> On Wed, Jun 27, 2018 at 03:16:08PM +0200, Piotr Bugalski wrote:
> > Kernel contains QSPI driver strongly tied to MTD and nor-flash memory.
> > New spi-mem interface allows usage also other memory types, especially
> > much larger NAND with SPI interface. This driver works as SPI controller
> > and is not related to MTD, however can work with NAND-flash or other
> > peripherals using spi-mem interface.  
> 
> This is fine from a SPI point of view

Cool. There are still 2 things I think should be addressed before
merging the driver:
1/ Fixing the SoB tag to match the author (problem reported by
   Alexandre)
2/ Getting this patch [1] merged and implementing the ->get_name() hook
   in this driver so that SPI NOR devs declared to the MTD layer keep
   the same name after the transition to spi-mem and mtdparts= passed on
   the cmdline keep working. Without this in place we're likely to
   break a few setups :-/.

> but I'd like to apply it directly
> to the SPI tree rather than ack it for merge via the MTD tree - can we
> work something out with a shared branch or something?

Sure, I can provide an immutable tag for you to pull and I'll add my
acks on those patches once the 2 things I mentioned above are
addressed.

Regards,

Boris

[1]https://patchwork.kernel.org/patch/10508693/ 

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Aug. 2, 2018, 10:17 a.m. UTC | #3
On Wed, Aug 01, 2018 at 09:57:33PM +0200, Boris Brezillon wrote:
> Mark Brown <broonie@kernel.org> wrote:

> 2/ Getting this patch [1] merged and implementing the ->get_name() hook
>    in this driver so that SPI NOR devs declared to the MTD layer keep
>    the same name after the transition to spi-mem and mtdparts= passed on
>    the cmdline keep working. Without this in place we're likely to
>    break a few setups :-/.

> [1]https://patchwork.kernel.org/patch/10508693/ 

I don't seem to have a copy of this patch...  not sure it was sent to
me?
Frieder Schrempf Aug. 2, 2018, 10:46 a.m. UTC | #4
Hi Mark,

On 02.08.2018 12:17, Mark Brown wrote:
> On Wed, Aug 01, 2018 at 09:57:33PM +0200, Boris Brezillon wrote:
>> Mark Brown <broonie@kernel.org> wrote:
> 
>> 2/ Getting this patch [1] merged and implementing the ->get_name() hook
>>     in this driver so that SPI NOR devs declared to the MTD layer keep
>>     the same name after the transition to spi-mem and mtdparts= passed on
>>     the cmdline keep working. Without this in place we're likely to
>>     break a few setups :-/.
> 
>> [1]https://patchwork.kernel.org/patch/10508693/
> 
> I don't seem to have a copy of this patch...  not sure it was sent to
> me?

When I sent the patch I put you in cc. So if nothing went wrong you 
should have it.
It is part of the SPI MEM conversion series for the FSL QSPI driver [1].

Boris made some remarks on documentation in v2, that I have fixed, but 
not sent out yet, as we have some blocking issues with the driver itself.

So if you want I could send the patch separately so it can be applied 
with the Atmel driver.

Regards,
Frieder

[1] https://patchwork.ozlabs.org/cover/939864/
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mark Brown Aug. 2, 2018, 11:46 a.m. UTC | #5
On Thu, Aug 02, 2018 at 12:46:36PM +0200, Frieder Schrempf wrote:
> On 02.08.2018 12:17, Mark Brown wrote:

> > I don't seem to have a copy of this patch...  not sure it was sent to
> > me?

> When I sent the patch I put you in cc. So if nothing went wrong you should
> have it.
> It is part of the SPI MEM conversion series for the FSL QSPI driver [1].

Well, I can't find any references to it anywhere so yeah.

> So if you want I could send the patch separately so it can be applied with
> the Atmel driver.

I'm going to need a copy to review it.
Boris Brezillon Aug. 2, 2018, 11:48 a.m. UTC | #6
On Thu, 2 Aug 2018 12:46:36 +0200
Frieder Schrempf <frieder.schrempf@exceet.de> wrote:

> Hi Mark,
> 
> On 02.08.2018 12:17, Mark Brown wrote:
> > On Wed, Aug 01, 2018 at 09:57:33PM +0200, Boris Brezillon wrote:  
> >> Mark Brown <broonie@kernel.org> wrote:  
> >   
> >> 2/ Getting this patch [1] merged and implementing the ->get_name() hook
> >>     in this driver so that SPI NOR devs declared to the MTD layer keep
> >>     the same name after the transition to spi-mem and mtdparts= passed on
> >>     the cmdline keep working. Without this in place we're likely to
> >>     break a few setups :-/.  
> >   
> >> [1]https://patchwork.kernel.org/patch/10508693/  
> > 
> > I don't seem to have a copy of this patch...  not sure it was sent to
> > me?  
> 
> When I sent the patch I put you in cc. So if nothing went wrong you 
> should have it.
> It is part of the SPI MEM conversion series for the FSL QSPI driver [1].
> 
> Boris made some remarks on documentation in v2, that I have fixed, but 
> not sent out yet, as we have some blocking issues with the driver itself.

I don't remember where we were stuck. Are you still waiting answers
from Yogesh? Probably a good time to ping him if that's the case ;-).

> 
> So if you want I could send the patch separately so it can be applied 
> with the Atmel driver.

Yes please, send a v3 for patch 1 and 2.
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
index 6cc9c929ff57..44fe8018733c 100644
--- a/drivers/mtd/spi-nor/Kconfig
+++ b/drivers/mtd/spi-nor/Kconfig
@@ -39,15 +39,6 @@  config SPI_ASPEED_SMC
 	  and support for the SPI flash memory controller (SPI) for
 	  the host firmware. The implementation only supports SPI NOR.
 
-config SPI_ATMEL_QUADSPI
-	tristate "Atmel Quad SPI Controller"
-	depends on ARCH_AT91 || (ARM && COMPILE_TEST)
-	depends on OF && HAS_IOMEM
-	help
-	  This enables support for the Quad SPI controller in master mode.
-	  This driver does not support generic SPI. The implementation only
-	  supports SPI NOR.
-
 config SPI_CADENCE_QUADSPI
 	tristate "Cadence Quad SPI controller"
 	depends on OF && (ARM || ARM64 || COMPILE_TEST)
diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
index f4c61d282abd..a552efd22958 100644
--- a/drivers/mtd/spi-nor/Makefile
+++ b/drivers/mtd/spi-nor/Makefile
@@ -1,7 +1,6 @@ 
 # SPDX-License-Identifier: GPL-2.0
 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
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index ad5d68e1dab7..88f9c007d825 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -83,6 +83,15 @@  config SPI_ATMEL
 	  This selects a driver for the Atmel SPI Controller, present on
 	  many AT91 ARM chips.
 
+config SPI_ATMEL_QUADSPI
+	tristate "Atmel Quad SPI Controller"
+	depends on ARCH_AT91 || (ARM && COMPILE_TEST)
+	depends on OF && HAS_IOMEM
+	help
+	  This enables support for the Quad SPI controller in master mode.
+	  This driver does not support generic SPI. The implementation only
+	  supports spi-mem interface.
+
 config SPI_AU1550
 	tristate "Au1550/Au1200/Au1300 SPI Controller"
 	depends on MIPS_ALCHEMY
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index cb1f4378b87c..1a08e5bfcee9 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -16,6 +16,7 @@  obj-$(CONFIG_SPI_LOOPBACK_TEST)		+= spi-loopback-test.o
 obj-$(CONFIG_SPI_ALTERA)		+= spi-altera.o
 obj-$(CONFIG_SPI_ARMADA_3700)		+= spi-armada-3700.o
 obj-$(CONFIG_SPI_ATMEL)			+= spi-atmel.o
+obj-$(CONFIG_SPI_ATMEL_QUADSPI)		+= atmel-quadspi.o
 obj-$(CONFIG_SPI_ATH79)			+= spi-ath79.o
 obj-$(CONFIG_SPI_AU1550)		+= spi-au1550.o
 obj-$(CONFIG_SPI_AXI_SPI_ENGINE)	+= spi-axi-spi-engine.o
diff --git a/drivers/mtd/spi-nor/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
similarity index 100%
rename from drivers/mtd/spi-nor/atmel-quadspi.c
rename to drivers/spi/atmel-quadspi.c