Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Thierry Reding and committed by
Krzysztof Kozlowski
72c81bb6 31231092

+95 -1
+2
drivers/memory/tegra/Makefile
··· 9 9 tegra-mc-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o 10 10 tegra-mc-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186.o 11 11 tegra-mc-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186.o tegra194.o 12 + tegra-mc-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186.o tegra234.o 12 13 13 14 obj-$(CONFIG_TEGRA_MC) += tegra-mc.o 14 15 ··· 20 19 obj-$(CONFIG_TEGRA210_EMC) += tegra210-emc.o 21 20 obj-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-emc.o 22 21 obj-$(CONFIG_ARCH_TEGRA_194_SOC) += tegra186-emc.o 22 + obj-$(CONFIG_ARCH_TEGRA_234_SOC) += tegra186-emc.o 23 23 24 24 tegra210-emc-y := tegra210-emc-core.o tegra210-emc-cc-r21021.o
+3
drivers/memory/tegra/mc.c
··· 45 45 #ifdef CONFIG_ARCH_TEGRA_194_SOC 46 46 { .compatible = "nvidia,tegra194-mc", .data = &tegra194_mc_soc }, 47 47 #endif 48 + #ifdef CONFIG_ARCH_TEGRA_234_SOC 49 + { .compatible = "nvidia,tegra234-mc", .data = &tegra234_mc_soc }, 50 + #endif 48 51 { /* sentinel */ } 49 52 }; 50 53 MODULE_DEVICE_TABLE(of, tegra_mc_of_match);
+6 -1
drivers/memory/tegra/mc.h
··· 137 137 extern const struct tegra_mc_soc tegra194_mc_soc; 138 138 #endif 139 139 140 + #ifdef CONFIG_ARCH_TEGRA_234_SOC 141 + extern const struct tegra_mc_soc tegra234_mc_soc; 142 + #endif 143 + 140 144 #if defined(CONFIG_ARCH_TEGRA_3x_SOC) || \ 141 145 defined(CONFIG_ARCH_TEGRA_114_SOC) || \ 142 146 defined(CONFIG_ARCH_TEGRA_124_SOC) || \ ··· 151 147 #endif 152 148 153 149 #if defined(CONFIG_ARCH_TEGRA_186_SOC) || \ 154 - defined(CONFIG_ARCH_TEGRA_194_SOC) 150 + defined(CONFIG_ARCH_TEGRA_194_SOC) || \ 151 + defined(CONFIG_ARCH_TEGRA_234_SOC) 155 152 extern const struct tegra_mc_ops tegra186_mc_ops; 156 153 #endif 157 154
+3
drivers/memory/tegra/tegra186-emc.c
··· 273 273 #if defined(CONFIG_ARCH_TEGRA_194_SOC) 274 274 { .compatible = "nvidia,tegra194-emc" }, 275 275 #endif 276 + #if defined(CONFIG_ARCH_TEGRA_234_SOC) 277 + { .compatible = "nvidia,tegra234-emc" }, 278 + #endif 276 279 { /* sentinel */ } 277 280 }; 278 281 MODULE_DEVICE_TABLE(of, tegra186_emc_of_match);
+81
drivers/memory/tegra/tegra234.c
··· 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 + };