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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78F43C433F5 for ; Mon, 18 Oct 2021 11:31:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id ED90460F22 for ; Mon, 18 Oct 2021 11:31:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org ED90460F22 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 66667834AC; Mon, 18 Oct 2021 13:31:25 +0200 (CEST) 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="LE0tkFLj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 84790833E4; Mon, 18 Oct 2021 08:25:00 +0200 (CEST) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) (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 37F73831A0 for ; Mon, 18 Oct 2021 08:24:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jaimeliao.tw@gmail.com Received: by mail-pg1-x52f.google.com with SMTP id r2so15020876pgl.10 for ; Sun, 17 Oct 2021 23:24:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lxeR96aDX5hoyQYLIXYGE016k2x9YzoSR3kCEE60yAQ=; b=LE0tkFLjEPxfocJbcy+ls6Lcew2b+vc1fWlRQPqh+dg051hjFij+3T90NlN+oc65FC onurYu723rdDFIURfJ3X3l2JZjeLwrelm69fB509J9l/9sRKblmdvlm1LwwZslY8iThQ 46tD+naEJs5fc/0ko18ivGYZyQ2C1g552xyrHK3uOSAqjkuG+8KzsPEQiEanypM9X00x 9RTllRulMyXvDMWuucSPvT1CQWOEkiy7Q05DoVZikYDyVbiM7eepkzQLRREosGq+KZkw Iw4XpZs1dcM2XLFBLGtiYhYWmNm8D4n0FPhUzgCeKq2GU5BzHsIAG5GQ3rc5YAGghSGp nb9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lxeR96aDX5hoyQYLIXYGE016k2x9YzoSR3kCEE60yAQ=; b=fmfNmnRuxj/EkKRG/wOhpZCyAvD8e+bpDdW/Mw8w9Ks/ym9nMUpmUsUn7dp7WELjbV eBf5SlnozDrx4Xnpjsm0CnJNLJ3gJYUEzXUe2rTZKj8G1nkTwIGDmbfVRsfJPjePHPtz FB6Jw84vZ/d+sxthMJGno30sPyQh6nxuQRXtNlNreRo+l6m1wweZg8K5HtQReTfpBua3 97Q7fVwNlQBdphHa+auZR7me6BrZj5JFyuTLagTWZwQGNK8brci4rMl4CanzPPy6fox/ 2LYX8Q/tiZ7qSipPPVjprIjMBadKMRWMxmowpPNvBx5E2MjoxhNysdrKp3elNb6n5N/k 5HAQ== X-Gm-Message-State: AOAM530NWgoFeOhXJ2doxOVgppakTZHlnvv6Ocx+bb3anAwB1v+h6Xov JGfLxo7NzCUufit5+m5oTAyEQecbl8o= X-Google-Smtp-Source: ABdhPJzbY0FX/ChSb7DmoZ3UalIIpkfP59mxZ/vmP+dvGAK7zdJEItRbUklVIJyDqVs4afT4uLjVlA== X-Received: by 2002:a63:b006:: with SMTP id h6mr14214284pgf.366.1634538295154; Sun, 17 Oct 2021 23:24:55 -0700 (PDT) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id q9sm7124939pfj.88.2021.10.17.23.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Oct 2021 23:24:54 -0700 (PDT) From: JaimeLiao To: u-boot@lists.denx.de, jagan@amarulasolutions.com, vigneshr@ti.com, p.yadav@ti.com Cc: zhengxunli@mxic.com.tw, jaimeliao@mxic.com.tw, JaimeLiao Subject: [PATCH v4 2/4] mtd: spi-nor-core: Adding different type of command extension in Soft Reset Date: Mon, 18 Oct 2021 14:24:26 +0800 Message-Id: <20211018062428.4201-3-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211018062428.4201-1-jaimeliao.tw@gmail.com> References: <20211018062428.4201-1-jaimeliao.tw@gmail.com> X-Mailman-Approved-At: Mon, 18 Oct 2021 13:30:59 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean 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 67599b32c9..8304d6c973 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" default n diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index fdaca0a0d3..87a7de7d60 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3661,7 +3661,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; +#endif /* SPI_NOR_BOOT_SOFT_RESET_EXT_INVERT */ + } op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_SRSTEN, 0), SPI_MEM_OP_NO_DUMMY, -- 2.17.1