From patchwork Wed Sep 18 16:01:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 11150649 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4E9714ED for ; Wed, 18 Sep 2019 16:02:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B205C207FC for ; Wed, 18 Sep 2019 16:02:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Qhujajju"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="NLPFJ4H0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B205C207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wgg1IiLr3DXEOAeqES3jL4Wi+c+CW3cFDkiY0h2DdPM=; b=QhujajjuOlag6/gPKpC3YpsoQj IvP21O9T2WahuzmEL9t8xeJDw+1SlTauz5u+sRVAnQvzR62klS0/x1/iRGVbfKcDJ0eNjYYKJstes xON9NZmqJra5yjJTRIGgs8LTSIfilZ5yvBOGR5GrXU9mlHXO/oZo24WmlAdaCUai2cnhBh8YsyxXj crIquBdNJn0P/1S10fVcmEW9NcIVEXDwcXK6FncqWbj6LokNBOH7Wv3wF1jsTsfh+nb6mhUnqjotr BCnqM067m3vvLzH3h8MZG5WrttI5ELM01lPjgFPYOLs7DY+aaze2wYgux03Mzkbg9onffZ0+zp14M U5aH3tvQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAcPt-0007hW-1U; Wed, 18 Sep 2019 16:02:53 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAcPa-0007U8-0W for linux-riscv@lists.infradead.org; Wed, 18 Sep 2019 16:02:35 +0000 Received: by mail-pf1-x443.google.com with SMTP id q21so244080pfn.11 for ; Wed, 18 Sep 2019 09:02:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x/hOHLuin26MPrIrFSxVodQBfjvOevhYq+l2qnUtb4s=; b=NLPFJ4H0KYYWxV3pQaf6UPLJT5yOe2Z9mc8KjdbFMglhBxFeEQqRaXBFL1FuONKFuP LtZ8e4sGexom6Wfnf4zMIOCuNksF3PxbFOEggvk84aA483J2v8FXBtq9HKu1SO+XhEHY K7XZwjXvtTf01Gsc2jdjCc+BuepCKtwVksaw6Pwc8sGUyDYFy36zzKCo/eL/DZur+pLK u2zovlIoxYeTiAR6ZKEAwG6BDwhQvTE2Y6d7YxdWerUzzV2ZgZ9dcHLSnyU30fYkrfHU wd29GJsVRBrNGPgKc98MJq//C0IiIP+VM5nQrCjIxWOVNkA6wpJL8+9SrfgZowQ4xRh+ MNpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x/hOHLuin26MPrIrFSxVodQBfjvOevhYq+l2qnUtb4s=; b=bADxphaajC5gl3TidniIk4GIWfSv8RoVGmvmUOWtaEvgaNfnLkQEuG5KALbU2N1scB lqio/03D7VP+RsKQ+3vPzFTaoBJjcNOZ5oYy54BR957fG+Jw7OJGuWBXOI7Ed7Ta7KgI vLfM6Kv7XKMm7jZcN4Igw7g8yUcrqZpz9wRJvG/7Q2I/C5gmCNREmcWM16Flsb+huRUC lmIo/NdjBriiQcqCmt8RXF6JM9OPTiuUtyPefKMWTNmDyQpq8HbK29k6ttlPuxh7J0h4 Cqob7CU1M1FpZtN9M3VHqUR6IJH0Id+o5YZkFxm92J3APvUkILxJMM5bi4UH5gnll2vn bJgQ== X-Gm-Message-State: APjAAAVSCuOZjMk0wrQ2pQueFTig+Lby0mwL2UEi14ofhLkva4wJoSko q2IwDtLZ11OIkFaQpb6UBSFooQ== X-Google-Smtp-Source: APXvYqyTb59K5tEHA9jKBr9DDK6Fol9hLY0ADaMXEbmWN9Vrrd8hcj+iGvecx5mGfHulwlg9Srchew== X-Received: by 2002:a65:5543:: with SMTP id t3mr4674553pgr.242.1568822553580; Wed, 18 Sep 2019 09:02:33 -0700 (PDT) Received: from buildserver-90.open-silicon.com ([114.143.65.226]) by smtp.googlemail.com with ESMTPSA id g12sm9872379pfb.97.2019.09.18.09.02.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Sep 2019 09:02:33 -0700 (PDT) From: Sagar Shrikant Kadam To: marek.vasut@gmail.com, tudor.ambarus@microchip.com, dwmw2@infradead.org, computersforpeace@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: [PATCH v9 1/2] mtd: spi-nor: add support for is25wp256 Date: Wed, 18 Sep 2019 21:31:44 +0530 Message-Id: <1568822505-19297-2-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1568822505-19297-1-git-send-email-sagar.kadam@sifive.com> References: <1568822505-19297-1-git-send-email-sagar.kadam@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_090234_287581_D25DABE5 X-CRM114-Status: GOOD ( 11.50 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aou@eecs.berkeley.edu, palmer@sifive.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Sagar Shrikant Kadam , paul.walmsley@sifive.com, linux-riscv@lists.infradead.org MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Update spi_nor_id table for is25wp256 (32MB) device from ISSI, present on HiFive Unleashed dev board (Rev: A00). Set method to enable quad mode for ISSI device in flash parameters table. Based on code originally written by Wesley Terpstra and/or Palmer Dabbelt https://github.com/riscv/riscv-linux/commit/c94e267766d62bc9a669611c3d0c8ed5ea26569b Signed-off-by: Sagar Shrikant Kadam Reviewed-by: Vignesh Raghavendra --- drivers/mtd/spi-nor/spi-nor.c | 9 ++++++++- include/linux/mtd/spi-nor.h | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 654bdc4..003c1c7 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1946,7 +1946,10 @@ static int spi_nor_spansion_clear_sr_bp(struct spi_nor *nor) SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "is25wp128", INFO(0x9d7018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - + { "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_4B_OPCODES) + }, /* Macronix */ { "mx25l512e", INFO(0xc22010, 0, 64 * 1024, 1, SECT_4K) }, { "mx25l2005a", INFO(0xc22012, 0, 64 * 1024, 4, SECT_4K) }, @@ -3776,6 +3779,10 @@ static int spi_nor_init_params(struct spi_nor *nor, case SNOR_MFR_ST: case SNOR_MFR_MICRON: break; + case SNOR_MFR_ISSI: + params->quad_enable = macronix_quad_enable; + break; + default: /* Kept only for backward compatibility purpose. */ diff --git a/include/linux/mtd/spi-nor.h b/include/linux/mtd/spi-nor.h index 9f57cdf..5d6583e 100644 --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h @@ -21,6 +21,7 @@ #define SNOR_MFR_INTEL CFI_MFR_INTEL #define SNOR_MFR_ST CFI_MFR_ST /* ST Micro */ #define SNOR_MFR_MICRON CFI_MFR_MICRON /* Micron */ +#define SNOR_MFR_ISSI 0x9d /* ISSI */ #define SNOR_MFR_MACRONIX CFI_MFR_MACRONIX #define SNOR_MFR_SPANSION CFI_MFR_AMD #define SNOR_MFR_SST CFI_MFR_SST From patchwork Wed Sep 18 16:01:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagar Shrikant Kadam X-Patchwork-Id: 11150651 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1185B1747 for ; Wed, 18 Sep 2019 16:03:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DEE95207FC for ; Wed, 18 Sep 2019 16:03:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="TUF/pnd4"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="lHwAihyQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEE95207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=h1Q1ms/kp6Aol5S67C497NKKspHSj17TOZ8WonyDb4o=; b=TUF/pnd4lA1vJnxiEof88jeSmO yyH1uy1pNofxPTicjZ/JfecemKvTkX1BBlt4jw3yCEhGg5/48CDQ9i3cic70xW8eLMMuAen7Mx/zV Gy5TywHG/XFdRTlrl1osMQ1KSTdbVDUxmxmtMpTxJRj5tRE0ZhReQS75wxo0Bqdxg+tPorifF2T0/ xTy24f8RaNCpKiuy/itouxF62wP9v0NZT6S0RiwF5Cvf43r7wmh5b0v3ID0cg6AOtzlP5UZdoY0yK nJuPMURx4y84453amIHbdk7v+O+15lhjrhM7/m8rhJIbUmTaFyCsiDmewj1yCHTjA5AKifJibq1xJ tsq1BRIQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAcQA-0007yA-7F; Wed, 18 Sep 2019 16:03:10 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAcPg-0007YZ-VA for linux-riscv@lists.infradead.org; Wed, 18 Sep 2019 16:02:42 +0000 Received: by mail-pg1-x542.google.com with SMTP id a24so110916pgj.2 for ; Wed, 18 Sep 2019 09:02:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GmcLSQu6EQAPA4h2lTeOhp0gk5DIW9Hi/4PZD6ne2GI=; b=lHwAihyQ01mNJtRlkEW+zkPVzH7UN8YNJXaBctlQNpIunIvVg6WN0WEdXI8t5rk2Bi RUrfAstL9JVlFpP/c3KOvWqDNzrtR7+IYAS7TGcOoB46wOLsdiXhx1uuo0MWNqsHm9V7 h3w2jHTh10BIcHn4CDyjqjbNZCdCCyQhafdFmzvxsC7i/5YRosUbwiwdaF8XZoZ/Ikmt 4qI+8/4UTWN9tlpuJGLujevehagKhBMf7TgEJBy3gpC9MDHln5DN6jtkSOOxYLz8F7Jb g4S9sB51TTBrRobOH22E+ccjjnVfhGuoxzGV3N4Ze3FC5JzVyvwAnGspg3cF/W3bdQqf lyUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GmcLSQu6EQAPA4h2lTeOhp0gk5DIW9Hi/4PZD6ne2GI=; b=gxv/NPlAkVDFYMXvo6Wsftmlmu5U7CghVjFBVUH6rKLAcMwwnBLraWW/TQlBUAIb8m gr+1YLLltwiHpLa7muTTqR+wwYE1W6O2mtG+FR5+xDidZbBf4GIIuZ5xehL9cnPNHmR1 mxArhgfkBExCMWrrgybOAD/gvdy1f+uuvDSdtequ6Dxte7U7jxElPxCkZWbcqsEAZlUh nz1SSETLBxNxEV83j6Gsb6L4M+pyzEUVD3KTak3Q+JiOiXhfCG4wBPZfu12VrUoQPPoi YOjpXhS/Mfk8EGcvJAjUyKEuj56C/Qqdfd6GuDaUAl25e5lmGjrftaz95Is2AoimS185 +oKw== X-Gm-Message-State: APjAAAUsRdImI/ZTd6z6GB3zTF+KPATbO9eNqC1FpXMxSs5IBIh8FUD/ Q20bLtGn9nitEGDd90a44jFRqQ== X-Google-Smtp-Source: APXvYqxqsqKgZ2IZgToJhuCvJIAOwPTlNQxrTbdYExiHkeaBfu8MCmPQqWqbRpaNvkXeYJ5WvqewIg== X-Received: by 2002:aa7:8005:: with SMTP id j5mr5077266pfi.50.1568822560215; Wed, 18 Sep 2019 09:02:40 -0700 (PDT) Received: from buildserver-90.open-silicon.com ([114.143.65.226]) by smtp.googlemail.com with ESMTPSA id g12sm9872379pfb.97.2019.09.18.09.02.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Sep 2019 09:02:39 -0700 (PDT) From: Sagar Shrikant Kadam To: marek.vasut@gmail.com, tudor.ambarus@microchip.com, dwmw2@infradead.org, computersforpeace@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: [PATCH v9 2/2] mtd: spi-nor: fix nor->addr_width for is25wp256 Date: Wed, 18 Sep 2019 21:31:45 +0530 Message-Id: <1568822505-19297-3-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1568822505-19297-1-git-send-email-sagar.kadam@sifive.com> References: <1568822505-19297-1-git-send-email-sagar.kadam@sifive.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_090241_326270_93DB00FB X-CRM114-Status: GOOD ( 11.13 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:542 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aou@eecs.berkeley.edu, palmer@sifive.com, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, Sagar Shrikant Kadam , paul.walmsley@sifive.com, linux-riscv@lists.infradead.org MIME-Version: 1.0 Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org Use the post bfpt fixup hook for the is25wp256 device as done for is25lp256 device to overwrite the address width advertised by BFPT. For instance the standard devices eg: IS25WP256D-JMLE where J stands for "standard" does not support SFDP. Signed-off-by: Sagar Shrikant Kadam Reviewed-by: Vignesh Raghavendra --- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 003c1c7..75e8560 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1949,7 +1949,7 @@ static int spi_nor_spansion_clear_sr_bp(struct spi_nor *nor) { "is25wp256", INFO(0x9d7019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) - }, + .fixups = &is25lp256_fixups }, /* Macronix */ { "mx25l512e", INFO(0xc22010, 0, 64 * 1024, 1, SECT_4K) }, { "mx25l2005a", INFO(0xc22012, 0, 64 * 1024, 4, SECT_4K) },