[PATCH 2/2] mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller.
Marek Vasut
marex at denx.de
Mon Aug 31 15:36:22 PDT 2015
On Monday, August 31, 2015 at 07:30:37 PM, Graham Moore wrote:
> Hi Marek,
Hi Graham,
> Having some compile issues...see below
>
> On 08/21/2015 04:20 AM, Marek Vasut wrote:
> > From: Graham Moore <grmoore at opensource.altera.com>
> >
> > Add support for the Cadence QSPI controller. This controller is
> > present in the Altera SoCFPGA SoCs and this driver has been tested
> > on the Cyclone V SoC.
> >
> > Signed-off-by: Graham Moore <grmoore at opensource.altera.com>
> > Signed-off-by: Marek Vasut <marex at denx.de>
>
> [...]
>
> > +static int cqspi_set_protocol(struct spi_nor *nor, enum spi_protocol
> > proto) +{
> > + struct cqspi_flash_pdata *f_pdata = nor->priv;
> > +
> > + switch (proto) {
> > + case SPI_PROTO_1_1_1:
> > + case SPI_PROTO_1_1_2:
> > + case SPI_PROTO_1_1_4:
> > + case SPI_PROTO_1_2_2:
> > + case SPI_PROTO_1_4_4:
> > + f_pdata->inst_width = CQSPI_INST_TYPE_SINGLE;
> > + break;
> > + case SPI_PROTO_2_2_2:
> > + f_pdata->inst_width = CQSPI_INST_TYPE_DUAL;
> > + break;
> > + case SPI_PROTO_4_4_4:
> > + f_pdata->inst_width = CQSPI_INST_TYPE_QUAD;
> > + break;
> > + default:
> > + return -EINVAL;
> > + }
> > +
> > + switch (proto) {
> > + case SPI_PROTO_1_1_1:
> > + case SPI_PROTO_1_1_2:
> > + case SPI_PROTO_1_1_4:
> > + f_pdata->addr_width = CQSPI_INST_TYPE_SINGLE;
> > + break;
> > + case SPI_PROTO_1_2_2:
> > + case SPI_PROTO_2_2_2:
> > + f_pdata->addr_width = CQSPI_INST_TYPE_DUAL;
> > + break;
> > + case SPI_PROTO_1_4_4:
> > + case SPI_PROTO_4_4_4:
> > + f_pdata->addr_width = CQSPI_INST_TYPE_QUAD;
> > + break;
> > + default:
> > + return -EINVAL;
> > + }
> > +
> > + return 0;
> > +}
> > +
>
> I think you have some other patches in your tree, the above doesn't
> compile on l2-mtd/master:
>
> ~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:701:57: warning: ‘enum
> spi_protocol’ declared inside parameter list [enabled by default]
> ~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:701:57: warning: its
> scope is only this definition or declaration, which is probably not what
> you want [enabled by default]
> ~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:701:70: error: parameter
> 2 (‘proto’) has incomplete type
It's in the V7 changelog, you need:
mtd: spi-nor: notify (Q)SPI controller about protocol change
Also, since V8, you will need:
mtd: spi-nor: Decouple SPI NOR's device_node from controller device
They're both in the linux-mtd list, so feel free to pick them from there.
More information about the linux-mtd
mailing list