Skip to content

Commit 72c81bb

Browse files
thierryredingkrzk
authored andcommitted
memory: tegra: Add Tegra234 support
The memory controller and external memory controller found on Tegra234 is similar to the version found on earlier SoCs but supports a number of new memory clients. Add initial memory client definitions for the Tegra234 so that the SMMU stream ID override registers can be properly programmed at boot time. Signed-off-by: Thierry Reding <treding@nvidia.com> Link: https://lore.kernel.org/r/20220506132312.3910637-2-thierry.reding@gmail.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent 3123109 commit 72c81bb

5 files changed

Lines changed: 95 additions & 1 deletion

File tree

drivers/memory/tegra/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ tegra-mc-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124.o
99
tegra-mc-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o
1010
tegra-mc-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186.o
1111
tegra-mc-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186.o tegra194.o
12+
tegra-mc-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186.o tegra234.o
1213

1314
obj-$(CONFIG_TEGRA_MC) += tegra-mc.o
1415

@@ -19,5 +20,6 @@ obj-$(CONFIG_TEGRA210_EMC_TABLE) += tegra210-emc-table.o
1920
obj-$(CONFIG_TEGRA210_EMC) += tegra210-emc.o
2021
obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-emc.o
2122
obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186-emc.o
23+
obj-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186-emc.o
2224

2325
tegra210-emc-y := tegra210-emc-core.o tegra210-emc-cc-r21021.o

drivers/memory/tegra/mc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ static const struct of_device_id tegra_mc_of_match[] = {
4444
#endif
4545
#ifdef CONFIG_ARCH_TEGRA_194_SOC
4646
{ .compatible = "nvidia,tegra194-mc", .data = &tegra194_mc_soc },
47+
#endif
48+
#ifdef CONFIG_ARCH_TEGRA_234_SOC
49+
{ .compatible = "nvidia,tegra234-mc", .data = &tegra234_mc_soc },
4750
#endif
4851
{ /* sentinel */ }
4952
};

drivers/memory/tegra/mc.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ extern const struct tegra_mc_soc tegra186_mc_soc;
137137
extern const struct tegra_mc_soc tegra194_mc_soc;
138138
#endif
139139

140+
#ifdef CONFIG_ARCH_TEGRA_234_SOC
141+
extern const struct tegra_mc_soc tegra234_mc_soc;
142+
#endif
143+
140144
#if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \
141145
defined(CONFIG_ARCH_TEGRA_114_SOC) || \
142146
defined(CONFIG_ARCH_TEGRA_124_SOC) || \
@@ -147,7 +151,8 @@ extern const struct tegra_mc_ops tegra30_mc_ops;
147151
#endif
148152

149153
#if defined(CONFIG_ARCH_TEGRA_186_SOC) || \
150-
defined(CONFIG_ARCH_TEGRA_194_SOC)
154+
defined(CONFIG_ARCH_TEGRA_194_SOC) || \
155+
defined(CONFIG_ARCH_TEGRA_234_SOC)
151156
extern const struct tegra_mc_ops tegra186_mc_ops;
152157
#endif
153158

drivers/memory/tegra/tegra186-emc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ static const struct of_device_id tegra186_emc_of_match[] = {
272272
#endif
273273
#if defined(CONFIG_ARCH_TEGRA_194_SOC)
274274
{ .compatible = "nvidia,tegra194-emc" },
275+
#endif
276+
#if defined(CONFIG_ARCH_TEGRA_234_SOC)
277+
{ .compatible = "nvidia,tegra234-emc" },
275278
#endif
276279
{ /* sentinel */ }
277280
};

drivers/memory/tegra/tegra234.c

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/*
3+
* Copyright (C) 2021 NVIDIA CORPORATION. All rights reserved.
4+
*/
5+
6+
#include <soc/tegra/mc.h>
7+
8+
#include <dt-bindings/memory/tegra234-mc.h>
9+
10+
#include "mc.h"
11+
12+
static const struct tegra_mc_client tegra234_mc_clients[] = {
13+
{
14+
.id = TEGRA234_MEMORY_CLIENT_SDMMCRAB,
15+
.name = "sdmmcrab",
16+
.sid = TEGRA234_SID_SDMMC4,
17+
.regs = {
18+
.sid = {
19+
.override = 0x318,
20+
.security = 0x31c,
21+
},
22+
},
23+
}, {
24+
.id = TEGRA234_MEMORY_CLIENT_SDMMCWAB,
25+
.name = "sdmmcwab",
26+
.sid = TEGRA234_SID_SDMMC4,
27+
.regs = {
28+
.sid = {
29+
.override = 0x338,
30+
.security = 0x33c,
31+
},
32+
},
33+
}, {
34+
.id = TEGRA234_MEMORY_CLIENT_BPMPR,
35+
.name = "bpmpr",
36+
.sid = TEGRA234_SID_BPMP,
37+
.regs = {
38+
.sid = {
39+
.override = 0x498,
40+
.security = 0x49c,
41+
},
42+
},
43+
}, {
44+
.id = TEGRA234_MEMORY_CLIENT_BPMPW,
45+
.name = "bpmpw",
46+
.sid = TEGRA234_SID_BPMP,
47+
.regs = {
48+
.sid = {
49+
.override = 0x4a0,
50+
.security = 0x4a4,
51+
},
52+
},
53+
}, {
54+
.id = TEGRA234_MEMORY_CLIENT_BPMPDMAR,
55+
.name = "bpmpdmar",
56+
.sid = TEGRA234_SID_BPMP,
57+
.regs = {
58+
.sid = {
59+
.override = 0x4a8,
60+
.security = 0x4ac,
61+
},
62+
},
63+
}, {
64+
.id = TEGRA234_MEMORY_CLIENT_BPMPDMAW,
65+
.name = "bpmpdmaw",
66+
.sid = TEGRA234_SID_BPMP,
67+
.regs = {
68+
.sid = {
69+
.override = 0x4b0,
70+
.security = 0x4b4,
71+
},
72+
},
73+
},
74+
};
75+
76+
const struct tegra_mc_soc tegra234_mc_soc = {
77+
.num_clients = ARRAY_SIZE(tegra234_mc_clients),
78+
.clients = tegra234_mc_clients,
79+
.num_address_bits = 40,
80+
.ops = &tegra186_mc_ops,
81+
};

0 commit comments

Comments
 (0)