Skip to contentSkip to conversation

memory: tegra: Add APE memory clients for Tegra234

PATCH In review Sameer Pujar 4 participants 4 messages Feb 18, 2022 – Feb 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: tegra: Add APE memory clients for Tegra234

Add the memory clients on Tegra234 which are needed for APE DMA to properly use the SMMU.

---
Please note that this patch depends on the DT binding patches of series
https://patchwork.kernel.org/project/alsa-devel/list/?series=609494&state=*.
So please consider this patch once Thierry picks up DT binding patches and provides ACK on this.

 drivers/memory/tegra/tegra234.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/memory/tegra/tegra234.c +21 -1
index f7b24ba..1d19cb9 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (C) 2021 NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (C) 2021-2022, NVIDIA CORPORATION.  All rights reserved.
  */
 
 #include <soc/tegra/mc.h>
@@ -170,6 +170,26 @@ static const struct tegra_mc_client tegra234_mc_clients[] = {
 				.security = 0x4b4,
 			},
 		},
+	}, {
+		.id = TEGRA234_MEMORY_CLIENT_APEDMAR,
+		.name = "apedmar",
+		.sid = TEGRA234_SID_APE,
+		.regs = {
+			.sid = {
+				.override = 0x4f8,
+				.security = 0x4fc,
+			},
+		},
+	}, {
+		.id = TEGRA234_MEMORY_CLIENT_APEDMAW,
+		.name = "apedmaw",
+		.sid = TEGRA234_SID_APE,
+		.regs = {
+			.sid = {
+				.override = 0x500,
+				.security = 0x504,
+			},
+		},
 	},
 };
 
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Sameer Pujar

Add the memory clients on Tegra234 which are needed for APE DMA to properly use the SMMU.

---
Please note that this patch depends on the DT binding patches of series
https://patchwork.kernel.org/project/alsa-devel/list/?series=609494&state=*.
So please consider this patch once Thierry picks up DT binding patches and provides ACK on this.

I was not Cced on that patchset. Could you use scripts/get_maintainers.pl for obtaining list of people and lists to Cc?

If Thierry picks up dt-bindings patch and I take this one, does it compile? No, I don't think so. The order is screwed. This should be sent together to make such dependencies obvious.

Anyway, I cannot take it so:

Quoted 3 lines
 drivers/memory/tegra/tegra234.c | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

#2 lore raw
Quoted 14 lines · Krzysztof Kozlowski
Quoted 9 lines · Sameer Pujar

Add the memory clients on Tegra234 which are needed for APE DMA to properly use the SMMU.

---
Please note that this patch depends on the DT binding patches of series
https://patchwork.kernel.org/project/alsa-devel/list/?series=609494&state=*.
So please consider this patch once Thierry picks up DT binding patches and provides ACK on this.

I was not Cced on that patchset. Could you use scripts/get_maintainers.pl for obtaining list of people and lists to Cc?

Quoted 6 lines

If Thierry picks up dt-bindings patch and I take this one, does it compile? No, I don't think so. The order is screwed. This should be sent together to make such dependencies obvious.

Anyway, I cannot take it so:

This is my fault. I suggested Sameer send this out separately because we noticed the absence of this only after all the other patches had already been merged.

I'll pick this up into the Tegra tree and will send a PR sometime next week for your tree that contains all the dependencies needed for this to build.

Thierry

#3 lore raw
In reply to Sameer Pujar
Thank you for the patch! Yet something to improve:

Hi Sameer,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tegra/for-next]
[also build test ERROR on next-20220217]
[cannot apply to v5.17-rc5]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Sameer-Pujar/memory-tegra-Add-APE-memory-clients-for-Tegra234/20220220-190451
base:   https://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux.git for-next
config: arm64-randconfig-c004-20220220 (https://download.01.org/0day-ci/archive/20220221/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0

reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/2432353686ce99492ca9a6100ba6b121fa858950
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Sameer-Pujar/memory-tegra-Add-APE-memory-clients-for-Tegra234/20220220-190451 git checkout 2432353686ce99492ca9a6100ba6b121fa858950
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

>> drivers/memory/tegra/tegra234.c:74:23: error: 'TEGRA234_MEMORY_CLIENT_APEDMAR' undeclared here (not in a function); did you mean 'TEGRA234_MEMORY_CLIENT_BPMPDMAR'?
      74 |                 .id = TEGRA234_MEMORY_CLIENT_APEDMAR,
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                       TEGRA234_MEMORY_CLIENT_BPMPDMAR
>> drivers/memory/tegra/tegra234.c:76:24: error: 'TEGRA234_SID_APE' undeclared here (not in a function); did you mean 'TEGRA234_SID_BPMP'?
      76 |                 .sid = TEGRA234_SID_APE,
         |                        ^~~~~~~~~~~~~~~~
         |                        TEGRA234_SID_BPMP
>> drivers/memory/tegra/tegra234.c:84:23: error: 'TEGRA234_MEMORY_CLIENT_APEDMAW' undeclared here (not in a function); did you mean 'TEGRA234_MEMORY_CLIENT_BPMPDMAW'?
      84 |                 .id = TEGRA234_MEMORY_CLIENT_APEDMAW,
         |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                       TEGRA234_MEMORY_CLIENT_BPMPDMAW

vim +74 drivers/memory/tegra/tegra234.c

    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			.id = TEGRA234_MEMORY_CLIENT_APEDMAR,
    75			.name = "apedmar",
  > 76			.sid = TEGRA234_SID_APE,
    77			.regs = {
    78				.sid = {
    79					.override = 0x4f8,
    80					.security = 0x4fc,
    81				},
    82			},
    83		}, {
  > 84			.id = TEGRA234_MEMORY_CLIENT_APEDMAW,
    85			.name = "apedmaw",
    86			.sid = TEGRA234_SID_APE,
    87			.regs = {
    88				.sid = {
    89					.override = 0x500,
    90					.security = 0x504,
    91				},
    92			},
    93		},
    94	};
    95	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]