On Sun, May 17, 2020 at 12:54 PM Rayagonda Kokatanur <[email protected]> wrote: > > Add brcm iproc qspi support. > > Signed-off-by: Rayagonda Kokatanur <[email protected]> > --- > Changes from v1: > -Address review comments from Jagan Teki, > Remove flash opcode from driver and use include/linux/mtd/spi-nor.h, > Remove CONFIG_BCM_IPROC_USE_BSPI, handle via driver data > > -Address self review comments, > Remove REG_WR, REG_RD, REG_SET, REG_CLR and use writel, readl, > setbits_le32 and clrbits_le32 respectively, > Rename priv data struct variables mspi_hw. bspi_hw, bspi_hw_raf to > mspi, bspi, baspi_raf respectively, > Remove struct bcmspi_platdata. > > drivers/spi/Kconfig | 6 + > drivers/spi/Makefile | 1 + > drivers/spi/iproc_qspi.c | 808 +++++++++++++++++++++++++++++++++++++++ > drivers/spi/iproc_qspi.h | 18 + > drivers/spi/iproc_spi.c | 71 ++++ > 5 files changed, 904 insertions(+) > create mode 100644 drivers/spi/iproc_qspi.c > create mode 100644 drivers/spi/iproc_qspi.h > create mode 100644 drivers/spi/iproc_spi.c > > diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig > index 4166c6104e..3b827b3346 100644 > --- a/drivers/spi/Kconfig > +++ b/drivers/spi/Kconfig > @@ -148,6 +148,12 @@ config ICH_SPI > access the SPI NOR flash on platforms embedding this Intel > ICH IP core. > > +config IPROC_QSPI > + bool "QSPI driver for BCM iProc QSPI Controller" > + help > + This selects the BCM iProc QSPI controller. > + This driver support spi flash single, quad and memory reads. > + > config MESON_SPIFC > bool "Amlogic Meson SPI Flash Controller driver" > depends on ARCH_MESON > diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile > index 52462e19a3..359f6a87cb 100644 > --- a/drivers/spi/Makefile > +++ b/drivers/spi/Makefile > @@ -32,6 +32,7 @@ obj-$(CONFIG_FSL_DSPI) += fsl_dspi.o > obj-$(CONFIG_FSL_ESPI) += fsl_espi.o > obj-$(CONFIG_FSL_QSPI) += fsl_qspi.o > obj-$(CONFIG_ICH_SPI) += ich.o > +obj-$(CONFIG_IPROC_QSPI) += iproc_qspi.o > obj-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o > obj-$(CONFIG_LPC32XX_SSP) += lpc32xx_ssp.o > obj-$(CONFIG_MESON_SPIFC) += meson_spifc.o > diff --git a/drivers/spi/iproc_qspi.c b/drivers/spi/iproc_qspi.c > new file mode 100644 > index 0000000000..037f5be315 > --- /dev/null > +++ b/drivers/spi/iproc_qspi.c > @@ -0,0 +1,808 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +/* > + * Copyright 2020 Broadcom > + */ > + > +#include <common.h> > +#include <dm.h> > +#include <errno.h> > +#include <malloc.h> > +#include <spi.h> > +#include <asm/io.h> > +#include <linux/err.h> > +#include <linux/mtd/spi-nor.h>
Please note that this is SPI driver not flash specifically. We cannot use flash side attributes or logic in spi master driver. If this driver truly spi-nor flash specific driver then write it on MTD side using UCLASS_SPI_FLASH. Jagan.

