From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jagan Teki Date: Mon, 15 Feb 2016 02:18:00 +0530 Subject: [U-Boot] [PATCH v6 01/76] mtd: Add m25p80 driver Message-ID: <1455482955-19053-1-git-send-email-jteki@openedev.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This is MTD SPI-NOR driver for ST M25Pxx (and similar) serial flash chips which is written as MTD_UCLASS. More features will be adding on further patches. Cc: Simon Glass Cc: Bin Meng Cc: Mugunthan V N Cc: Michal Simek Cc: Siva Durga Prasad Paladugu Signed-off-by: Jagan Teki --- Makefile | 1 + drivers/mtd/spi-nor/Makefile | 6 ++++++ drivers/mtd/spi-nor/m25p80.c | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 drivers/mtd/spi-nor/Makefile create mode 100644 drivers/mtd/spi-nor/m25p80.c diff --git a/Makefile b/Makefile index 430dd4f..f299a24 100644 --- a/Makefile +++ b/Makefile @@ -637,6 +637,7 @@ libs-$(CONFIG_CMD_NAND) += drivers/mtd/nand/ libs-y += drivers/mtd/onenand/ libs-$(CONFIG_CMD_UBI) += drivers/mtd/ubi/ libs-y += drivers/mtd/spi/ +libs-y += drivers/mtd/spi-nor/ libs-y += drivers/net/ libs-y += drivers/net/phy/ libs-y += drivers/pci/ diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile new file mode 100644 index 0000000..a4c19e3 --- /dev/null +++ b/drivers/mtd/spi-nor/Makefile @@ -0,0 +1,6 @@ +# +# Copyright (C) 2016 Jagan Teki +# +# SPDX-License-Identifier: GPL-2.0+ + +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..833a9c3 --- /dev/null +++ b/drivers/mtd/spi-nor/m25p80.c @@ -0,0 +1,37 @@ +/* + * MTD SPI-NOR driver for ST M25Pxx (and similar) serial flash chips + * + * Copyright (C) 2016 Jagan Teki + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include +#include + +static int m25p_probe(struct udevice *dev) +{ + struct spi_slave *spi = dev_get_parent_priv(dev); + struct mtd_info *mtd = dev_get_uclass_priv(dev); + + return 0; +} + +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, +}; -- 1.9.1