Skip to content

Commit c2c8a3b

Browse files
Linus Walleijgregkh
authored andcommitted
mtd: rawnand: fsmc: Default to autodetect buswidth
commit b8df622 upstream. If you don't specify buswidth 2 (16 bits) in the device tree, FSMC doesn't even probe anymore: fsmc-nand 10100000.flash: FSMC device partno 090, manufacturer 80, revision 00, config 00 nand: device found, Manufacturer ID: 0x20, Chip ID: 0xb1 nand: ST Micro 10100000.flash nand: bus width 8 instead of 16 bits nand: No NAND device found fsmc-nand 10100000.flash: probe with driver fsmc-nand failed with error -22 With this patch to use autodetection unless buswidth is specified, the device is properly detected again: fsmc-nand 10100000.flash: FSMC device partno 090, manufacturer 80, revision 00, config 00 nand: device found, Manufacturer ID: 0x20, Chip ID: 0xb1 nand: ST Micro NAND 128MiB 1,8V 16-bit nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64 fsmc-nand 10100000.flash: Using 1-bit HW ECC scheme Scanning device for bad blocks I don't know where or how this happened, I think some change in the nand core. Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1463cd0 commit c2c8a3b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/mtd/nand/raw/fsmc_nand.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,10 +876,14 @@ static int fsmc_nand_probe_config_dt(struct platform_device *pdev,
876876
if (!of_property_read_u32(np, "bank-width", &val)) {
877877
if (val == 2) {
878878
nand->options |= NAND_BUSWIDTH_16;
879-
} else if (val != 1) {
879+
} else if (val == 1) {
880+
nand->options |= NAND_BUSWIDTH_AUTO;
881+
} else {
880882
dev_err(&pdev->dev, "invalid bank-width %u\n", val);
881883
return -EINVAL;
882884
}
885+
} else {
886+
nand->options |= NAND_BUSWIDTH_AUTO;
883887
}
884888

885889
if (of_property_read_bool(np, "nand-skip-bbtscan"))

0 commit comments

Comments
 (0)