Skip to content

Commit 62bd59c

Browse files
committed
Merge tag 'tegra-for-6.17-memory' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into soc/drivers
memory: tegra: Updates for v6.17-rc1 Enable support for the memory and external memory controllers found on Tegra264. * tag 'tegra-for-6.17-memory' of https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Add Tegra264 MC and EMC support dt-bindings: memory: tegra: Add Tegra264 support Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 27d0ff5 + 2401dc4 commit 62bd59c

File tree

9 files changed

+613
-8
lines changed

9 files changed

+613
-8
lines changed

Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ properties:
3232
- nvidia,tegra186-mc
3333
- nvidia,tegra194-mc
3434
- nvidia,tegra234-mc
35+
- nvidia,tegra264-mc
3536

3637
reg:
3738
minItems: 6
@@ -42,8 +43,12 @@ properties:
4243
maxItems: 18
4344

4445
interrupts:
45-
items:
46-
- description: MC general interrupt
46+
minItems: 1
47+
maxItems: 8
48+
49+
interrupt-names:
50+
minItems: 1
51+
maxItems: 8
4752

4853
"#address-cells":
4954
const: 2
@@ -74,6 +79,7 @@ patternProperties:
7479
- nvidia,tegra186-emc
7580
- nvidia,tegra194-emc
7681
- nvidia,tegra234-emc
82+
- nvidia,tegra264-emc
7783

7884
reg:
7985
minItems: 1
@@ -127,6 +133,15 @@ patternProperties:
127133
reg:
128134
minItems: 2
129135

136+
- if:
137+
properties:
138+
compatible:
139+
const: nvidia,tegra264-emc
140+
then:
141+
properties:
142+
reg:
143+
minItems: 2
144+
130145
additionalProperties: false
131146

132147
required:
@@ -158,6 +173,12 @@ allOf:
158173
- const: ch2
159174
- const: ch3
160175

176+
interrupts:
177+
items:
178+
- description: MC general interrupt
179+
180+
interrupt-names: false
181+
161182
- if:
162183
properties:
163184
compatible:
@@ -189,6 +210,12 @@ allOf:
189210
- const: ch14
190211
- const: ch15
191212

213+
interrupts:
214+
items:
215+
- description: MC general interrupt
216+
217+
interrupt-names: false
218+
192219
- if:
193220
properties:
194221
compatible:
@@ -220,6 +247,59 @@ allOf:
220247
- const: ch14
221248
- const: ch15
222249

250+
interrupts:
251+
items:
252+
- description: MC general interrupt
253+
254+
interrupt-names: false
255+
256+
- if:
257+
properties:
258+
compatible:
259+
const: nvidia,tegra264-mc
260+
then:
261+
properties:
262+
reg:
263+
minItems: 17
264+
maxItems: 17
265+
description: 17 memory controller channels
266+
267+
reg-names:
268+
items:
269+
- const: broadcast
270+
- const: ch0
271+
- const: ch1
272+
- const: ch2
273+
- const: ch3
274+
- const: ch4
275+
- const: ch5
276+
- const: ch6
277+
- const: ch7
278+
- const: ch8
279+
- const: ch9
280+
- const: ch10
281+
- const: ch11
282+
- const: ch12
283+
- const: ch13
284+
- const: ch14
285+
- const: ch15
286+
287+
interrupts:
288+
minItems: 8
289+
maxItems: 8
290+
description: One interrupt line for each MC component
291+
292+
interrupt-names:
293+
items:
294+
- const: mcf
295+
- const: hub1
296+
- const: hub2
297+
- const: hub3
298+
- const: hub4
299+
- const: hub5
300+
- const: sbs
301+
- const: channel
302+
223303
additionalProperties: false
224304

225305
required:

drivers/memory/tegra/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ 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
1212
tegra-mc-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186.o tegra234.o
13+
tegra-mc-$(CONFIG_ARCH_TEGRA_264_SOC) += tegra186.o tegra264.o
1314

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

