Unveiling Design Patterns: A Visual Guide with UML Diagrams
Android jb thermal sw flow
1.
2.
3.
4. Tegra3 Thermal Management cont.
Thermal
Sensor
CPU PMU
Get data from CPU (D+/D-)
Feedback external temperature
Monitoring if temperature is greater
than Throttle threshold
Change power control to reduce
CPU clock and low frequency
Feedback external temperature
Update DVFS table
Get data from CPU (D+/D-)
Notify to start Throttling task
5. Tegra3 Thermal Management cont.
Thermal
Sensor
CPU PMU
Get data from CPU (D+/D-)
Feedback external temperature
Clear DEV_ON bit to prepare to
shutdown power for CPU
Disable peripheral driver
Monitoring if temperature is greater
than Shutdown threshold
6. Configure IRQ as Low-level trigger.
HW sends interrupt according to initial threshold stored
in thermal sensor register (FW).
7. Acer-specific initial value were set as follow:
Implementation was done in file:
nct1008.c (Driver layer configuration)
board-acer-t30.c (NV default value for vendor customization)
board-acer-t30-sensors.c (set into nct1008 non-violate flash)
Pin Function Threshold
TEMP_ALERT Throttling 85 ℃
AP_OVERHEAT Shutdown 90 ℃
8. Verification for specific value by commands as follow,
cat /sys/class/i2c-dev/i2c-4/device/4-004c/tempaerature_alert
cat /sys/class/i2c-dev/i2c-4/device/4-004c/tempaerature_overheat
9. The ALERT output deasserts only when:
1. Temperature has fallen below the
high temperature limit.
2. Master has read the device address.
3. Cleared the status register.
13. SW Code Flow cont.
HW interrupt triggers work_func to proceed throttling task!
Master has read the
device address
Cleared the
status register
14. SW Code Flow cont.
Stop charging if throttling starts.
After finish each throttling call, update temperature to T30.
15. SW Code Flow cont.
Check if temperature is over
limit stored in EDP table.
Update index for new
temperature to mapping EDP
table.
Update CPU rate according to
the temperature which was
reported by nct1008 work
function.
Adjust and update DVFS
latest setting for CPU clock.
16. SW Code Flow cont.
Throttle sysfs node is the “answer” for CPU to know when
throttling process ends.
Sysfs node stores in path:
sys/devices/system/cpu/cpu0/cpufreq/throttle
17. SW Code Flow cont.
tegra3_throttle.c will report the latest status of throttling process.
18. SW Code Flow cont.
thermal_sys.c (cooling device) write TRUE/FALSE TO sysfs node
“throttle” to update for tegra3_throttle.c and cpu-tegra.c
19. SW Code Flow cont.
CPU frequency adjustment mapping table with throttling stage.
Interrupt will be send to notify when temperature isn’t within limit,
45~60: 1.3GHz
60~75: 1.3GHz
75~85: 1.2GHz
over 85: 1.1GHz
Stage
Core On (cpu0 to 3)
20. SW Code Flow cont.
CPU frequency adjustment mapping table