[PATCH 2/5] mtd: rawnand: zynq: Add comments about very bad practices
Miquel Raynal (DAVE)
miquel.raynal at bootlin.com
Fri May 29 18:38:58 CEST 2026
The driver goes through very (very) wrong steps during initialization as
it completely hardcodes support for Micron chips.
Flag these sections as undesirable in case someone ever cares about
fixing this properly, or simply stumbles about these pieces of code and
wonders why this is there.
Signed-off-by: Miquel Raynal (DAVE) <miquel.raynal at bootlin.com>
---
drivers/mtd/nand/raw/zynq_nand.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mtd/nand/raw/zynq_nand.c b/drivers/mtd/nand/raw/zynq_nand.c
index 05b500d09613..2d07b29ecabd 100644
--- a/drivers/mtd/nand/raw/zynq_nand.c
+++ b/drivers/mtd/nand/raw/zynq_nand.c
@@ -203,6 +203,10 @@ static struct nand_ecclayout zynq_oob_64 = {
}
};
+/*
+ * FIXME: This is a very (Micron) specific layout, which should not reside at
+ * the spi/ level.
+ */
static struct nand_ecclayout ondie_nand_oob_64 = {
.eccbytes = 32,
@@ -1155,6 +1159,10 @@ static int zynq_nand_probe(struct udevice *dev)
maf_id = nand_chip->read_byte(mtd);
dev_id = nand_chip->read_byte(mtd);
+ /*
+ * FIXME: This is horribly wrong, it checks if Micron chips have on-die
+ * ECC support enabled. This should be moved away.
+ */
if ((maf_id == 0x2c) && ((dev_id == 0xf1) ||
(dev_id == 0xa1) || (dev_id == 0xb1) ||
(dev_id == 0xaa) || (dev_id == 0xba) ||
--
2.53.0
More information about the U-Boot
mailing list