summaryrefslogtreecommitdiffstats
path: root/drivers/memory
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2022-02-24 01:34:20 +0100
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>2022-02-25 13:36:49 +0100
commita06bf59d07f45a0a6ab4ab8ac69c1d708d3fadcb (patch)
treee61cc6cdeb93bcc1260fecb30303e08997a4cef4 /drivers/memory
parentdt-bindings: memory: lpddr2: Adjust revision ID property to match lpddr3 (diff)
downloadlinux-a06bf59d07f45a0a6ab4ab8ac69c1d708d3fadcb.tar.xz
linux-a06bf59d07f45a0a6ab4ab8ac69c1d708d3fadcb.zip
memory: Update of_memory lpddr2 revision-id binding
This patch updates the code parsing the "jedec,lpddr2" device tree binding to use the new `revision-id` property instead of the deprecated `revision-id1` and `revision-id2` properties if available. Signed-off-by: Julius Werner <jwerner@chromium.org> Link: https://lore.kernel.org/r/20220224003421.3440124-3-jwerner@chromium.org Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/of_memory.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/drivers/memory/of_memory.c b/drivers/memory/of_memory.c
index bac5c7f34936..dbdf87bc0b78 100644
--- a/drivers/memory/of_memory.c
+++ b/drivers/memory/of_memory.c
@@ -318,14 +318,21 @@ const struct lpddr2_info
struct property *prop;
const char *cp;
int err;
-
- err = of_property_read_u32(np, "revision-id1", &info.revision_id1);
- if (err)
- info.revision_id1 = -ENOENT;
-
- err = of_property_read_u32(np, "revision-id2", &info.revision_id2);
- if (err)
- info.revision_id2 = -ENOENT;
+ u32 revision_id[2];
+
+ err = of_property_read_u32_array(np, "revision-id", revision_id, 2);
+ if (!err) {
+ info.revision_id1 = revision_id[0];
+ info.revision_id2 = revision_id[1];
+ } else {
+ err = of_property_read_u32(np, "revision-id1", &info.revision_id1);
+ if (err)
+ info.revision_id1 = -ENOENT;
+
+ err = of_property_read_u32(np, "revision-id2", &info.revision_id2);
+ if (err)
+ info.revision_id2 = -ENOENT;
+ }
err = of_property_read_u32(np, "io-width", &info.io_width);
if (err)