aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Alho <talho@nvidia.com>2017-03-06 08:47:20 -0500
committerThierry Reding <treding@nvidia.com>2017-12-13 06:43:29 -0500
commit83468fe259bf827f350b118f25bce99dc0bdf597 (patch)
tree4797a04a576b1acbc891448f719a66599c4382d3
parent753863d7f8b739c10c87b8f8c356c7918d37fdcd (diff)
soc/tegra: fuse: Add Tegra186 support
Tegra210 and Tegra186 are mostly compatible from a fuses point of view. However, speedo support is implemented in the BPMP firmware, hence the implementation needs to be skipped in the fuses driver. Signed-off-by: Timo Alho <talho@nvidia.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> [treding@nvidia.com: reword commit message] Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/soc/tegra/fuse/fuse-tegra.c3
-rw-r--r--drivers/soc/tegra/fuse/fuse-tegra30.c21
-rw-r--r--drivers/soc/tegra/fuse/fuse.h4
3 files changed, 26 insertions, 2 deletions
diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
index b7c552e3133c..d7ccfee51b1a 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra.c
@@ -103,6 +103,9 @@ static struct tegra_fuse *fuse = &(struct tegra_fuse) {
103}; 103};
104 104
105static const struct of_device_id tegra_fuse_match[] = { 105static const struct of_device_id tegra_fuse_match[] = {
106#ifdef CONFIG_ARCH_TEGRA_186_SOC
107 { .compatible = "nvidia,tegra186-efuse", .data = &tegra186_fuse_soc },
108#endif
106#ifdef CONFIG_ARCH_TEGRA_210_SOC 109#ifdef CONFIG_ARCH_TEGRA_210_SOC
107 { .compatible = "nvidia,tegra210-efuse", .data = &tegra210_fuse_soc }, 110 { .compatible = "nvidia,tegra210-efuse", .data = &tegra210_fuse_soc },
108#endif 111#endif
diff --git a/drivers/soc/tegra/fuse/fuse-tegra30.c b/drivers/soc/tegra/fuse/fuse-tegra30.c
index 882607bcaa6c..497eb044095f 100644
--- a/drivers/soc/tegra/fuse/fuse-tegra30.c
+++ b/drivers/soc/tegra/fuse/fuse-tegra30.c
@@ -46,7 +46,8 @@
46 defined(CONFIG_ARCH_TEGRA_114_SOC) || \ 46 defined(CONFIG_ARCH_TEGRA_114_SOC) || \
47 defined(CONFIG_ARCH_TEGRA_124_SOC) || \ 47 defined(CONFIG_ARCH_TEGRA_124_SOC) || \
48 defined(CONFIG_ARCH_TEGRA_132_SOC) || \ 48 defined(CONFIG_ARCH_TEGRA_132_SOC) || \
49 defined(CONFIG_ARCH_TEGRA_210_SOC) 49 defined(CONFIG_ARCH_TEGRA_210_SOC) || \
50 defined(CONFIG_ARCH_TEGRA_186_SOC)
50static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset) 51static u32 tegra30_fuse_read_early(struct tegra_fuse *fuse, unsigned int offset)
51{ 52{
52 return readl_relaxed(fuse->base + FUSE_BEGIN + offset); 53 return readl_relaxed(fuse->base + FUSE_BEGIN + offset);
@@ -98,7 +99,10 @@ static void __init tegra30_fuse_init(struct tegra_fuse *fuse)
98 fuse->read = tegra30_fuse_read; 99 fuse->read = tegra30_fuse_read;
99 100
100 tegra_init_revision(); 101 tegra_init_revision();
101 fuse->soc->speedo_init(&tegra_sku_info); 102
103 if (fuse->soc->speedo_init)
104 fuse->soc->speedo_init(&tegra_sku_info);
105
102 tegra30_fuse_add_randomness(); 106 tegra30_fuse_add_randomness();
103} 107}
104#endif 108#endif
@@ -158,3 +162,16 @@ const struct tegra_fuse_soc tegra210_fuse_soc = {
158 .info = &tegra210_fuse_info, 162 .info = &tegra210_fuse_info,
159}; 163};
160#endif 164#endif
165
166#if defined(CONFIG_ARCH_TEGRA_186_SOC)
167static const struct tegra_fuse_info tegra186_fuse_info = {
168 .read = tegra30_fuse_read,
169 .size = 0x300,
170 .spare = 0x280,
171};
172
173const struct tegra_fuse_soc tegra186_fuse_soc = {
174 .init = tegra30_fuse_init,
175 .info = &tegra186_fuse_info,
176};
177#endif
diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/soc/tegra/fuse/fuse.h
index 10c2076d5089..f355b9d54915 100644
--- a/drivers/soc/tegra/fuse/fuse.h
+++ b/drivers/soc/tegra/fuse/fuse.h
@@ -105,4 +105,8 @@ extern const struct tegra_fuse_soc tegra124_fuse_soc;
105extern const struct tegra_fuse_soc tegra210_fuse_soc; 105extern const struct tegra_fuse_soc tegra210_fuse_soc;
106#endif 106#endif
107 107
108#ifdef CONFIG_ARCH_TEGRA_186_SOC
109extern const struct tegra_fuse_soc tegra186_fuse_soc;
110#endif
111
108#endif 112#endif