generic: 6.1: backport support for generic spi-nor from SFDP data
[openwrt/staging/pepe2k.git] / target / linux / generic / pending-6.1 / 479-mtd-spi-nor-add-xtx-xt25f128b.patch
index 5a064b714bfdcd5b81f0345b6cb5945d15570017..371f1a72769412adfd9559eb79292ac640eeccd8 100644 (file)
@@ -36,12 +36,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  spi-nor-objs                  += xilinx.o
  spi-nor-objs                  += xmc.o
 +spi-nor-objs                  += xtx.o
+ spi-nor-$(CONFIG_DEBUG_FS)    += debugfs.o
  obj-$(CONFIG_MTD_SPI_NOR)     += spi-nor.o
  
- obj-$(CONFIG_MTD_SPI_NOR)     += controllers/
 --- /dev/null
 +++ b/drivers/mtd/spi-nor/xtx.c
-@@ -0,0 +1,15 @@
+@@ -0,0 +1,17 @@
 +// SPDX-License-Identifier: GPL-2.0
 +#include <linux/mtd/spi-nor.h>
 +
@@ -49,7 +49,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +
 +static const struct flash_info xtx_parts[] = {
 +      /* XTX Technology (Shenzhen) Limited */
-+      { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
++      { "xt25f128b", INFO(0x0B4018, 0, 64 * 1024, 256)
++              NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ |
++                            SPI_NOR_QUAD_READ) },
 +};
 +
 +const struct spi_nor_manufacturer spi_nor_xtx = {
@@ -59,17 +61,17 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +};
 --- a/drivers/mtd/spi-nor/core.c
 +++ b/drivers/mtd/spi-nor/core.c
-@@ -1859,6 +1859,7 @@ static const struct spi_nor_manufacturer
+@@ -1636,6 +1636,7 @@ static const struct spi_nor_manufacturer
        &spi_nor_winbond,
        &spi_nor_xilinx,
        &spi_nor_xmc,
 +      &spi_nor_xtx,
  };
  
- static const struct flash_info *
+ static const struct flash_info spi_nor_generic_flash = {
 --- a/drivers/mtd/spi-nor/core.h
 +++ b/drivers/mtd/spi-nor/core.h
-@@ -489,6 +489,7 @@ extern const struct spi_nor_manufacturer
+@@ -633,6 +633,7 @@ extern const struct spi_nor_manufacturer
  extern const struct spi_nor_manufacturer spi_nor_winbond;
  extern const struct spi_nor_manufacturer spi_nor_xilinx;
  extern const struct spi_nor_manufacturer spi_nor_xmc;