mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-01 16:58:22 +00:00
generic: 5.15: move pending xtx nand patch from pending to backport
Move pending xtx nand patch from pending to backport as it got merged upstream. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
f846945bd2
commit
90629d82da
@ -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>
|
From: Felix Matouschek <felix@matouschek.org>
|
||||||
Date: Fri, 2 Jul 2021 20:31:23 +0200
|
Date: Mon, 18 Apr 2022 15:28:03 +0200
|
||||||
Subject: [PATCH] mtd: spinand: Add support for XTX XT26G0xA
|
Subject: [PATCH 1/1] mtd: spinand: Add support for XTX XT26G0xA
|
||||||
|
|
||||||
Add support for XTX Technology XT26G01AXXXXX, XTX26G02AXXXXX and
|
Add support for XTX Technology XT26G01AXXXXX, XTX26G02AXXXXX and
|
||||||
XTX26G04AXXXXX SPI NAND.
|
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.
|
Tested on Teltonika RUTX10 flashed with OpenWrt.
|
||||||
|
|
||||||
Datasheets available at
|
Links:
|
||||||
http://www.xtxtech.com/download/?AId=225
|
- http://www.xtxtech.com/download/?AId=225
|
||||||
https://datasheet.lcsc.com/szlcsc/2005251034_XTX-XT26G01AWSEGA_C558841.pdf
|
- https://datasheet.lcsc.com/szlcsc/2005251034_XTX-XT26G01AWSEGA_C558841.pdf
|
||||||
|
|
||||||
Signed-off-by: Felix Matouschek <felix@matouschek.org>
|
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/Makefile | 2 +-
|
||||||
drivers/mtd/nand/spi/core.c | 1 +
|
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 +
|
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
|
create mode 100644 drivers/mtd/nand/spi/xtx.c
|
||||||
|
|
||||||
--- a/drivers/mtd/nand/spi/Makefile
|
--- 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,
|
static int spinand_manufacturer_match(struct spinand_device *spinand,
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/drivers/mtd/nand/spi/xtx.c
|
+++ b/drivers/mtd/nand/spi/xtx.c
|
||||||
@@ -0,0 +1,122 @@
|
@@ -0,0 +1,129 @@
|
||||||
+// SPDX-License-Identifier: GPL-2.0
|
+// SPDX-License-Identifier: GPL-2.0
|
||||||
+/*
|
+/*
|
||||||
+ * Author:
|
+ * Author:
|
||||||
@ -109,18 +110,25 @@ Signed-off-by: Felix Matouschek <felix@matouschek.org>
|
|||||||
+static int xt26g0xa_ecc_get_status(struct spinand_device *spinand,
|
+static int xt26g0xa_ecc_get_status(struct spinand_device *spinand,
|
||||||
+ u8 status)
|
+ u8 status)
|
||||||
+{
|
+{
|
||||||
+ switch (status & XT26G0XA_STATUS_ECC_MASK) {
|
+ status = status & XT26G0XA_STATUS_ECC_MASK;
|
||||||
|
+
|
||||||
|
+ switch (status) {
|
||||||
+ case XT26G0XA_STATUS_ECC_NO_DETECTED:
|
+ case XT26G0XA_STATUS_ECC_NO_DETECTED:
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+ case XT26G0XA_STATUS_ECC_8_CORRECTED:
|
+ case XT26G0XA_STATUS_ECC_8_CORRECTED:
|
||||||
+ return 8;
|
+ return 8;
|
||||||
+ case XT26G0XA_STATUS_ECC_UNCOR_ERROR:
|
+ case XT26G0XA_STATUS_ECC_UNCOR_ERROR:
|
||||||
+ return -EBADMSG;
|
+ return -EBADMSG;
|
||||||
+ default: /* (1 << 2) through (7 << 2) are 1-7 corrected errors */
|
+ default:
|
||||||
+ return (status & XT26G0XA_STATUS_ECC_MASK) >> 2;
|
+ break;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
+ /* At this point values greater than (2 << 4) are invalid */
|
||||||
|
+ if (status > XT26G0XA_STATUS_ECC_UNCOR_ERROR)
|
||||||
+ return -EINVAL;
|
+ return -EINVAL;
|
||||||
|
+
|
||||||
|
+ /* (1 << 2) through (7 << 2) are 1-7 corrected errors */
|
||||||
|
+ return status >> 2;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+static const struct spinand_info xtx_spinand_table[] = {
|
+static const struct spinand_info xtx_spinand_table[] = {
|
Loading…
x
Reference in New Issue
Block a user