diff mbox series

[2/2] mtd: spi-nor: micron/st: Hardcode erase_proto to 1-1-1

Message ID 20211209100813.61713-2-alexander.sverdlin@nokia.com
State Rejected
Delegated to: Ambarus Tudor
Headers show
Series [1/2] mtd: spi-nor: Introduce erase_proto | expand

Commit Message

Alexander A Sverdlin Dec. 9, 2021, 10:08 a.m. UTC
From: Alexander Sverdlin <alexander.sverdlin@nokia.com>

This fixes sector erase on mt25qu256aba8e12-1sit.
Looks like others like mt35xu512aba could be affected as well.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
---
 drivers/mtd/spi-nor/micron-st.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Pratyush Yadav Dec. 16, 2021, 8:07 p.m. UTC | #1
On 09/12/21 11:08AM, Alexander A Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> 
> This fixes sector erase on mt25qu256aba8e12-1sit.
> Looks like others like mt35xu512aba could be affected as well.

Indeed. mt35xu512aba would need to set erase_proto to 8D-8D-8D mode.

> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
> ---
>  drivers/mtd/spi-nor/micron-st.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
> index 2f3054b..058bbb7 100644
> --- a/drivers/mtd/spi-nor/micron-st.c
> +++ b/drivers/mtd/spi-nor/micron-st.c
> @@ -267,6 +267,12 @@ static void micron_st_default_init(struct spi_nor *nor)
>  	nor->flags &= ~SNOR_F_HAS_16BIT_SR;
>  	nor->params->quad_enable = NULL;
>  	nor->params->set_4byte_addr_mode = st_micron_set_4byte_addr_mode;
> +
> +	/*
> +	 * mt25qu doesn't support all possible write protocols for erase, only
> +	 * 1-1-0, 2-2-0, 4-4-0.
> +	 */
> +	nor->erase_proto = SNOR_PROTO_1_1_1;

If this is only a mt25qu thing, why do it for all Micron flashes? 
Anyway, _if_ you do as I suggest in patch 1, this won't be needed.

>  }
>  
>  static const struct spi_nor_fixups micron_st_fixups = {
> -- 
> 2.10.2
>
diff mbox series

Patch

diff --git a/drivers/mtd/spi-nor/micron-st.c b/drivers/mtd/spi-nor/micron-st.c
index 2f3054b..058bbb7 100644
--- a/drivers/mtd/spi-nor/micron-st.c
+++ b/drivers/mtd/spi-nor/micron-st.c
@@ -267,6 +267,12 @@  static void micron_st_default_init(struct spi_nor *nor)
 	nor->flags &= ~SNOR_F_HAS_16BIT_SR;
 	nor->params->quad_enable = NULL;
 	nor->params->set_4byte_addr_mode = st_micron_set_4byte_addr_mode;
+
+	/*
+	 * mt25qu doesn't support all possible write protocols for erase, only
+	 * 1-1-0, 2-2-0, 4-4-0.
+	 */
+	nor->erase_proto = SNOR_PROTO_1_1_1;
 }
 
 static const struct spi_nor_fixups micron_st_fixups = {