@@ -21,5 +22,6 @@ obj-$(CONFIG_TEGRA210_EMC) += tegra210-emc.o
2122
obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-emc.o
2223
obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186-emc.o
2324
obj-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186-emc.o
25+
obj-$(CONFIG_ARCH_TEGRA_264_SOC) += tegra186-emc.o
2426

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

drivers/memory/tegra/mc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (C) 2014-2025 NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/clk.h>
@@ -48,6 +48,9 @@ static const struct of_device_id tegra_mc_of_match[] = {
4848
#endif
4949
#ifdef CONFIG_ARCH_TEGRA_234_SOC
5050
{ .compatible = "nvidia,tegra234-mc", .data = &tegra234_mc_soc },
51+
#endif
52+
#ifdef CONFIG_ARCH_TEGRA_264_SOC
53+
{ .compatible = "nvidia,tegra264-mc", .data = &tegra264_mc_soc },
5154
#endif
5255
{ /* sentinel */ }
5356
};

drivers/memory/tegra/mc.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* Copyright (C) 2014 NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (C) 2014-2025 NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#ifndef MEMORY_TEGRA_MC_H
@@ -182,6 +182,10 @@ extern const struct tegra_mc_soc tegra194_mc_soc;
182182
extern const struct tegra_mc_soc tegra234_mc_soc;
183183
#endif
184184

185+
#ifdef CONFIG_ARCH_TEGRA_264_SOC
186+
extern const struct tegra_mc_soc tegra264_mc_soc;
187+
#endif
188+
185189
#if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \
186190
defined(CONFIG_ARCH_TEGRA_114_SOC) || \
187191
defined(CONFIG_ARCH_TEGRA_124_SOC) || \
@@ -193,7 +197,8 @@ extern const struct tegra_mc_ops tegra30_mc_ops;
193197

194198
#if defined(CONFIG_ARCH_TEGRA_186_SOC) || \
195199
defined(CONFIG_ARCH_TEGRA_194_SOC) || \
196-
defined(CONFIG_ARCH_TEGRA_234_SOC)
200+
defined(CONFIG_ARCH_TEGRA_234_SOC) || \
201+
defined(CONFIG_ARCH_TEGRA_264_SOC)
197202
extern const struct tegra_mc_ops tegra186_mc_ops;
198203
#endif
199204

drivers/memory/tegra/tegra186-emc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2019 NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (C) 2019-2025 NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/clk.h>
@@ -393,6 +393,9 @@ static const struct of_device_id tegra186_emc_of_match[] = {
393393
#endif
394394
#if defined(CONFIG_ARCH_TEGRA_234_SOC)
395395
{ .compatible = "nvidia,tegra234-emc" },
396+
#endif
397+
#if defined(CONFIG_ARCH_TEGRA_264_SOC)
398+
{ .compatible = "nvidia,tegra264-emc" },
396399
#endif
397400
{ /* sentinel */ }
398401
};

drivers/memory/tegra/tegra186.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
3-
* Copyright (C) 2017-2021 NVIDIA CORPORATION. All rights reserved.
3+
* Copyright (C) 2017-2025 NVIDIA CORPORATION. All rights reserved.
44
*/
55

