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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 484B0C433F5 for ; Tue, 9 Nov 2021 19:29:31 +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 BBAF461055 for ; Tue, 9 Nov 2021 19:29:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BBAF461055 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.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 C0A058398F; Tue, 9 Nov 2021 20:29:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.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=ti.com header.i=@ti.com header.b="VGMMwtqB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 763128398A; Tue, 9 Nov 2021 20:29:26 +0100 (CET) Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) (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 3388B83991 for ; Tue, 9 Nov 2021 20:29:22 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=p.yadav@ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 1A9JTJaN039567; Tue, 9 Nov 2021 13:29:19 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1636486159; bh=5vpqTnAnPBDEHdYNyErV0D3XtaQS22Thbt9zAD7DTeQ=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=VGMMwtqBd8fcsArWUxwyIzIq240TbPnnYvIobxe17pLGSnTgvrTeiVUDbmJdAxKOJ Q6UqFgbpufuxhW4HpA71AsjGEKxlHODGRT6PiN5ca0XNg6KHoqo5LUOrG9hwnZM/Ku e8qfS8Yaaw2kp35d/LxIXG/Kuay0xeMzj8GDf4Po= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 1A9JTJkT046969 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 Nov 2021 13:29:19 -0600 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Tue, 9 Nov 2021 13:29:19 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Tue, 9 Nov 2021 13:29:19 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 1A9JTIZ8079798; Tue, 9 Nov 2021 13:29:18 -0600 Date: Wed, 10 Nov 2021 00:59:17 +0530 From: Pratyush Yadav To: Tudor Ambarus CC: , , , Subject: Re: [PATCH v2 4/4] mtd: spi-nor-core: Fix the opcode extension for the software reset sequence Message-ID: <20211109192915.n6e472bfarlteoqa@ti.com> References: <20211103234950.202289-1-tudor.ambarus@microchip.com> <20211103234950.202289-5-tudor.ambarus@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20211103234950.202289-5-tudor.ambarus@microchip.com> User-Agent: NeoMutt/20171215 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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 On 04/11/21 01:49AM, Tudor Ambarus wrote: > 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. I suggested this exact patch, along with invert extension support for soft reset on boot in [0]. Once we decide on patch 3/4 this should be good to go. [0] https://lore.kernel.org/u-boot/20211025194216.mpocldhlu3pdy63h@ti.com/ > > 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 > -- Regards, Pratyush Yadav Texas Instruments Inc.