summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-03-23 05:07:22 +0900
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-03-28 14:19:45 +0200
commitcc5d8031f8c7b11c325a37118f9aa6133f0b28a0 (patch)
tree7490ce79c2d8410002f7226df717c52ca6c9fb91 /drivers/mtd
parente93c1640e0387ab55b98b4e04600050f2beceac1 (diff)
downloadop-kernel-dev-cc5d8031f8c7b11c325a37118f9aa6133f0b28a0.zip
op-kernel-dev-cc5d8031f8c7b11c325a37118f9aa6133f0b28a0.tar.gz
mtd: nand: denali: set DEVICES_CONNECTED 1 if not set
Currently, the driver expects DEVICE_CONNECTED is automatically set by the hardware, but this feature is disabled in some cases. In such cases, it is the software's responsibility to set up the DEVICES_CONNECTED register. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/denali.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index e1c45bf..b442a3e 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1417,6 +1417,15 @@ static int denali_multidev_fixup(struct denali_nand_info *denali)
*/
denali->devnum = ioread32(denali->flash_reg + DEVICES_CONNECTED);
+ /*
+ * On some SoCs, DEVICES_CONNECTED is not auto-detected.
+ * For those, DEVICES_CONNECTED is left to 0. Set 1 if it is the case.
+ */
+ if (denali->devnum == 0) {
+ denali->devnum = 1;
+ iowrite32(1, denali->flash_reg + DEVICES_CONNECTED);
+ }
+
if (denali->devnum == 1)
return 0;
OpenPOWER on IntegriCloud