]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
memory: tegra20-emc: Correct memory device mask
authorDmitry Osipenko <digetx@gmail.com>
Wed, 22 Dec 2021 04:32:15 +0000 (07:32 +0300)
committerKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Thu, 27 Jan 2022 09:40:35 +0000 (10:40 +0100)
Memory chip select is swapped when we read mode register, correct it.
We didn't have devices that use a single LPDDR chip and both chips are
always identical, hence this change is just a minor improvement.

Fixes: 131dd9a436d8 ("memory: tegra20-emc: Support matching timings by LPDDR2 configuration")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20211222043215.28237-2-digetx@gmail.com
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
drivers/memory/tegra/tegra20-emc.c

index 497b6edbf3ca107ec0b6001b15ce4ca34feaf340..25ba3c5e4ad6a69de298da1e658d822a6b3af631 100644 (file)
@@ -540,7 +540,7 @@ static int emc_read_lpddr_mode_register(struct tegra_emc *emc,
                                        unsigned int register_addr,
                                        unsigned int *register_data)
 {
-       u32 memory_dev = emem_dev + 1;
+       u32 memory_dev = emem_dev ? 1 : 2;
        u32 val, mr_mask = 0xff;
        int err;