[U-Boot] [PATCH v9 12/21] mtd: spi-nor: Add m25p80 driver

Simon Glass sjg at chromium.org
Sat Nov 5 17:10:08 CET 2016


Hi Jagan,

On 30 October 2016 at 12:23, Jagan Teki <jagan at openedev.com> wrote:
> This is MTD SPI-NOR driver for ST M25Pxx (and similar)
> serial flash chips which is written as MTD_UCLASS.
>
> Signed-off-by: Jagan Teki <jagan at openedev.com>
> ---
>  drivers/mtd/spi-nor/Makefile |   3 +
>  drivers/mtd/spi-nor/m25p80.c | 217 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 220 insertions(+)
>  create mode 100644 drivers/mtd/spi-nor/m25p80.c
>
> diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
> index 15e43ea..d11ccf4 100644
> --- a/drivers/mtd/spi-nor/Makefile
> +++ b/drivers/mtd/spi-nor/Makefile
> @@ -7,3 +7,6 @@
>  ifdef CONFIG_MTD_SPI_NOR
>  obj-y  += spi-nor.o spi-nor-ids.o
>  endif
> +
> +## spi-nor to spi interface driver
> +obj-$(CONFIG_MTD_M25P80)       += m25p80.o
> diff --git a/drivers/mtd/spi-nor/m25p80.c b/drivers/mtd/spi-nor/m25p80.c
> new file mode 100644
> index 0000000..740d3f6
> --- /dev/null
> +++ b/drivers/mtd/spi-nor/m25p80.c

[...]

> +static const struct udevice_id m25p_ids[] = {
> +       /*
> +        * Generic compatibility for SPI NOR that can be identified by the
> +        * JEDEC READ ID opcode (0x9F). Use this, if possible.
> +        */
> +       { .compatible = "jedec,spi-nor" },
> +       { }
> +};
> +
> +U_BOOT_DRIVER(m25p80) = {
> +       .name           = "m25p80",
> +       .id             = UCLASS_MTD,
> +       .of_match       = m25p_ids,
> +       .probe          = m25p_probe,
> +       .priv_auto_alloc_size = sizeof(struct m25p),

Should this not have some MTD operations from the UCLASS_MTD? i.e.
struct dm_mtd_ops?

> +};
> --
> 2.7.4
>

Regards,
Simon


More information about the U-Boot mailing list