]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
generic: 5.15: move pending xtx nand patch from pending to backport
authorChristian Marangi <ansuelsmth@gmail.com>
Fri, 21 Oct 2022 20:43:07 +0000 (22:43 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 24 Oct 2022 19:10:46 +0000 (21:10 +0200)
Move pending xtx nand patch from pending to backport as it got merged
upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/generic/backport-5.15/331-v5.19-mtd-spinand-Add-support-for-XTX-XT26G0xA.patch [moved from target/linux/generic/pending-5.15/483-mtd-spinand-add-support-for-xtx-xt26g0xa.patch with 85% similarity]

similarity index 85%
rename from target/linux/generic/pending-5.15/483-mtd-spinand-add-support-for-xtx-xt26g0xa.patch
rename to target/linux/generic/backport-5.15/331-v5.19-mtd-spinand-Add-support-for-XTX-XT26G0xA.patch
index a73c9fa97dfd4ae10d2a39851890b4fbc4afbd03..541d247542b67808427fc17c384583369535f9bc 100644 (file)
@@ -1,7 +1,7 @@
-From a07e31adf2753cad2fd9790db5bfc047c81e8152 Mon Sep 17 00:00:00 2001
+From f4c5c7f9d2e5ab005d57826b740b694b042a737c Mon Sep 17 00:00:00 2001
 From: Felix Matouschek <felix@matouschek.org>
-Date: Fri, 2 Jul 2021 20:31:23 +0200
-Subject: [PATCH] mtd: spinand: Add support for XTX XT26G0xA
+Date: Mon, 18 Apr 2022 15:28:03 +0200
+Subject: [PATCH 1/1] mtd: spinand: Add support for XTX XT26G0xA
 
 Add support for XTX Technology XT26G01AXXXXX, XTX26G02AXXXXX and
 XTX26G04AXXXXX SPI NAND.
@@ -11,17 +11,18 @@ These are 3V, 1G/2G/4Gbit serial SLC NAND flash devices with on-die ECC
 
 Tested on Teltonika RUTX10 flashed with OpenWrt.
 
-Datasheets available at
-http://www.xtxtech.com/download/?AId=225
-https://datasheet.lcsc.com/szlcsc/2005251034_XTX-XT26G01AWSEGA_C558841.pdf
-
+Links:
+  - http://www.xtxtech.com/download/?AId=225
+  - https://datasheet.lcsc.com/szlcsc/2005251034_XTX-XT26G01AWSEGA_C558841.pdf
 Signed-off-by: Felix Matouschek <felix@matouschek.org>
+Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
+Link: https://lore.kernel.org/linux-mtd/20220418132803.664103-1-felix@matouschek.org
 ---
  drivers/mtd/nand/spi/Makefile |   2 +-
  drivers/mtd/nand/spi/core.c   |   1 +
- drivers/mtd/nand/spi/xtx.c    | 122 ++++++++++++++++++++++++++++++++++
+ drivers/mtd/nand/spi/xtx.c    | 129 ++++++++++++++++++++++++++++++++++
  include/linux/mtd/spinand.h   |   1 +
- 4 files changed, 125 insertions(+), 1 deletion(-)
+ 4 files changed, 132 insertions(+), 1 deletion(-)
  create mode 100644 drivers/mtd/nand/spi/xtx.c
 
 --- a/drivers/mtd/nand/spi/Makefile
@@ -43,7 +44,7 @@ Signed-off-by: Felix Matouschek <felix@matouschek.org>
  static int spinand_manufacturer_match(struct spinand_device *spinand,
 --- /dev/null
 +++ b/drivers/mtd/nand/spi/xtx.c
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,129 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Author:
@@ -109,18 +110,25 @@ Signed-off-by: Felix Matouschek <felix@matouschek.org>
 +static int xt26g0xa_ecc_get_status(struct spinand_device *spinand,
 +                                       u8 status)
 +{
-+      switch (status & XT26G0XA_STATUS_ECC_MASK) {
++      status = status & XT26G0XA_STATUS_ECC_MASK;
++
++      switch (status) {
 +      case XT26G0XA_STATUS_ECC_NO_DETECTED:
 +              return 0;
 +      case XT26G0XA_STATUS_ECC_8_CORRECTED:
 +              return 8;
 +      case XT26G0XA_STATUS_ECC_UNCOR_ERROR:
 +              return -EBADMSG;
-+      default: /* (1 << 2) through (7 << 2) are 1-7 corrected errors */
-+              return (status & XT26G0XA_STATUS_ECC_MASK) >> 2;
++      default:
++              break;
 +      }
 +
-+      return -EINVAL;
++      /* At this point values greater than (2 << 4) are invalid  */
++      if (status > XT26G0XA_STATUS_ECC_UNCOR_ERROR)
++              return -EINVAL;
++
++      /* (1 << 2) through (7 << 2) are 1-7 corrected errors */
++      return status >> 2;
 +}
 +
 +static const struct spinand_info xtx_spinand_table[] = {