From e660df07ab90f4f61ed743522067a8dbaa6fa567 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 23 Jan 2015 09:45:35 +0100 Subject: memory: tegra: Add SWGROUP names Subsequent patches will add debugfs files that print the status of the SWGROUPs. Add a new names field and complement the SoC tables with the names of the individual SWGROUPs. Signed-off-by: Thierry Reding --- include/soc/tegra/mc.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/soc') diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h index 63deb8d..b254881 100644 --- a/include/soc/tegra/mc.h +++ b/include/soc/tegra/mc.h @@ -40,6 +40,7 @@ struct tegra_mc_client { }; struct tegra_smmu_swgroup { + const char *name; unsigned int swgroup; unsigned int reg; }; -- cgit v1.1 From d1313e7896e932a92e21912850ef034e58571b66 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Fri, 23 Jan 2015 09:49:25 +0100 Subject: iommu/tegra-smmu: Add debugfs support Provide clients and swgroups files in debugfs. These files show for which clients IOMMU translation is enabled and which ASID is associated with each SWGROUP. Cc: Hiroshi Doyu Acked-by: Joerg Roedel Signed-off-by: Thierry Reding --- include/soc/tegra/mc.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/soc') diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h index b254881..e5ba518 100644 --- a/include/soc/tegra/mc.h +++ b/include/soc/tegra/mc.h @@ -72,6 +72,7 @@ struct tegra_smmu; struct tegra_smmu *tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc, struct tegra_mc *mc); +void tegra_smmu_remove(struct tegra_smmu *smmu); #else static inline struct tegra_smmu * tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc, @@ -79,6 +80,10 @@ tegra_smmu_probe(struct device *dev, const struct tegra_smmu_soc *soc, { return NULL; } + +static inline void tegra_smmu_remove(struct tegra_smmu *smmu) +{ +} #endif struct tegra_mc_soc { -- cgit v1.1 From 6ea2609ab386f6bfeebc39e1418b7497a9deb55c Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Thu, 12 Mar 2015 15:47:55 +0100 Subject: soc/tegra: fuse: Add RAM code reader helper Needed for the EMC and MC drivers to know what timings from the DT to use. Signed-off-by: Mikko Perttunen Signed-off-by: Tomeu Vizoso Signed-off-by: Thierry Reding --- include/soc/tegra/fuse.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/soc') diff --git a/include/soc/tegra/fuse.h b/include/soc/tegra/fuse.h index b5f7b5f..b019e34 100644 --- a/include/soc/tegra/fuse.h +++ b/include/soc/tegra/fuse.h @@ -56,6 +56,7 @@ struct tegra_sku_info { }; u32 tegra_read_straps(void); +u32 tegra_read_ram_code(void); u32 tegra_read_chipid(void); int tegra_fuse_readl(unsigned long offset, u32 *value); -- cgit v1.1 From 3d9dd6fdd23695a038633f1a87aee0708fe4b8e0 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Thu, 12 Mar 2015 15:48:02 +0100 Subject: memory: tegra: Add API needed by the EMC driver The EMC driver needs to know the number of external memory devices and also needs to update the EMEM configuration based on the new rate of the memory bus. To know how to update the EMEM config, looks up the values of the burst regs in the DT, for a given timing. Signed-off-by: Mikko Perttunen Signed-off-by: Tomeu Vizoso Signed-off-by: Thierry Reding --- include/soc/tegra/mc.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include/soc') diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h index 63deb8d..90b558e 100644 --- a/include/soc/tegra/mc.h +++ b/include/soc/tegra/mc.h @@ -20,6 +20,12 @@ struct tegra_smmu_enable { unsigned int bit; }; +struct tegra_mc_timing { + unsigned long rate; + + u32 *emem_data; +}; + /* latency allowance */ struct tegra_mc_la { unsigned int reg; @@ -84,7 +90,7 @@ struct tegra_mc_soc { const struct tegra_mc_client *clients; unsigned int num_clients; - const unsigned int *emem_regs; + const unsigned long *emem_regs; unsigned int num_emem_regs; unsigned int num_address_bits; @@ -102,6 +108,12 @@ struct tegra_mc { const struct tegra_mc_soc *soc; unsigned long tick; + + struct tegra_mc_timing *timings; + unsigned int num_timings; }; +void tegra_mc_write_emem_configuration(struct tegra_mc *mc, unsigned long rate); +unsigned int tegra_mc_get_emem_device_count(struct tegra_mc *mc); + #endif /* __SOC_TEGRA_MC_H__ */ -- cgit v1.1 From 73a7f0a90641b09300d47308682b674c570dd6a2 Mon Sep 17 00:00:00 2001 From: Mikko Perttunen Date: Thu, 12 Mar 2015 15:48:03 +0100 Subject: memory: tegra: Add EMC (external memory controller) driver Implements functionality needed to change the rate of the memory bus clock. Signed-off-by: Mikko Perttunen Signed-off-by: Tomeu Vizoso Signed-off-by: Thierry Reding --- include/soc/tegra/emc.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/soc/tegra/emc.h (limited to 'include/soc') diff --git a/include/soc/tegra/emc.h b/include/soc/tegra/emc.h new file mode 100644 index 0000000..f6db33b --- /dev/null +++ b/include/soc/tegra/emc.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2014 NVIDIA Corporation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef __SOC_TEGRA_EMC_H__ +#define __SOC_TEGRA_EMC_H__ + +struct tegra_emc; + +int tegra_emc_prepare_timing_change(struct tegra_emc *emc, + unsigned long rate); +void tegra_emc_complete_timing_change(struct tegra_emc *emc, + unsigned long rate); + +#endif /* __SOC_TEGRA_EMC_H__ */ -- cgit v1.1