Skip to contentSkip to conversation

thermal: tegra: add T210-specific SOC_THERM driver

PATCH Superseded Wei Ni 1 participant 1 message Jan 15, 2016

Subsystems (2)

v2 of 9 Superseded Latest is v9 →

lore
Share & tools
lore

Wei Ni

author
#0 lore raw

PATCH v2 5/11 thermal: tegra: add T210-specific SOC_THERM driver

Add Tegra210 specific SOC_THERM driver.

---
 drivers/thermal/tegra/Makefile            |   1 +
 drivers/thermal/tegra/soctherm-fuse.c     |  11 ++
 drivers/thermal/tegra/soctherm.c          |   6 +
 drivers/thermal/tegra/soctherm.h          |   4 +
 drivers/thermal/tegra/tegra210-soctherm.c | 181 ++++++++++++++++++++++++++++++
 5 files changed, 203 insertions(+)
 create mode 100644 drivers/thermal/tegra/tegra210-soctherm.c
drivers/thermal/tegra/Makefile +1 -0
index f0b40ec42e3b..21b1d619f210 100644
@@ -2,3 +2,4 @@ obj-$(CONFIG_TEGRA_SOCTHERM)	+= tegra-soctherm.o
 
 tegra-soctherm-y := soctherm.o soctherm-fuse.o
 tegra-soctherm-$(CONFIG_ARCH_TEGRA_124_SOC)	+= tegra124-soctherm.o
+tegra-soctherm-$(CONFIG_ARCH_TEGRA_210_SOC)	+= tegra210-soctherm.o
drivers/thermal/tegra/soctherm-fuse.c +11 -0
index e34e1f76ecad..66dfe1a294b2 100644
@@ -28,7 +28,18 @@
 #define FUSE_TSENSOR_COMMON			0x180
 
 /*
+ * Tegra210: Layout of bits in FUSE_TSENSOR_COMMON:
+ *    3                   2                   1                   0
+ *  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ * |       BASE_FT       |      BASE_CP      | SHFT_FT | SHIFT_CP  |
+ * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ *
  * Tegra12x, etc:
+ * In chips prior to T210, this fuse was incorrectly sized as 26 bits,
+ * and didn't hold SHIFT_CP in [31:26]. Therefore these missing six bits
+ * were obtained via the FUSE_SPARE_REALIGNMENT_REG register [5:0].
+ *
  * FUSE_TSENSOR_COMMON:
  *    3                   2                   1                   0
  *  1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
drivers/thermal/tegra/soctherm.c +6 -0
index 6de566d510c7..dd527e5ae4c3 100644
@@ -144,6 +144,12 @@ static const struct of_device_id tegra_soctherm_of_match[] = {
 		.data = &tegra124_soctherm,
 	},
 #endif
+#ifdef CONFIG_ARCH_TEGRA_210_SOC
+	{
+		.compatible = "nvidia,tegra210-soctherm",
+		.data = &tegra210_soctherm,
+	},
+#endif
 	{ },
 };
 MODULE_DEVICE_TABLE(of, tegra_soctherm_of_match);
drivers/thermal/tegra/soctherm.h +4 -0
index 1ac66cafb392..bd0f03bc9d80 100644
@@ -108,5 +108,9 @@ int tegra_soctherm_calculate_tsensor_calibration(
 extern struct tegra_soctherm_soc tegra124_soctherm;
 #endif
 
+#ifdef CONFIG_ARCH_TEGRA_210_SOC
+extern struct tegra_soctherm_soc tegra210_soctherm;
+#endif
+
 #endif
 
drivers/thermal/tegra/tegra210-soctherm.c new file +181 -0

181 lines not on this page · raw message

Signature · 1 line
1.9.1