Skip to contentSkip to conversation

Support for TI bandgap temperature sensor

PATCH New Faiz Abbas 4 participants 11 messages Nov 14, 2017 – Nov 21, 2017

Subsystems (4)
lore
Share & tools
lore

Faiz Abbas

author
#0 lore raw

v5 cover Support for TI bandgap temperature sensor

Adding support for TI bandgap temperature sensor.
Also add dt support for bandgap sensor in spl.

v5:
Fixed terminator brackets at the end of ti_bandgap_match

v4:
1. Added configs enabled by default in dra7xx and am57xx SOCs
2. Split config enabling in a separate commit

v3:
Missed adding Reviewed-by in v2.

Faiz Abbas (3):
thermal: ti-bandgap: Add support for temperature sensor
ARM: dts: OMAP5+: Add support for bandgap sensor in SPL
ARM: dra7: Kconfig: Add thermal configs for dra7xx and am57xx

 arch/arm/dts/omap5-u-boot.dtsi                     |   4 +
 arch/arm/mach-omap2/omap5/Kconfig                  |   6 +
 common/spl/Kconfig                                 |   8 +
 .../thermal/ti_soc_thermal.txt                     |  35 ++++
 drivers/Makefile                                   |   1 +
 drivers/thermal/Kconfig                            |   6 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/ti-bandgap.c                       | 198 +++++++++++++++++++++
 8 files changed, 259 insertions(+)
 create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
 create mode 100644 drivers/thermal/ti-bandgap.c
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v5 1/3 thermal: ti-bandgap: Add support for temperature sensor

The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor.

---

v5:
Added terminator brackets ({}) to ti_bandgap_match[]

v3:
Added Reviewed-by comment

v2:
1. Removed extra elements from ti_bandgap
2. Changed base address to ulong
3. Changed to udev to dev to maintain consistency
4. minor format changes

 common/spl/Kconfig                                 |   8 +
 .../thermal/ti_soc_thermal.txt                     |  35 ++++
 drivers/Makefile                                   |   1 +
 drivers/thermal/Kconfig                            |   6 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/ti-bandgap.c                       | 198 +++++++++++++++++++++
 6 files changed, 249 insertions(+)
 create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
 create mode 100644 drivers/thermal/ti-bandgap.c
common/spl/Kconfig +8 -0
index 0bd8370..0bf3ee3 100644
@@ -604,6 +604,14 @@ config SPL_SPI_SUPPORT
 	  enable SPI drivers that are needed for other purposes also, such
 	  as a SPI PMIC.
 
+config SPL_THERMAL
+	bool "Driver support for thermal devices"
+	help
+	  Enable support for temperature-sensing devices. Some SoCs have on-chip
+	  temperature sensors to permit warnings, speed throttling or even
+	  automatic power-off when the temperature gets too high or low. Other
+	  devices may be discrete but connected on a suitable bus.
+
 config SPL_USB_HOST_SUPPORT
 	bool "Support USB host drivers"
 	help
doc/device-tree-bindings/thermal/ti_soc_thermal.txt new file +35 -0
new file mode 100644
index 0000000..b4e88c2
@@ -0,0 +1,35 @@
+* Texas Instrument dra7xx SCM bandgap bindings
+
+In the System Control Module, SoC supplies a voltage reference
+and a temperature sensor feature that are gathered in the band
+gap voltage and temperature sensor (VBGAPTS) module. The band
+gap provides current and voltage reference for its internal
+circuits and other analog IP blocks. The analog-to-digital
+converter (ADC) produces an output value that is proportional
+to the silicon temperature.
+
+Required properties:
+- compatible : Should be:
+  - "ti,dra752-bandgap"
+- interrupts : this entry should indicate which interrupt line
+the talert signal is routed to;
+- regs : this is specific to each bandgap version, because
+the mapping may change from soc to soc, apart from depending
+on available features.
+
+Optional:
+- gpios : this entry should be used to inform which GPIO
+line the tshut signal is routed to. The informed GPIO will
+be treated as an IRQ;
+
+Example:
+bandgap {
+	reg = <0x4a0021e0 0xc
+		0x4a00232c 0xc
+		0x4a002380 0x2c
+		0x4a0023C0 0x3c
+		0x4a002564 0x8
+		0x4a002574 0x50>;
+	compatible = "ti,dra752-bandgap";
+	interrupts = <0 126 4>; /* talert */
+};
drivers/Makefile +1 -0
index dab5c18..e6062a5 100644
@@ -50,6 +50,7 @@ obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
 obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += block/
 obj-$(CONFIG_SPL_MMC_SUPPORT) += block/
 obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
