Dear All,

On 9/8/2023 10:59 PM, Udit Kumar wrote:
VTM (Voltage and Thermal Manager) IP is used for following purpose
1) AVS class 0
2) Thermal management (setting thermal shutdown TSHUT) temperature.
3) SoC temperature reporting.

In origin boot flow, R5/SPL sets the AVS voltage using
by AVS driver, residing under UCLASS_MISC.

In this series At top level, following changes are done
- Moved avs driver to Thermal class
- Ported kernel driver (drivers/thermal/k3_j72xx_bandgap.c) which
supports TSHUT and temperature reporting
- Merged these two driver as one under UCLASS_THERMAL.

This series aims to
- set avs and thermal shutdown at R5/SPL stage
- At main u-boot stage, support thermal shutdown and temperature reporting


Also, j72xx_bandgap does complex math to get ADC value to temperature
conversion, This table is pretty static.
So at R5 SPL stage, instead of calculation, fixed values is used
for TSHUT values.
and #ifdef is used skip non needed code for SPL/R5 to reduce code size.

Kindly review and provide feedback, if this approach looks ok.

Thanks

Udit


Change log
Changes in v2:
v1 : https://lore.kernel.org/all/20230901061500.2342452-1-u-kum...@ti.com/
- Trying to merge AVS and kernel driver into 1
- Mark as RFC


Udit Kumar (3):
   thermal: k3: Add support for thermal in vtm
   arm: mach-k3: update board file to use thermal device
   arm: dts: k3: update device tree for vtm node

  arch/arm/dts/k3-j7200-mcu-wakeup.dtsi         |   9 +
  .../arm/dts/k3-j7200-r5-common-proc-board.dts |   6 -
  arch/arm/dts/k3-j721e-mcu-wakeup.dtsi         |  10 +
  .../arm/dts/k3-j721e-r5-common-proc-board.dts |   7 -
  arch/arm/dts/k3-j721e-r5-sk.dts               |   7 -
  arch/arm/mach-k3/am654_init.c                 |   2 +-
  arch/arm/mach-k3/j721e_init.c                 |   2 +-
  configs/am65x_evm_r5_defconfig                |   3 +
  configs/am65x_evm_r5_usbdfu_defconfig         |   3 +
  configs/am65x_evm_r5_usbmsc_defconfig         |   3 +
  configs/am65x_hs_evm_r5_defconfig             |   3 +
  configs/j7200_evm_a72_defconfig               |   3 +
  configs/j7200_evm_r5_defconfig                |   3 +
  configs/j721e_evm_a72_defconfig               |   3 +
  configs/j721e_evm_r5_defconfig                |   3 +
  drivers/misc/Makefile                         |   1 -
  drivers/misc/k3_avs.c                         | 394 --------
  drivers/thermal/Kconfig                       |   7 +
  drivers/thermal/Makefile                      |   1 +
  drivers/thermal/k3_thermal.c                  | 928 ++++++++++++++++++
  20 files changed, 981 insertions(+), 417 deletions(-)
  delete mode 100644 drivers/misc/k3_avs.c
  create mode 100644 drivers/thermal/k3_thermal.c

Reply via email to