summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/denali_dt.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-03-30 15:45:57 +0900
committerBoris Brezillon <boris.brezillon@free-electrons.com>2017-04-25 14:18:37 +0200
commite7beeeec854c40c28caa53bd84fdf26e9e459f06 (patch)
tree3e473fee320968bee3d762306697cf16e6f3b4b8 /drivers/mtd/nand/denali_dt.c
parent3f5c35819fc37d5f35680a55327c940b6e8fad41 (diff)
downloadop-kernel-dev-e7beeeec854c40c28caa53bd84fdf26e9e459f06.zip
op-kernel-dev-e7beeeec854c40c28caa53bd84fdf26e9e459f06.tar.gz
mtd: nand: denali: allow to override revision number
Commit 271707b1d817 ("mtd: nand: denali: max_banks calculation changed in revision 5.1") added a revision check to support the new max_banks encoding. Its git-log states "The encoding of max_banks changed in Denali revision 5.1". There are exceptional cases, for example, the revision register on some UniPhier SoCs says the IP is 5.0 but the max_banks is encoded in the new format. This IP updates the resister specification from time to time (often breaking the backward compatibility), but the revision number is not incremented correctly. The max_banks is not only the case that needs revision checking. Let's allow to override an incorrect revision number. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers/mtd/nand/denali_dt.c')
-rw-r--r--drivers/mtd/nand/denali_dt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index ada3863..df9ef36 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -30,6 +30,7 @@ struct denali_dt {
};
struct denali_dt_data {
+ unsigned int revision;
unsigned int caps;
};
@@ -60,8 +61,10 @@ static int denali_dt_probe(struct platform_device *pdev)
denali = &dt->denali;
data = of_device_get_match_data(&pdev->dev);
- if (data)
+ if (data) {
+ denali->revision = data->revision;
denali->caps = data->caps;
+ }
denali->platform = DT;
denali->dev = &pdev->dev;
OpenPOWER on IntegriCloud