+obj-$(CONFIG_SPL_THERMAL) += thermal/
 
 endif
 endif
drivers/thermal/Kconfig +6 -0
index 886f5fa..a71b9be 100644
@@ -17,4 +17,10 @@ config IMX_THERMAL
           cpufreq is used as the cooling device to throttle CPUs when the
           passive trip is crossed.
 
+config TI_DRA7_THERMAL
+        bool "Temperature sensor driver for TI dra7xx SOCs"
+        help
+	 Enable thermal support for for the Texas Instruments DRA752 SoC family.
+	 The driver supports reading CPU temperature.
+
 endif # if DM_THERMAL
drivers/thermal/Makefile +1 -0
index d768f5e..f6271a5 100644
@@ -7,3 +7,4 @@
 
 obj-$(CONFIG_DM_THERMAL) += thermal-uclass.o
 obj-$(CONFIG_IMX_THERMAL) += imx_thermal.o
+obj-$(CONFIG_TI_DRA7_THERMAL) += ti-bandgap.o
drivers/thermal/ti-bandgap.c new file +198 -0

198 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH v5 1/3 thermal: ti-bandgap: Add support for temperature sensor

Quoted 21 lines · Faiz Abbas

The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor.

---

v5:
Added terminator brackets ({}) to ti_bandgap_match[]

v3:
Added Reviewed-by comment

v2:
1. Removed extra elements from ti_bandgap
2. Changed base address to ulong
3. Changed to udev to dev to maintain consistency
4. minor format changes

Quoted 10 lines
 common/spl/Kconfig                                 |   8 +
 .../thermal/ti_soc_thermal.txt                     |  35 ++++
 drivers/Makefile                                   |   1 +
 drivers/thermal/Kconfig                            |   6 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/ti-bandgap.c                       | 198 +++++++++++++++++++++
 6 files changed, 249 insertions(+)
 create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
 create mode 100644 drivers/thermal/ti-bandgap.c

This fails to build on am57xx_evm_nodt. Lokesh, does it still make sense to have that defconfig? If so, we need to disable this feature on that config, or we need to delete that config then apply this series. Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/1e4812b2/attachment.sig>
#3 lore raw

PATCH v5 1/3 thermal: ti-bandgap: Add support for temperature sensor

Quoted 33 lines · Tom Rini
Quoted 21 lines · Faiz Abbas

The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor.

---

v5:
Added terminator brackets ({}) to ti_bandgap_match[]

v3:
Added Reviewed-by comment

v2:
1. Removed extra elements from ti_bandgap
2. Changed base address to ulong
3. Changed to udev to dev to maintain consistency
4. minor format changes

Quoted 10 lines
 common/spl/Kconfig                                 |   8 +
 .../thermal/ti_soc_thermal.txt                     |  35 ++++
 drivers/Makefile                                   |   1 +
 drivers/thermal/Kconfig                            |   6 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/ti-bandgap.c                       | 198 +++++++++++++++++++++
 6 files changed, 249 insertions(+)
 create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
 create mode 100644 drivers/thermal/ti-bandgap.c
Quoted 5 lines

This fails to build on am57xx_evm_nodt. Lokesh, does it still make sense to have that defconfig? If so, we need to disable this feature on that config, or we need to delete that config then apply this series. Thanks!

Right, no point keeping am57xx_evm_nodt. We should delete this config and apply this series.

Thanks and regards,
Lokesh

#4 lore raw

PATCH v5 1/3 thermal: ti-bandgap: Add support for temperature sensor

Quoted 36 lines · Lokesh Vutla
Quoted 33 lines · Tom Rini
Quoted 31 lines · Faiz Abbas

The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor.

---

