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 993F9C433F5 for ; Wed, 3 Nov 2021 23:50:32 +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 1D5A5611C6 for ; Wed, 3 Nov 2021 23:50:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1D5A5611C6 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.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 3F42F8364F; Thu, 4 Nov 2021 00:50:19 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=microchip.com header.i=@microchip.com header.b="ywyjLtAa"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F49B8365A; Thu, 4 Nov 2021 00:50:17 +0100 (CET) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 938E18364D for ; Thu, 4 Nov 2021 00:50:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Tudor.Ambarus@microchip.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1635983412; x=1667519412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QLnbIXP96iz4Cb4XfeBOvCAHAk2mL1KG0ChWNUR+fU8=; b=ywyjLtAac+93rl+8lT6tf79F/UHk5SwMrKj6o2Bsi0Fn6c8teyl4Odpj mRLfyHRi85XgL2JjTQgnb+hni4SH2N6ivlIm7pmuPgx/vgTvEoWKyplxU Zr8EvD5h1n8omBmhUDnC1sSIGuosulxTOmB6vg2xxhfS5Db/tHJPh+Iax Bm4jEj0a6wF8qmsfHhXW6qJrSfD+7KbyQjAQVEbyoclVg0ZM0Y+OieGvX DcI/vEwIe1i7LQb7/Ms/1718twZ2yZNGDwaeMxNnOjaYIhPXYRIRBE+n2 WPIkoinKYBqRl4rGLwJXJ441mnt2GAmgTwYXmuApI0ITVeVt161OHq4KQ w==; IronPort-SDR: OysDG8iqE2ZyDizIJZY5x9pzXcSyjSSUy8MifB+DkWLYmyaYz7Vqn8/AGxNmIL5EyTkrFD+oqI 5yQmzUdEXoTSjF/2VIGB6BfDZ4RB2wA5QBsEUsuA0++uc4pdDM6oa6WVcrcrJRKBN//87qsB5/ PGVWCE+UIISq63OxpDLbSvzT48Te9wDt1R3acsLX2Sr4TDlZQWmdJl7fc41mn4PArZ6ADJwnHv swA3CIcw64GTtTz40J+on297Y2I0iXExfmgwsOCcKZyfteiqfQDEek2J3OZNNS3vJFQHYxQDUb vaxJWi6oyEwBiR1fmblxLkos X-IronPort-AV: E=Sophos;i="5.87,207,1631602800"; d="scan'208";a="150656365" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Nov 2021 16:50:08 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Wed, 3 Nov 2021 16:50:08 -0700 Received: from ROB-ULT-M18064N.mchp-main.com (10.10.115.15) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Wed, 3 Nov 2021 16:50:06 -0700 From: Tudor Ambarus To: , , CC: , , Tudor Ambarus Subject: [PATCH v2 4/4] mtd: spi-nor-core: Fix the opcode extension for the software reset sequence Date: Thu, 4 Nov 2021 01:49:50 +0200 Message-ID: <20211103234950.202289-5-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211103234950.202289-1-tudor.ambarus@microchip.com> References: <20211103234950.202289-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 It was always hardcoded to SPI_NOR_EXT_REPEAT, while there are flashes that may use an SPI_NOR_EXT_INVERT opcode extension (mx66lm1g45g). Remove the hardcoded value and let flashes use their per flash opcode extension type. Signed-off-by: Tudor Ambarus --- drivers/mtd/spi/spi-nor-core.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index caf764720c..cbdad335b3 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3685,10 +3685,6 @@ static int spi_nor_soft_reset(struct spi_nor *nor) { struct spi_mem_op op; int ret; - enum spi_nor_cmd_ext ext; - - ext = nor->cmd_ext_type; - nor->cmd_ext_type = SPI_NOR_EXT_REPEAT; op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_SRSTEN, 0), SPI_MEM_OP_NO_DUMMY, @@ -3698,7 +3694,7 @@ static int spi_nor_soft_reset(struct spi_nor *nor) ret = spi_mem_exec_op(nor->spi, &op); if (ret) { dev_warn(nor->dev, "Software reset enable failed: %d\n", ret); - goto out; + return ret; } op = (struct spi_mem_op)SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_SRST, 0), @@ -3709,7 +3705,7 @@ static int spi_nor_soft_reset(struct spi_nor *nor) ret = spi_mem_exec_op(nor->spi, &op); if (ret) { dev_warn(nor->dev, "Software reset failed: %d\n", ret); - goto out; + return ret; } /* @@ -3719,9 +3715,7 @@ static int spi_nor_soft_reset(struct spi_nor *nor) */ udelay(SPI_NOR_SRST_SLEEP_LEN); -out: - nor->cmd_ext_type = ext; - return ret; + return 0; } #endif /* CONFIG_SPI_FLASH_SOFT_RESET */ -- 2.25.1