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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 10C98C433FE for ; Mon, 13 Sep 2021 13:51:18 +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 6902661BD0 for ; Mon, 13 Sep 2021 13:51:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6902661BD0 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 BFF1C83A90; Mon, 13 Sep 2021 15:50:56 +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="p9ggbPlN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0DCE839AC; Mon, 13 Sep 2021 07:42:47 +0200 (CEST) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (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 6C78183995 for ; Mon, 13 Sep 2021 07:42:44 +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-pl1-x62f.google.com with SMTP id bg1so5049842plb.13 for ; Sun, 12 Sep 2021 22:42:44 -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=bM01NLyEmKiF1T01cgOnR07FMMfanPQt2WQ06QfD0pM=; b=p9ggbPlNj8Fp1HG/OeM/CxG/NU4FeEVhC1hvoK003w2189zws++ZUvS3SLFlRcLZvl XM3THngW9RFnlvjD4vojR/0CouvPbteQdcTed3fHKV35V9DUgu6HBn2sEjTPLXMtKmb/ MiWpvA/ZgOniH6Tey8v0snjej9ltYbKpeMapFHtrYNXPxxNzQrbNRjkqZbE+v8cqssWP bKL4Q8qkrPAdmZEBK/UM4H6Mx5LorpM/mnzfP8PWm8u5zwR355jmGXe94Vz3uMIrc4gj lso7rAMkCWAf+Ui2HG9IQVM8zoTZBJrTWfDetH+jaoL7+FpveeQYK+57/eP5iNAlm/Fg k36g== 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=bM01NLyEmKiF1T01cgOnR07FMMfanPQt2WQ06QfD0pM=; b=P+EOvYN+oT9Inv/PKv8sphfuqn5f+kj7kKCiQSptgQ68irJRdDMIMtUfqxNGcCNmJE C1P4G6YPM6s6z1LN6ibAoK85nVD7y+zuyAA23Qw5cFyG+U2RHdMIeByZ5Au1t4nDI18M m2G/gXvYLtlY/8bzQivmTFjg1ygGRZrxrCBSqsVjYfcKfDf59NhQ37f4a0X96Ztu1x4q 4h/Uu00og5LitvU5GJKnB1pmQFMMpVrH93oCRTBYN6krV7tyoWoxrPd+35rJhsShS13W F7EBDTa5k4L/F8EpJnhSmSbnEgPB/wR1jmdcatGIl5fltzdhTU59ph8N4+TwdhOyInam Iasg== X-Gm-Message-State: AOAM531ImzPXXRRsHTKK2ul1NcJRUz/AIrfLTxLeufFxUs1wYVapYDPs cXXkMIxHZ8rNy1Gst1GHsR1GKxBMNKo= X-Google-Smtp-Source: ABdhPJy8oXzjapK3UtqMOY/AEArK7D6jWjQm9zkuT7SZyBRv9Dm2VjpxT0N9IM1OpIr5J/JuFL/WIg== X-Received: by 2002:a17:90a:8817:: with SMTP id s23mr353803pjn.181.1631511762583; Sun, 12 Sep 2021 22:42:42 -0700 (PDT) Received: from localhost.localdomain ([123.51.145.88]) by smtp.gmail.com with ESMTPSA id d20sm5590139pfu.36.2021.09.12.22.42.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Sep 2021 22:42:42 -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, ycllin@mxic.com.tw, jaimeliao@mxic.com.tw, JaimeLiao Subject: [PATCH v3 2/4] mtd: spi-nor-core: Adding different type of command extension in Soft Reset Date: Mon, 13 Sep 2021 13:42:21 +0800 Message-Id: <20210913054223.25209-3-jaimeliao.tw@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210913054223.25209-1-jaimeliao.tw@gmail.com> References: <20210913054223.25209-1-jaimeliao.tw@gmail.com> X-Mailman-Approved-At: Mon, 13 Sep 2021 15:50:43 +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 if nor->cmd_ext_type didn't configure from SFDP. Signed-off-by: JaimeLiao --- drivers/mtd/spi/Kconfig | 6 ++++++ drivers/mtd/spi/spi-nor-core.c | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index 67599b32c9..d850480401 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -97,6 +97,12 @@ 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_CMD_EXT_INVERT + bool "Command extension type is INVERT for SPI NOR flashed" + default n + help + Define command extension type is INVERT. + 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 b8dda02aa7..4bcd58d839 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) { + nor->cmd_ext_type = SPI_NOR_EXT_REPEAT; +#ifdef CONFIG_SPI_NOR_CMD_EXT_INVERT + nor->cmd_ext_type = SPI_NOR_EXT_INVERT; +#endif + } op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_SRSTEN, 0), SPI_MEM_OP_NO_DUMMY, -- 2.17.1