diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-03-30 08:45:57 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@free-electrons.com> | 2017-04-25 14:18:37 +0200 |
commit | e7beeeec854c40c28caa53bd84fdf26e9e459f06 (patch) | |
tree | 3e473fee320968bee3d762306697cf16e6f3b4b8 /drivers/mtd/nand/denali_dt.c | |
parent | mtd: nand: denali_dt: use pdev instead of ofdev for platform_device (diff) | |
download | linux-e7beeeec854c40c28caa53bd84fdf26e9e459f06.tar.xz linux-e7beeeec854c40c28caa53bd84fdf26e9e459f06.zip |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index ada38636122c..df9ef36cc2ce 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; |