diff options
author | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2022-02-06 14:58:06 +0100 |
---|---|---|
committer | Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> | 2022-02-09 15:34:42 +0100 |
commit | 4e890b2228fd14fa6269175e9816bf27ff989e84 (patch) | |
tree | 6236e42003d524b16c68e6111a08a3ae927ecf18 /drivers/memory | |
parent | dt-bindings: memory: lpddr3: deprecate passing timings frequency as unit address (diff) | |
download | linux-4e890b2228fd14fa6269175e9816bf27ff989e84.tar.xz linux-4e890b2228fd14fa6269175e9816bf27ff989e84.zip |
memory: of: parse max-freq property
Passing the memory timings maximum frequency as an unit address was
a workaround and instead 'max-freq' is preferred. Look for 'max-freq'
first and then fallback to 'reg'.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Alim Akhtar <alim.ahtar@samsung.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220206135807.211767-8-krzysztof.kozlowski@canonical.com
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/of_memory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/memory/of_memory.c b/drivers/memory/of_memory.c index b94408954d85..bac5c7f34936 100644 --- a/drivers/memory/of_memory.c +++ b/drivers/memory/of_memory.c @@ -212,8 +212,10 @@ static int of_lpddr3_do_get_timings(struct device_node *np, { int ret; - /* The 'reg' param required since DT has changed, used as 'max-freq' */ - ret = of_property_read_u32(np, "reg", &tim->max_freq); + ret = of_property_read_u32(np, "max-freq", &tim->max_freq); + if (ret) + /* Deprecated way of passing max-freq as 'reg' */ + ret = of_property_read_u32(np, "reg", &tim->max_freq); ret |= of_property_read_u32(np, "min-freq", &tim->min_freq); ret |= of_property_read_u32(np, "tRFC", &tim->tRFC); ret |= of_property_read_u32(np, "tRRD", &tim->tRRD); |