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 9FC2DC43334 for ; Thu, 7 Jul 2022 04:49:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5BE9484395; Thu, 7 Jul 2022 06:49:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="hzN0LAhH"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8628C84474; Thu, 7 Jul 2022 06:49:39 +0200 (CEST) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 5C1A4842C7 for ; Thu, 7 Jul 2022 06:49:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jagan@amarulasolutions.com Received: by mail-ej1-x632.google.com with SMTP id r21so1588064eju.0 for ; Wed, 06 Jul 2022 21:49:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ss0ujR1EihAVWFMZOAFHnTp8kodFIOeVxhkNKoPTUqA=; b=hzN0LAhHiKzfjvlQuLRoUA8MXTNPyLyzgnthxm5qGwIXu20gj3cZwoewVHo9m2pFR4 8McwBofBhC5XI6s1phnNtTfrgB1Es/mxUPE2uscIWo4xmesLA5Fz1qhZJ25+ZOWZ3PzN ABHRA8jk1UlDpuYPoeYKEOoTWm6vr9mq+ijRo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Ss0ujR1EihAVWFMZOAFHnTp8kodFIOeVxhkNKoPTUqA=; b=VDKsDg7k2rafuwp+cd7GnysBTDWnlgOcXUnhxBIY7QYXr75Km53O+R1KScHDlrEfYA EC7EW1m8IrifMMX2veVBAeaer7Xa4dGHV0rztSH0AaJEsAE89v8l8/Com80l8SBTDXUC vWBpQtC0X6UrtbWeLiEklRkakzE9jUUdvh2rTrj/3nSEdwiV7uWS1z1ZHnMRz+vmTCtw b9ZoIYiuDKfHBBbLz+KcbxY1C44p+OMTHj1mrW/2Ir0uyoYrhNqYtn4ApDK14nWQUX9e xUFFtkZyeod6XEI087eZPm6vM6j6zNA+rxeosibaISzAjc8FQOUJMydC5TbxuN8WUapa nrww== X-Gm-Message-State: AJIora/eeM11CqQcaaI0oE/GoZwAUFS5ifJE0JMBRanZ+GvzB33jpCtl 3i9vWHODKivorJVaOznjRX+nQyEPNHesOLax5aynPA== X-Google-Smtp-Source: AGRyM1v33LuhTIv99Z1VxeUJBszPGoHc8Wy8SACrY2v1NKG/igFSGlwXRJKiaMHd6w2xHKIgz5i9IkQXlvHOHHTXqP0= X-Received: by 2002:a17:907:3e9a:b0:726:d079:d868 with SMTP id hs26-20020a1709073e9a00b00726d079d868mr43783740ejc.620.1657169376888; Wed, 06 Jul 2022 21:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20220704061242.21487-1-jaimeliao.tw@gmail.com> <20220704061242.21487-3-jaimeliao.tw@gmail.com> In-Reply-To: <20220704061242.21487-3-jaimeliao.tw@gmail.com> From: Jagan Teki Date: Thu, 7 Jul 2022 10:19:26 +0530 Message-ID: Subject: Re: [PATCH v8 2/4] mtd: spi-nor-core: Adding different type of command extension in Soft Reset To: JaimeLiao Cc: u-boot@lists.denx.de, vigneshr@ti.com, miquel.raynal@bootlin.com, zhengxunli@mxic.com.tw, jaimeliao@mxic.com.tw Content-Type: text/plain; charset="UTF-8" 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 On Mon, Jul 4, 2022 at 11:42 AM JaimeLiao wrote: > > Power-on-Reset is a method to restore flash back to 1S-1S-1S mode from 8D-8D-8D > in the begging of probe. > > Command extension type is not standardized across flash vendors in DTR mode. > > For suiting different vendor flash devices, adding a flag to seperate types for > soft reset on boot. > > Signed-off-by: JaimeLiao > --- > drivers/mtd/spi/Kconfig | 7 +++++++ > drivers/mtd/spi/spi-nor-core.c | 7 ++++++- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig > index f350c7e5dc..5bb1baa019 100644 > --- a/drivers/mtd/spi/Kconfig > +++ b/drivers/mtd/spi/Kconfig > @@ -97,6 +97,13 @@ config SPI_FLASH_SMART_HWCAPS > can support a type of operation in a much more refined way compared > to using flags like SPI_RX_DUAL, SPI_TX_QUAD, etc. > > +config SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT > + bool "Command extension type is INVERT for Software Reset on boot" > + default n > + help > + Because of SFDP information can not be get before boot. > + So define command extension type is INVERT when Software Reset on boot only. > + > config SPI_FLASH_SOFT_RESET > bool "Software Reset support for SPI NOR flashes" > help > diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c > index 5d319e4c0f..50460feaf8 100644 > --- a/drivers/mtd/spi/spi-nor-core.c > +++ b/drivers/mtd/spi/spi-nor-core.c > @@ -3697,7 +3697,12 @@ static int spi_nor_soft_reset(struct spi_nor *nor) > enum spi_nor_cmd_ext ext; > > ext = nor->cmd_ext_type; > - nor->cmd_ext_type = SPI_NOR_EXT_REPEAT; > + if (nor->cmd_ext_type == SPI_NOR_EXT_NONE) { > + nor->cmd_ext_type = SPI_NOR_EXT_REPEAT; > +#if CONFIG_IS_ENABLED(SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT) > + nor->cmd_ext_type = SPI_NOR_EXT_INVERT; Better check those parts whose extension is not standard instead of CONFIG. Jagan.