summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrad Griffis <bgriffis@nvidia.com>2022-01-31 19:29:03 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2022-02-02 15:10:57 -0500
commit70c252977fc080c829b195fece6f46f73586f1e4 (patch)
tree8b874632bbc92fd6e42fc4ba8cb67ca6c23b5b81 /drivers
parent61b6f004d9893c90a4d61fe35878948844cfe9e3 (diff)
platform: tegra: mc: add option to disable L3 alloc hint from mss nvlink
Accessing memory beyond 64GB boundary from GPU on Xavier needs L3 cache alloc hint disabled at mss nvlink. Bug 3486025 Change-Id: Iac3a8932a6877b371df15d3e0d8dc9ebe1e48bdd Signed-off-by: Brad Griffis <bgriffis@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2662169 Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers')
-rw-r--r--drivers/platform/tegra/mc/mc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/platform/tegra/mc/mc.c b/drivers/platform/tegra/mc/mc.c
index 38011ecc4..164ca1e74 100644
--- a/drivers/platform/tegra/mc/mc.c
+++ b/drivers/platform/tegra/mc/mc.c
@@ -2,7 +2,7 @@
2 * arch/arm/mach-tegra/mc.c 2 * arch/arm/mach-tegra/mc.c
3 * 3 *
4 * Copyright (C) 2010 Google, Inc. 4 * Copyright (C) 2010 Google, Inc.
5 * Copyright (C) 2011-2021, NVIDIA Corporation. All rights reserved. 5 * Copyright (C) 2011-2022, NVIDIA Corporation. All rights reserved.
6 * 6 *
7 * Author: 7 * Author:
8 * Erik Gilling <konkers@google.com> 8 * Erik Gilling <konkers@google.com>
@@ -320,6 +320,7 @@ static void enable_mssnvlinks(struct platform_device *pdev)
320 void __iomem *regs; 320 void __iomem *regs;
321 int ret = 0, i; 321 int ret = 0, i;
322 u32 reg_val; 322 u32 reg_val;
323 bool disable_l3_alloc_hint = false;
323 324
324 /* MSSNVLINK support is available in silicon or fpga only */ 325 /* MSSNVLINK support is available in silicon or fpga only */
325 if (!tegra_platform_is_silicon()) 326 if (!tegra_platform_is_silicon())
@@ -346,6 +347,8 @@ static void enable_mssnvlinks(struct platform_device *pdev)
346 goto err_out; 347 goto err_out;
347 } 348 }
348 349
350 disable_l3_alloc_hint = of_property_read_bool(dn, "disable-nvlink-l3-alloc-hint");
351
349 for (i = 0; i < mssnvlink_hubs; i++) { 352 for (i = 0; i < mssnvlink_hubs; i++) {
350 regs = of_iomap(dn, i); 353 regs = of_iomap(dn, i);
351 if (!regs) { 354 if (!regs) {
@@ -355,7 +358,8 @@ static void enable_mssnvlinks(struct platform_device *pdev)
355 } 358 }
356 mssnvlink_regs[i] = regs; 359 mssnvlink_regs[i] = regs;
357 reg_val = __raw_readl(regs + MSSNVLINK_CYA_DESIGN_MODES); 360 reg_val = __raw_readl(regs + MSSNVLINK_CYA_DESIGN_MODES);
358 reg_val |= MSS_NVLINK_L3_ALLOC_HINT; 361 if (!disable_l3_alloc_hint)
362 reg_val |= MSS_NVLINK_L3_ALLOC_HINT;
359 __raw_writel(reg_val, regs + MSSNVLINK_CYA_DESIGN_MODES); 363 __raw_writel(reg_val, regs + MSSNVLINK_CYA_DESIGN_MODES);
360 nvlink_reg_val[i] = reg_val; 364 nvlink_reg_val[i] = reg_val;
361 } 365 }