]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: rawnand: brcmnand: fix CS0 layout
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Sat, 11 Feb 2023 15:29:06 +0000 (16:29 +0100)
committerDario Binacchi <dario.binacchi@amarulasolutions.com>
Mon, 27 Feb 2023 15:29:53 +0000 (16:29 +0100)
Only v3.3-v5.0 have a different CS0 layout.
Controllers before v3.3 use the same layout for every CS.

Fixes: 27c5b17cd1b1 ("mtd: nand: add NAND driver "library" for Broadcom STB NAND controller")
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200522121524.4161539-3-noltari@gmail.com
[Ported to U-Boot from the Linux kernel]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Acked-by: William Zhang <william.zhang@broadcom.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
drivers/mtd/nand/raw/brcmnand/brcmnand.c

index ee7c3a21602e04558e1733b0399286ee8711da9c..1ea9091e649714f1069c449b946bc0c3a392318e 100644 (file)
@@ -561,8 +561,9 @@ static int brcmnand_revision_init(struct brcmnand_controller *ctrl)
        } else {
                ctrl->cs_offsets = brcmnand_cs_offsets;
 
-               /* v5.0 and earlier has a different CS0 offset layout */
-               if (ctrl->nand_version <= 0x0500)
+               /* v3.3-5.0 have a different CS0 offset layout */
+               if (ctrl->nand_version >= 0x0303 &&
+                   ctrl->nand_version <= 0x0500)
                        ctrl->cs0_offsets = brcmnand_cs_offsets_cs0;
        }