66
#include <linux/io.h>
@@ -26,11 +26,24 @@
2626
static int tegra186_mc_probe(struct tegra_mc *mc)
2727
{
2828
struct platform_device *pdev = to_platform_device(mc->dev);
29+
struct resource *res;
2930
unsigned int i;
3031
char name[8];
3132
int err;
3233

33-
mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast");
34+
/*
35+
* From Tegra264, the SID region is not present in MC node and BROADCAST is first.
36+
* The common function 'tegra_mc_probe()' already maps first region entry from DT.
37+
* Check if the SID region is present in DT then map BROADCAST. Otherwise, consider
38+
* the first entry mapped in mc probe as the BROADCAST region. This is done to avoid
39+
* mapping the region twice when SID is not present and keep backward compatibility.
40+
*/
41+
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sid");
42+
if (res)
43+
mc->bcast_ch_regs = devm_platform_ioremap_resource_byname(pdev, "broadcast");
44+
else
45+
mc->bcast_ch_regs = mc->regs;
46+
3447
if (IS_ERR(mc->bcast_ch_regs)) {
3548
if (PTR_ERR(mc->bcast_ch_regs) == -EINVAL) {
3649
dev_warn(&pdev->dev,

drivers/memory/tegra/tegra264-bwmgr.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/* Copyright (C) 2025 NVIDIA CORPORATION. All rights reserved. */
3+
4+
#ifndef MEMORY_TEGRA_TEGRA264_BWMGR_H
5+
#define MEMORY_TEGRA_TEGRA264_BWMGR_H
6+
7+
#define TEGRA264_BWMGR_ICC_PRIMARY 1
8+
#define TEGRA264_BWMGR_DEBUG 2
9+
#define TEGRA264_BWMGR_CPU_CLUSTER0 3
10+
#define TEGRA264_BWMGR_CPU_CLUSTER1 4
11+
#define TEGRA264_BWMGR_CPU_CLUSTER2 5
12+
#define TEGRA264_BWMGR_CPU_CLUSTER3 6
13+
#define TEGRA264_BWMGR_CPU_CLUSTER4 7
14+
#define TEGRA264_BWMGR_CPU_CLUSTER5 8
15+
#define TEGRA264_BWMGR_CPU_CLUSTER6 9
16+
#define TEGRA264_BWMGR_CACTMON 10
17+
#define TEGRA264_BWMGR_DISPLAY 11
18+
#define TEGRA264_BWMGR_VI 12
19+
#define TEGRA264_BWMGR_APE 13
20+
#define TEGRA264_BWMGR_VIFAL 14
21+
#define TEGRA264_BWMGR_GPU 15
22+
#define TEGRA264_BWMGR_EQOS 16
23+
#define TEGRA264_BWMGR_PCIE_0 17
24+
#define TEGRA264_BWMGR_PCIE_1 18
25+
#define TEGRA264_BWMGR_PCIE_2 19
26+
#define TEGRA264_BWMGR_PCIE_3 20
27+
#define TEGRA264_BWMGR_PCIE_4 21
28+
#define TEGRA264_BWMGR_PCIE_5 22
29+
#define TEGRA264_BWMGR_SDMMC_1 23
30+
#define TEGRA264_BWMGR_SDMMC_2 24
31+
#define TEGRA264_BWMGR_NVDEC 25
32+
#define TEGRA264_BWMGR_NVENC 26
33+
#define TEGRA264_BWMGR_NVJPG_0 27
34+
#define TEGRA264_BWMGR_NVJPG_1 28
35+
#define TEGRA264_BWMGR_OFAA 29
36+
#define TEGRA264_BWMGR_XUSB_HOST 30
37+
#define TEGRA264_BWMGR_XUSB_DEV 31
38+
#define TEGRA264_BWMGR_TSEC 32
39+
#define TEGRA264_BWMGR_VIC 33
40+
#define TEGRA264_BWMGR_APEDMA 34
41+
#define TEGRA264_BWMGR_SE 35
42+
#define TEGRA264_BWMGR_ISP 36
43+
#define TEGRA264_BWMGR_HDA 37
44+
#define TEGRA264_BWMGR_VI2FAL 38
45+
#define TEGRA264_BWMGR_VI2 39
46+
#define TEGRA264_BWMGR_RCE 40
47+
#define TEGRA264_BWMGR_PVA 41
48+
#define TEGRA264_BWMGR_NVPMODEL 42
49+
50+
#endif

0 commit comments

Comments
 (0)