From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E5D1C04AB1 for ; Sat, 11 May 2019 10:08:35 +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 3DB7D217D6 for ; Sat, 11 May 2019 10:08:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EnFATLkl"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="LtxOhFbU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3DB7D217D6 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+infradead-linux-riscv=archiver.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: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:In-Reply-To: References:List-Owner; bh=i3ckFO1ozuB1TBYIR2p0gNOqYIxAkHClnD0UX8AIyNY=; b=EnF ATLklQx4m0xBegLJBQ6EesN9YFE0pRYxpQI0oEFv6fUOaFxYcdi4voF4lJteRDCfsjXejfmIMHnk4 hr27vV9qxb0C+IwGBQ+SNo34c/FzGRsfkP21EXRBvUEmyiwt4eldVr4ERAP63yD54ZQ3g5DeTL3rO d5XeDHZinDWsM8kjZdpRey8Iy/8O/icOxAXGMSJPBziPkMYmiu0jQ2hF3SUnQM/3CvmuLr7YeT2tP wQY91lgXta9xoUycaFRs0LX2h2lt0P38pHi7/oRQIKOHXBo52NQVrt0k68wIx3ChsDJrwyJPeAbQQ 572dGdyB2C4ShoI9H9T0gyqj4bPUUGQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPOvg-0001b7-Kz; Sat, 11 May 2019 10:08:32 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPOvV-0001RO-TL for linux-riscv@lists.infradead.org; Sat, 11 May 2019 10:08:23 +0000 Received: by mail-pg1-x543.google.com with SMTP id a3so4236280pgb.3 for ; Sat, 11 May 2019 03:08:18 -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; bh=E5geVYX9r/xsvJ70+OdlPhioxAfQpMPDLT7rfOEjAm8=; b=LtxOhFbURtgfMCom19ZCiUacoeYWIn8cJxzwlQharVdF3wmpg5BQQuJgU2AKE3bD9y oB1oo/3YjImBtD6YKyU6JEGvVVLjyerFlIoZGngZwv0eWTTldIl2wXbsDaGIg6L983Tc x/TeeMqAXUoSn+6nWuTbZ2DkQ5EC6emHROz98kmohi824KJKuwujwozDF3m92yAEZEMH fJFNFo97kek7dQ+6ExSm+DYnPbVu59SlVr+o7L1OkplFl6m3qpCWGxGOL4Y2ce4jTEmY u+DbGyqPRGL5uzyhLEja+rJQ+pA0f4yoOSIZ7flZnPz/mU/aHc+jD7thzo4p1x83kcOM 76+w== 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; bh=E5geVYX9r/xsvJ70+OdlPhioxAfQpMPDLT7rfOEjAm8=; b=trTby6kwPelZyCGLCTASPHTwsyoYWlcODAnEPWtaMXB1wnlX0DJ9j5K4Vb2DDjTuK9 X/ELx5nqRD4CYWCB9o2flZ7vq/P6dWOovWS+cWcf0bHM+mdiaM9MsnYWSyPmFb9wMhin abD1NDbbuSrMVvPOG05wQkJ2eyx8dq7BsOdYHdHyk3EnmETLyQA9upWpkHPhXyhLGBXG bFE/SEn2ghnUfOKkbJwPxhTYf1Ki9Xky0y42F2ORZha+z+Qkhdgskwyz6bqvfpBG63V0 xaFw5cvrxFFGYrQ35kppzhqU932lXjcP6MPm8bbvXahBE0c55k6f5yooKilU1kKq6oBE srbw== X-Gm-Message-State: APjAAAU7DoVA5VASqsYCufenSgfP6oMpPZxIY5piImGUNn+X+EHSD+IL Vecz/fB1qX3Lqim3bPzVVTW3VA== X-Google-Smtp-Source: APXvYqzpwuyZCUbxoXTRRlV2LAERUlKeBv3bavf54tfet+HlCK62FtD1WBpOvt13aXglcRjgzEbdNQ== X-Received: by 2002:a62:6444:: with SMTP id y65mr21031241pfb.148.1557569298344; Sat, 11 May 2019 03:08:18 -0700 (PDT) Received: from buildserver-90.open-silicon.com ([114.143.65.226]) by smtp.googlemail.com with ESMTPSA id c129sm16951836pfg.178.2019.05.11.03.08.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 11 May 2019 03:08:17 -0700 (PDT) From: Sagar Shrikant Kadam To: marek.vasut@gmail.com, tudor.ambarus@microchip.com, dwmw2@infradead.org, computersforpeace@gmail.com, bbrezillon@kernel.org, richard@nod.at, palmer@sifive.com, aou@eecs.berkeley.edu, paul.walmsley@sifive.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v4 0/3] add support for is25wp256 spi-nor device. Date: Sat, 11 May 2019 15:38:05 +0530 Message-Id: <1557569288-19441-1-git-send-email-sagar.kadam@sifive.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190511_030822_009979_91826A80 X-CRM114-Status: GOOD ( 10.98 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sagar Shrikant Kadam MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org The patch set is tested on HiFive Unleashed board and is based on mainline kernel v5.1. Its intended to add support for 32 MB spi-nor flash mounted on the board. Memory Device supports 4/32/and 64 KB sectors size. The device id table is updated accordingly. Flash parameter table for ISSI device is set to use macronix_quad_enable procedure to set the QE (quad-enable) bit of Status register. A unilaterlay block unlocking scheme is added in patch 2. These patches are based on original work done by Wesley Terpstra and/or Palmer Dabbelt: https://github.com/riscv/riscv-linux/commit/c94e267766d62bc9a669611c3d0c8ed5ea26569b Erase/Read/Write operations are verified on HiFive Unleashed board using mtd and flash utils (v1.5.2): 1. mtd_debug :Options available are : erase/read/write. 2. flashcp :Single utility that erases flash, writes a file to flash and verifies the data back. 3. flash_unlock: Unlock flash memory blocks.Arguments: are offset and number of blocks. 3. flash_lock: Lock flash memory blocks. Arguments: are offset and number of blocks. Unlock scheme clears the protection bits of all blocks in the Status register. Lock scheme: A basic implementation based on stm_lock scheme and is validated for different number of blocks passed to flash_lock. ISSI devices have Top/Bottom area selection in "function register" which is OTP memory. Revision history: V3<->V4: -Extracted comman code and renamed few stm functions so that it can be reused for issi lock implementation. -Added function's to read and write FR register, for selecting Top/Bottom area. V2<->V3: -Rebased patch to mainline v5.1 from earlier v5.1-rc5 -Updated commit messages, and cover letter with reference to git URL and author information. -Deferred flash_lock mechanism and can go as separate patch. V1<-> V2: -Incorporated changes suggested by reviewers regarding patch/cover letter versioning, references of patch. -Updated cover letter with description for flash operations verified with these changes. -Add support for unlocking is25xxxxxx device -Add support for locking is25xxxxxx device. v1: -Add support for is25wp256 device. Sagar Shrikant Kadam (3): mtd: spi-nor: add support for is25wp256 mtd: spi-nor: add support to unlock flash device. mtd: spi-nor: add locking support for is25xxxxx device drivers/mtd/spi-nor/spi-nor.c | 345 +++++++++++++++++++++++++++++++++++------- include/linux/mtd/spi-nor.h | 7 + 2 files changed, 301 insertions(+), 51 deletions(-) -- 1.9.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv