public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Pratyush Yadav <p.yadav@ti.com>
To: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: <jagan@amarulasolutions.com>, <vigneshr@ti.com>,
	<u-boot@lists.denx.de>, <nicolas.ferre@microchip.com>
Subject: Re: [PATCH v2 4/4] mtd: spi-nor-core: Fix the opcode extension for the software reset sequence
Date: Wed, 10 Nov 2021 00:59:17 +0530	[thread overview]
Message-ID: <20211109192915.n6e472bfarlteoqa@ti.com> (raw)
In-Reply-To: <20211103234950.202289-5-tudor.ambarus@microchip.com>

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 <tudor.ambarus@microchip.com>
> ---
>  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.

      reply	other threads:[~2021-11-09 19:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 23:49 [PATCH v2 0/4] mtd: spi-nor: Fix software reset; add mx66lm1g45g Tudor Ambarus
2021-11-03 23:49 ` [PATCH v2 1/4] mtd: spi-nor-core: Introduce SPI_NOR_SOFT_RESET flash_info flag Tudor Ambarus
2021-11-09 19:31   ` Pratyush Yadav
2021-11-03 23:49 ` [PATCH v2 2/4] mtd: spi-nor-core: macronix: Add support for mx66lm1g45g Tudor Ambarus
2021-11-12 21:50   ` Pratyush Yadav
2021-11-13 13:48   ` Jagan Teki
2021-11-15  5:25     ` Tudor.Ambarus
2021-11-03 23:49 ` [PATCH v2 3/4] Revert "mtd: spi-nor-core: Perform a Soft Reset on boot" Tudor Ambarus
2021-11-09 19:26   ` Pratyush Yadav
2021-11-10  8:44     ` Tudor.Ambarus
2021-11-12 13:13       ` Pratyush Yadav
2021-11-15  5:44         ` Tudor.Ambarus
2021-12-16 18:45           ` Pratyush Yadav
2021-12-17  6:27             ` Tudor.Ambarus
2021-12-17 10:40               ` Pratyush Yadav
2021-11-03 23:49 ` [PATCH v2 4/4] mtd: spi-nor-core: Fix the opcode extension for the software reset sequence Tudor Ambarus
2021-11-09 19:29   ` Pratyush Yadav [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211109192915.n6e472bfarlteoqa@ti.com \
    --to=p.yadav@ti.com \
    --cc=jagan@amarulasolutions.com \
    --cc=nicolas.ferre@microchip.com \
    --cc=tudor.ambarus@microchip.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox