mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-19 07:16:20 +07:00
ARM: tegra: Memory controller updates for v4.3-rc1
Adds support for Tegra210, which allows the SMMU to be used on this new SoC generation. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJVzfK2AAoJEN0jrNd/PrOhR2cP/RYqGcXQMbHPnDY4Za7dXtGW nG+NFNLBdVsyPk7ol9p1WRNKVkWSObJ4RN669CyRbk6JvBf7xYXSp9i0mh7FSMow WBCk3sraN8L8txXOYMnut2+b/3xNGrVxgh8RmQ4aRZY+UDMXlX+cAyuEBhGTDR1G N0KhIO3SYDGRMCJ6w3sV0lT+Ac0I5+iG94kRxoqyaO/mi/EA3I3rOaYaiHujCQxJ 1LrQAY35NTC0Pwsdqq7ivPEHkL9Ki4/rvPnVocZea4H+MSZ/gTSHpe7rPOF4vGPS imERpyN4eJwZlQnOC8ism3TQPHGiKux8xEtNBV76IHmB27O7A+cJhQWFzdKGQpGB tMcqyr5aJGFwJ2Rba0NKo61xyIqXgE4pW85DKAuN6cnWlZ5+J8Mjv5788tMShwMI aMPm3na6gtiH2zhkE0MEt0qizDM9BUnlF3be5gVQejr4jNDOFe62opvyzq42iO2z 8NQ9amgMQXfwql7Wr6T+Fa5VgTPRS2VEjf7knJaYFXVih5nP5SGK6fvkLIb2MN07 DKZ5rbrXBxx4kpZiftnE1wPwQC6EHg5FT+4MDW877Lw1dbDllM179cOgRJowLo0G zkPOvHKiQFLx/32MZJfXp5vbDeX11Q2LOgNc+/D46dSm7ElnuEXylnc4vOuvFDU9 AkuPLVT4wos1SsvtL8v6 =H73u -----END PGP SIGNATURE----- Merge tag 'tegra-for-4.3-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers ARM: tegra: Memory controller updates for v4.3-rc1 Adds support for Tegra210, which allows the SMMU to be used on this new SoC generation. * tag 'tegra-for-4.3-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux: memory: tegra: Add Tegra210 support memory: tegra: Add support for a variable-size client ID bitfield memory: tegra: Expose supported rates via debugfs Signed-off-by: Olof Johansson <olof@lixom.net>
This commit is contained in:
commit
21815b9a24
@ -222,7 +222,7 @@ config TEGRA_IOMMU_SMMU
|
||||
select IOMMU_API
|
||||
help
|
||||
This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
|
||||
SoCs (Tegra30 up to Tegra132).
|
||||
SoCs (Tegra30 up to Tegra210).
|
||||
|
||||
config EXYNOS_IOMMU
|
||||
bool "Exynos IOMMU Support"
|
||||
|
@ -4,6 +4,7 @@ tegra-mc-$(CONFIG_ARCH_TEGRA_3x_SOC) += tegra30.o
|
||||
tegra-mc-$(CONFIG_ARCH_TEGRA_114_SOC) += tegra114.o
|
||||
tegra-mc-$(CONFIG_ARCH_TEGRA_124_SOC) += tegra124.o
|
||||
tegra-mc-$(CONFIG_ARCH_TEGRA_132_SOC) += tegra124.o
|
||||
tegra-mc-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210.o
|
||||
|
||||
obj-$(CONFIG_TEGRA_MC) += tegra-mc.o
|
||||
|
||||
|
@ -42,7 +42,6 @@
|
||||
#define MC_ERR_STATUS_ADR_HI_MASK 0x3
|
||||
#define MC_ERR_STATUS_SECURITY (1 << 17)
|
||||
#define MC_ERR_STATUS_RW (1 << 16)
|
||||
#define MC_ERR_STATUS_CLIENT_MASK 0x7f
|
||||
|
||||
#define MC_ERR_ADR 0x0c
|
||||
|
||||
@ -66,6 +65,9 @@ static const struct of_device_id tegra_mc_of_match[] = {
|
||||
#endif
|
||||
#ifdef CONFIG_ARCH_TEGRA_132_SOC
|
||||
{ .compatible = "nvidia,tegra132-mc", .data = &tegra132_mc_soc },
|
||||
#endif
|
||||
#ifdef CONFIG_ARCH_TEGRA_210_SOC
|
||||
{ .compatible = "nvidia,tegra210-mc", .data = &tegra210_mc_soc },
|
||||
#endif
|
||||
{ }
|
||||
};
|
||||
@ -283,7 +285,7 @@ static irqreturn_t tegra_mc_irq(int irq, void *data)
|
||||
else
|
||||
secure = "";
|
||||
|
||||
id = value & MC_ERR_STATUS_CLIENT_MASK;
|
||||
id = value & mc->soc->client_id_mask;
|
||||
|
||||
for (i = 0; i < mc->soc->num_clients; i++) {
|
||||
if (mc->soc->clients[i].id == id) {
|
||||
@ -410,6 +412,8 @@ static int tegra_mc_probe(struct platform_device *pdev)
|
||||
return err;
|
||||
}
|
||||
|
||||
WARN(!mc->soc->client_id_mask, "Missing client ID mask for this SoC\n");
|
||||
|
||||
value = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR |
|
||||
MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE |
|
||||
MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM;
|
||||
|
@ -41,4 +41,8 @@ extern const struct tegra_mc_soc tegra124_mc_soc;
|
||||
extern const struct tegra_mc_soc tegra132_mc_soc;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_TEGRA_210_SOC
|
||||
extern const struct tegra_mc_soc tegra210_mc_soc;
|
||||
#endif
|
||||
|
||||
#endif /* MEMORY_TEGRA_MC_H */
|
||||
|
@ -944,5 +944,6 @@ const struct tegra_mc_soc tegra114_mc_soc = {
|
||||
.num_clients = ARRAY_SIZE(tegra114_mc_clients),
|
||||
.num_address_bits = 32,
|
||||
.atom_size = 32,
|
||||
.client_id_mask = 0x7f,
|
||||
.smmu = &tegra114_smmu_soc,
|
||||
};
|
||||
|
@ -1027,7 +1027,40 @@ static int emc_debug_rate_set(void *data, u64 rate)
|
||||
DEFINE_SIMPLE_ATTRIBUTE(emc_debug_rate_fops, emc_debug_rate_get,
|
||||
emc_debug_rate_set, "%lld\n");
|
||||
|
||||
static void emc_debugfs_init(struct device *dev)
|
||||
static int emc_debug_supported_rates_show(struct seq_file *s, void *data)
|
||||
{
|
||||
struct tegra_emc *emc = s->private;
|
||||
const char *prefix = "";
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < emc->num_timings; i++) {
|
||||
struct emc_timing *timing = &emc->timings[i];
|
||||
|
||||
seq_printf(s, "%s%lu", prefix, timing->rate);
|
||||
|
||||
prefix = " ";
|
||||
}
|
||||
|
||||
seq_puts(s, "\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int emc_debug_supported_rates_open(struct inode *inode,
|
||||
struct file *file)
|
||||
{
|
||||
return single_open(file, emc_debug_supported_rates_show,
|
||||
inode->i_private);
|
||||
}
|
||||
|
||||
static const struct file_operations emc_debug_supported_rates_fops = {
|
||||
.open = emc_debug_supported_rates_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static void emc_debugfs_init(struct device *dev, struct tegra_emc *emc)
|
||||
{
|
||||
struct dentry *root, *file;
|
||||
struct clk *clk;
|
||||
@ -1048,6 +1081,11 @@ static void emc_debugfs_init(struct device *dev)
|
||||
&emc_debug_rate_fops);
|
||||
if (!file)
|
||||
dev_err(dev, "failed to create debugfs entry\n");
|
||||
|
||||
file = debugfs_create_file("supported_rates", S_IRUGO, root, emc,
|
||||
&emc_debug_supported_rates_fops);
|
||||
if (!file)
|
||||
dev_err(dev, "failed to create debugfs entry\n");
|
||||
}
|
||||
|
||||
static int tegra_emc_probe(struct platform_device *pdev)
|
||||
@ -1119,7 +1157,7 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
||||
platform_set_drvdata(pdev, emc);
|
||||
|
||||
if (IS_ENABLED(CONFIG_DEBUG_FS))
|
||||
emc_debugfs_init(&pdev->dev);
|
||||
emc_debugfs_init(&pdev->dev, emc);
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
@ -1032,6 +1032,7 @@ const struct tegra_mc_soc tegra124_mc_soc = {
|
||||
.num_clients = ARRAY_SIZE(tegra124_mc_clients),
|
||||
.num_address_bits = 34,
|
||||
.atom_size = 32,
|
||||
.client_id_mask = 0x7f,
|
||||
.smmu = &tegra124_smmu_soc,
|
||||
.emem_regs = tegra124_mc_emem_regs,
|
||||
.num_emem_regs = ARRAY_SIZE(tegra124_mc_emem_regs),
|
||||
@ -1067,6 +1068,7 @@ const struct tegra_mc_soc tegra132_mc_soc = {
|
||||
.num_clients = ARRAY_SIZE(tegra124_mc_clients),
|
||||
.num_address_bits = 34,
|
||||
.atom_size = 32,
|
||||
.client_id_mask = 0x7f,
|
||||
.smmu = &tegra132_smmu_soc,
|
||||
};
|
||||
#endif /* CONFIG_ARCH_TEGRA_132_SOC */
|
||||
|
1080
drivers/memory/tegra/tegra210.c
Normal file
1080
drivers/memory/tegra/tegra210.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -966,5 +966,6 @@ const struct tegra_mc_soc tegra30_mc_soc = {
|
||||
.num_clients = ARRAY_SIZE(tegra30_mc_clients),
|
||||
.num_address_bits = 32,
|
||||
.atom_size = 16,
|
||||
.client_id_mask = 0x7f,
|
||||
.smmu = &tegra30_smmu_soc,
|
||||
};
|
||||
|
36
include/dt-bindings/memory/tegra210-mc.h
Normal file
36
include/dt-bindings/memory/tegra210-mc.h
Normal file
@ -0,0 +1,36 @@
|
||||
#ifndef DT_BINDINGS_MEMORY_TEGRA210_MC_H
|
||||
#define DT_BINDINGS_MEMORY_TEGRA210_MC_H
|
||||
|
||||
#define TEGRA_SWGROUP_PTC 0
|
||||
#define TEGRA_SWGROUP_DC 1
|
||||
#define TEGRA_SWGROUP_DCB 2
|
||||
#define TEGRA_SWGROUP_AFI 3
|
||||
#define TEGRA_SWGROUP_AVPC 4
|
||||
#define TEGRA_SWGROUP_HDA 5
|
||||
#define TEGRA_SWGROUP_HC 6
|
||||
#define TEGRA_SWGROUP_NVENC 7
|
||||
#define TEGRA_SWGROUP_PPCS 8
|
||||
#define TEGRA_SWGROUP_SATA 9
|
||||
#define TEGRA_SWGROUP_MPCORE 10
|
||||
#define TEGRA_SWGROUP_ISP2 11
|
||||
#define TEGRA_SWGROUP_XUSB_HOST 12
|
||||
#define TEGRA_SWGROUP_XUSB_DEV 13
|
||||
#define TEGRA_SWGROUP_ISP2B 14
|
||||
#define TEGRA_SWGROUP_TSEC 15
|
||||
#define TEGRA_SWGROUP_A9AVP 16
|
||||
#define TEGRA_SWGROUP_GPU 17
|
||||
#define TEGRA_SWGROUP_SDMMC1A 18
|
||||
#define TEGRA_SWGROUP_SDMMC2A 19
|
||||
#define TEGRA_SWGROUP_SDMMC3A 20
|
||||
#define TEGRA_SWGROUP_SDMMC4A 21
|
||||
#define TEGRA_SWGROUP_VIC 22
|
||||
#define TEGRA_SWGROUP_VI 23
|
||||
#define TEGRA_SWGROUP_NVDEC 24
|
||||
#define TEGRA_SWGROUP_APE 25
|
||||
#define TEGRA_SWGROUP_NVJPG 26
|
||||
#define TEGRA_SWGROUP_SE 27
|
||||
#define TEGRA_SWGROUP_AXIAP 28
|
||||
#define TEGRA_SWGROUP_ETR 29
|
||||
#define TEGRA_SWGROUP_TSECB 30
|
||||
|
||||
#endif
|
@ -102,6 +102,8 @@ struct tegra_mc_soc {
|
||||
unsigned int num_address_bits;
|
||||
unsigned int atom_size;
|
||||
|
||||
u8 client_id_mask;
|
||||
|
||||
const struct tegra_smmu_soc *smmu;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user