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 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0178FC4332F for ; Wed, 2 Nov 2022 11:28:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC1EE850A5; Wed, 2 Nov 2022 12:28:44 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f27mUmLa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 04F0984E98; Wed, 2 Nov 2022 07:15:22 +0100 (CET) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B5A7784E74 for ; Wed, 2 Nov 2022 07:15:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=liangyanyu13@gmail.com Received: by mail-pg1-x52a.google.com with SMTP id 20so15398991pgc.5 for ; Tue, 01 Nov 2022 23:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=1m5GFrkJlf6tRoCjd35A5wxZ0zNMEM+pgfpMXEacr+4=; b=f27mUmLaRfKwv6T+EQ5Zrxk+AwWthrvUl43vVi+dMESgSfBO52R7uAArlGlhfp88yy ZAeEmiNz18LBIV2zfdZqC2guHE4ZUme3Abio8B1UNaB9VD02/CFy3K/Q/GU7sANC89Mr tAVqPz16Ph1JoDstid63g5LMpkeLvq4tIBPyoMIiB4qZHQSdB8gWf/2RPTga8QCgnm+B +K/2gem6MQ+xDKgLAlNtFKRMqHJV7zWxGhBpy7WR6GSDDwGETZwj+aLm2nAlbFz+iLpL AAQKQQccddGfYT6hekPo+u70APmSxVI7qc8spDkwtPYAgzANbxuErSLWbURhpZyhEHSc ShfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1m5GFrkJlf6tRoCjd35A5wxZ0zNMEM+pgfpMXEacr+4=; b=ZJwGCdULnEl2RtRmlZx+DCoygRVIfVVcXKzAKm/Ll4O+FwlMa/jszYgGQ9HAuOmqUb EuituLRCVQyiASfkixG42q8jXpTsQnz+bulyF8bLOiOq2sN7yJd0ftuByAtcpjviLOrk jvJhEA7SDrZm1uQCEQAsmHO38tjHhKS9p3nw3YMWeXW8uHUorsJhJ7oH1FOz56MVQ8uO a1jQ0GmIlSRex/tDu4TD/V8LO+HElOIzhsGJJ87Ff1/zdgM01/Ucd3CIiWinoyuNt97c C7EsiuhVvKqhT2xqD0fMfZei6KynguasPO+5Tdl00yg5kvmUw4a7sXcNGmwTdXq9DYUn qqMQ== X-Gm-Message-State: ACrzQf15/aHAQVzKeuRojSv5+9dFGOSj61283skbushYrQEsPajaInLI klJeT/ISaA4OHNBEa51Ztb4= X-Google-Smtp-Source: AMsMyM7Pgajts1k9iD7oiPFUoJSiHXJHxVgq8FJO0iP7/bP1qEZWQhMgu4rHVLt+zofQmI3izCx8dw== X-Received: by 2002:a63:5b48:0:b0:458:1e98:c862 with SMTP id l8-20020a635b48000000b004581e98c862mr5798467pgm.568.1667369717785; Tue, 01 Nov 2022 23:15:17 -0700 (PDT) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id v128-20020a626186000000b0056328e516f4sm7805882pfb.148.2022.11.01.23.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 23:15:17 -0700 (PDT) From: Leo Yu To: dario.binacchi@amarulasolutions.com, michael@amarulasolutions.com, miquel.raynal@bootlin.com, u-boot@lists.denx.de Cc: jaimeliao.tw@gmail.com, Leo Yu Subject: [PATCH v2 1/5] mtd: spinand: Add continuous read mode configuration Date: Wed, 2 Nov 2022 14:14:28 +0800 Message-Id: <20221102061432.7113-2-liangyanyu13@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221102061432.7113-1-liangyanyu13@gmail.com> References: <20221102061432.7113-1-liangyanyu13@gmail.com> X-Mailman-Approved-At: Wed, 02 Nov 2022 12:28:40 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean This patch sets the "CONT" bit in the configuration register and adds a flag for identifying continuous read mode capability. Signed-off-by: Leo Yu --- drivers/mtd/nand/spi/core.c | 12 ++++++++++++ include/linux/mtd/spinand.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index 134bf22c80..2419c267d6 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -216,6 +216,18 @@ static int spinand_init_quad_enable(struct spinand_device *spinand) enable ? CFG_QUAD_ENABLE : 0); } +static int spinand_continuous_read_enable(struct spinand_device *spinand, + bool enable) +{ + int ret = spinand_upd_cfg(spinand, CFG_CONT_READ_ENABLE, + enable ? CFG_CONT_READ_ENABLE : 0); + + if (!ret) + spinand->use_continuous_read = enable; + + return ret; +} + static int spinand_ecc_enable(struct spinand_device *spinand, bool enable) { diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 15bcd59f34..e6a5478b0a 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -131,6 +131,7 @@ #define REG_CFG 0xb0 #define CFG_OTP_ENABLE BIT(6) #define CFG_ECC_ENABLE BIT(4) +#define CFG_CONT_READ_ENABLE BIT(2) #define CFG_QUAD_ENABLE BIT(0) /* status register */ @@ -247,6 +248,7 @@ struct spinand_ecc_info { #define SPINAND_HAS_QE_BIT BIT(0) #define SPINAND_HAS_CR_FEAT_BIT BIT(1) +#define SPINAND_HAS_CONT_READ_BIT BIT(2) /** * struct spinand_info - Structure used to describe SPI NAND chips -- 2.17.1