mtd: rawnand: brcmnand: BCMA controller uses command shift of 0
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 7 Jan 2022 18:46:13 +0000 (10:46 -0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 23 Jan 2022 15:37:19 +0000 (16:37 +0100)
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>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220107184614.2670254-9-f.fainelli@gmail.com
drivers/mtd/nand/raw/brcmnand/brcmnand.c

index eab19df..4759303 100644 (file)
@@ -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;