[PATCH 2/2] mtd: spi-nor: Add driver for Cadence Quad SPI Flash Controller.
Graham Moore
grmoore at opensource.altera.com
Mon Aug 31 10:30:37 PDT 2015
Hi Marek,
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
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:701:12: error: function
declaration isn’t a prototype [-Werror=strict-prototypes]
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c: In function
‘cqspi_set_protocol’:
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:706:7: error:
‘SPI_PROTO_1_1_1’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:706:7: note: each
undeclared identifier is reported only once for each function it appears in
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:707:7: error:
‘SPI_PROTO_1_1_2’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:708:7: error:
‘SPI_PROTO_1_1_4’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:709:7: error:
‘SPI_PROTO_1_2_2’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:710:7: error:
‘SPI_PROTO_1_4_4’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:713:7: error:
‘SPI_PROTO_2_2_2’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:716:7: error:
‘SPI_PROTO_4_4_4’ undeclared (first use in this function)
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c: In function
‘cqspi_setup_flash’:
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:1087:6: error: ‘struct
spi_nor’ has no member named ‘dn’
~/l2-mtd/drivers/mtd/spi-nor/cadence-quadspi.c:1096:6: error: ‘struct
spi_nor’ has no member named ‘set_protocol’
[...]
Regards,
Graham
More information about the linux-mtd
mailing list