Thread (12 messages) 12 messages, 3 authors, 2022-01-23

[PATCH v3 8/9] mtd: rawnand: brcmnand: BCMA controller uses command shift of 0

flat view
STALE1733d LANDED

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2022-01-07 18:46:53
Also in: lkml
Subsystem: broadcom stb nand flash driver, memory technology devices (mtd), nand flash subsystem, the rest · Maintainers: Brian Norris, Kamal Dasu, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra, Linus Torvalds

Revision v3 of 3 in this series; landed in mainline as 5abd37f6e9d6 on 2022-01-23.

Revisions (3)
  1. v1 [diff vs current]
  2. v2 [diff vs current]
  3. v3 current
For some odd and unexplained reason the BCMA NAND controller, albeit
revision 3.4 uses a command shift of 0 instead of 24 as it should be,
quirk that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/drivers/mtd/nand/raw/brcmnand/brcmnand.c b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
index eab19df152f3..4759303ece7c 100644
--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
@@ -916,6 +916,12 @@ static void brcmnand_wr_corr_thresh(struct brcmnand_host *host, u8 val)
 
 static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl)
 {
+	/* Kludge for the BCMA-based NAND controller which does not actually
+	 * shift the command
+	 */
+	if (ctrl->nand_version == 0x0304 && brcmnand_non_mmio_ops(ctrl))
+		return 0;
+
 	if (ctrl->nand_version < 0x0602)
 		return 24;
 	return 0;
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help