v5:
Added terminator brackets ({}) to ti_bandgap_match[]

v3:
Added Reviewed-by comment

v2:
1. Removed extra elements from ti_bandgap
2. Changed base address to ulong
3. Changed to udev to dev to maintain consistency
4. minor format changes

 common/spl/Kconfig                                 |   8 +
 .../thermal/ti_soc_thermal.txt                     |  35 ++++
 drivers/Makefile                                   |   1 +
 drivers/thermal/Kconfig                            |   6 +
 drivers/thermal/Makefile                           |   1 +
 drivers/thermal/ti-bandgap.c                       | 198 +++++++++++++++++++++
 6 files changed, 249 insertions(+)
 create mode 100644 doc/device-tree-bindings/thermal/ti_soc_thermal.txt
 create mode 100644 drivers/thermal/ti-bandgap.c
Quoted 8 lines
Quoted 5 lines

This fails to build on am57xx_evm_nodt. Lokesh, does it still make sense to have that defconfig? If so, we need to disable this feature on that config, or we need to delete that config then apply this series. Thanks!

Right, no point keeping am57xx_evm_nodt. We should delete this config and apply this series.

OK, I'll make it so, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/26a0a4cb/attachment.sig>
#5 lore raw

PATCH v5 1/3 thermal: ti-bandgap: Add support for temperature sensor

In reply to Faiz Abbas
Quoted 7 lines · Faiz Abbas

The dra7xx series of SOCs contain a temperature sensor and an associated analog-to-digital converter (ADC) which produces an output which is proportional to the SOC temperature. Add support for this temperature sensor.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/1182c51c/attachment.sig>
author
#6 lore raw

PATCH v5 2/3 ARM: dts: OMAP5+: Add support for bandgap sensor in SPL

In reply to Faiz Abbas

Mark bandgap node as uboot,dm-spl so that it can be accessed in spl

---

v3:
Added Reviewed-by comment.

 arch/arm/dts/omap5-u-boot.dtsi | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/dts/omap5-u-boot.dtsi +4 -0
index fdaa692..bf2684c 100644
@@ -18,6 +18,10 @@
 		ocp2scp at 4a090000 {
 			compatible = "ti,omap-ocp2scp", "simple-bus";
 		};
+
+		bandgap at 4a0021e0 {
+			u-boot,dm-spl;
+		};
 	};
 };
 
Signature · 1 line
2.7.4
#7 lore raw

PATCH v5 2/3 ARM: dts: OMAP5+: Add support for bandgap sensor in SPL

Quoted 5 lines · Faiz Abbas

Mark bandgap node as uboot,dm-spl so that it can be accessed in spl

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/0f1f8e6d/attachment.sig>
author
#8 lore raw

PATCH v5 3/3 ARM: dra7: Kconfig: Add thermal configs for dra7xx and am57xx

In reply to Faiz Abbas

Configure thermal configs to remain set by default for dra7xx and am57xx devices.

---
 arch/arm/mach-omap2/omap5/Kconfig | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-omap2/omap5/Kconfig +6 -0
index 8f58235..8c1730a 100644
@@ -30,6 +30,9 @@ config TARGET_DRA7XX_EVM
 	imply PMIC_LP87565
 	imply DM_REGULATOR
 	imply DM_REGULATOR_LP87565
+	imply SPL_THERMAL
+	imply DM_THERMAL
+	imply TI_DRA7_THERMAL
 
 config TARGET_AM57XX_EVM
 	bool "AM57XX"
@@ -37,6 +40,9 @@ config TARGET_AM57XX_EVM
 	select DRA7XX
 	select TI_I2C_BOARD_DETECT
 	imply SCSI
+	imply SPL_THERMAL
+	imply DM_THERMAL
+	imply TI_DRA7_THERMAL
 
 endchoice
 
Signature · 1 line
2.7.4
#10 lore raw

PATCH v5 3/3 ARM: dra7: Kconfig: Add thermal configs for dra7xx and am57xx

In reply to Faiz Abbas
Quoted 5 lines · Faiz Abbas

Configure thermal configs to remain set by default for dra7xx and am57xx devices.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171121/02376ce3/attachment.sig>