[PATCH] mtd: spi-nor: add support for Winbond W25Q512JV

Tudor.Ambarus at microchip.com Tudor.Ambarus at microchip.com
Mon Mar 8 05:50:34 GMT 2021


On 2/13/21 5:10 PM, David Bauer wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> The Winbond W25Q512JV is a 512mb SPI-NOR chip. It supports 4K
> sectors as well as block protection and Dual-/Quad-read.
> 
> Tested on: Ubiquiti UniFi 6 LR
> 
> Signed-off-by: David Bauer <mail at david-bauer.net>

David, I'll take Shuhao's patch because he sent it first:
https://patchwork.ozlabs.org/project/linux-mtd/patch/20210208075303.4200-1-shuhao.mai.1990@gmail.com/

Would you make an incremental patch on top op Shuhao's, to add the
locking support?

Shuhao, can you please test the locking ops with mtd-utils?


> ---
>  drivers/mtd/spi-nor/winbond.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mtd/spi-nor/winbond.c b/drivers/mtd/spi-nor/winbond.c
> index e5dfa786f190..49d0d7993368 100644
> --- a/drivers/mtd/spi-nor/winbond.c
> +++ b/drivers/mtd/spi-nor/winbond.c
> @@ -95,6 +95,10 @@ static const struct flash_info winbond_parts[] = {
>                              SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
>         { "w25q256jw", INFO(0xef6019, 0, 64 * 1024, 512,
>                              SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
> +       { "w25q512jv", INFO(0xef4020, 0, 64 * 1024, 1024,
> +                           SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ |
> +                           SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 |
> +                           SPI_NOR_HAS_LOCK | SPI_NOR_4BIT_BP) },

Looks good. Let's put these flags in some king of order:

SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ |
SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB | SPI_NOR_TB_SR_BIT6 |
SPI_NOR_4BIT_BP

Cheers,
ta


>         { "w25m512jv", INFO(0xef7119, 0, 64 * 1024, 1024,
>                             SECT_4K | SPI_NOR_QUAD_READ | SPI_NOR_DUAL_READ) },
>  };
> --
> 2.30.1
> 



More information about the linux-mtd mailing list