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 DED9AC433EF for ; Wed, 3 Nov 2021 16:25:40 +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 52D32600EF for ; Wed, 3 Nov 2021 16:25:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52D32600EF 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 943A983633; Wed, 3 Nov 2021 17:25: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="IbZVIH9W"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 70FE28362F; Wed, 3 Nov 2021 17:25:12 +0100 (CET) Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) (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 DE30683632 for ; Wed, 3 Nov 2021 17:25:05 +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=1635956705; x=1667492705; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hP6PQ8bWUzjn+QGALbDSblp/t77LiQmkDqYatDTLORo=; b=IbZVIH9WPzS8hTzQm0+blaNJZ7SAkif3ja/pKClbyGnZW+kmwpGhr+i1 i9a9rN6uwgHRwdWSfZu8wh1cHkpCtcuxj6XEu+79xg05DN2wcS12jR+80 t4gSk/FOEoAL22kYL3o0Hu/KWa/HoZU9NYElqglrJfeY3neVrX4mYj63R x3d5Qi7BjL4DPQzYLkJTaBZPeqa6y6JFKtIbQKALgKTvhWUH5K4xoxD9l DnneqYY/bs7ADLzD4awX9WJj/TGcEd1JK+Y41A56VFb5Arg1ZPf88v551 XQaTGnP+/okOAjzJZxV0Tv580dbqQzVJ5N2yQnZSvZWEtEwGuaTSzUGYI Q==; IronPort-SDR: SKRtICEI64OQQI96AsxvCOsgNwtrXbbEB6ZaoO0KKXVS+UU39m4ABRkAwtmCKoCw2nIdyeH3Na /BXkW318uYyhkVAZASRZWqv4KmMgvf86VkwoPO2sHLRw/CExOi6QXKqRhIBqtdKGNplhmj+WgG JhZMKK2mbqYWtH3Fi1jI1FC7iLaMNjAMJ0SE85CMQd8EGDkFskOH69RdgscfA2Fhzcs9d9CDRr ohf+f1WsIv2Sv77n76QyATKK0X14ctU2Erk5lpn/0POWYuYQlXD2FY8gupLoT1PNVNuc93qACd nJxYQKb9gceDA4bcSUFjptXd X-IronPort-AV: E=Sophos;i="5.87,206,1631602800"; d="scan'208";a="135358275" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Nov 2021 09:25:04 -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 09:25:04 -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 09:25:03 -0700 From: Tudor Ambarus To: , CC: , , Tudor Ambarus Subject: [PATCH 3/3] mtd: spi-nor-core: Fix the opcode extension for the software reset sequence Date: Wed, 3 Nov 2021 18:24:54 +0200 Message-ID: <20211103162454.179191-4-tudor.ambarus@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211103162454.179191-1-tudor.ambarus@microchip.com> References: <20211103162454.179191-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 df66a73495..35327307a7 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