From patchwork Wed Feb 10 19:07:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 581549 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 471A7140325 for ; Thu, 11 Feb 2016 06:10:20 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E9E24BFB2; Wed, 10 Feb 2016 20:10:19 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lGZECXcCEZCd; Wed, 10 Feb 2016 20:10:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9A4E34BA81; Wed, 10 Feb 2016 20:10:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B76D04BDBD for ; Wed, 10 Feb 2016 20:10:16 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4iHYQJNg-2Ns for ; Wed, 10 Feb 2016 20:10:16 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by theia.denx.de (Postfix) with ESMTPS id 43C014BA81 for ; Wed, 10 Feb 2016 20:10:13 +0100 (CET) Received: by mail-pf0-f194.google.com with SMTP id w128so796054pfb.2 for ; Wed, 10 Feb 2016 11:10:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oF3xqRrEUobSxTezsE6Kj1U3xxSL0Y2VmxZbC7wVeOU=; b=GnDEZPpeHHlql5Z1wIWv1gNBsCiCbKa2CoecHIM22P/SUxGs9RcQBe8w0Lp7veegha LPquhKfcqFqZFo7r69bnGY0FioIVXy2f7sj0Bfpdzbnn0Jt24y8Va14RGChOQVJh0lYN 4SrnryZyQSyuxyl/gsMLitTmAMdrqglagW19YihNoV6X7lH2DbcVRsE8LD+ZhD8LGBmb 3fQzBXFPg+Z+jJqW1LNMG9kubNUCv35ONlINB5gsXfcrlfx+VHx14c3XUv55fPgbCmzd f8CKE61ZkfNqX64yEYZtqVmx4j/mSlGf3ChyJf3QT/7z5Hk30vNY8S2BkC3GRuUIdyU5 Ir5g== X-Gm-Message-State: AG10YOTRX03hTfk1ut6BnGuWgmi9lQ2Mn+Ocb2rrwn356kH+6xbpFh1xOLsFkU0CfJ9d8Q== X-Received: by 10.98.10.65 with SMTP id s62mr61040783pfi.119.1455131412044; Wed, 10 Feb 2016 11:10:12 -0800 (PST) Received: from localhost.localdomain ([123.236.183.254]) by smtp.gmail.com with ESMTPSA id n78sm6915903pfb.53.2016.02.10.11.10.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Feb 2016 11:10:10 -0800 (PST) From: Jagan Teki To: u-boot@lists.denx.de Date: Thu, 11 Feb 2016 00:37:56 +0530 Message-Id: <1455131307-25406-2-git-send-email-jteki@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1455131307-25406-1-git-send-email-jteki@openedev.com> References: <1455131307-25406-1-git-send-email-jteki@openedev.com> Cc: Tom Rini , Michal Simek , Siva Durga Prasad Paladugu , Jagan Teki Subject: [U-Boot] [PATCH v5 01/32] mtd: Add m25p80 driver X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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, +};