]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Add basic cpu frequency control and temperature monitoring to imx6_anatop.
authorIan Lepore <ian@FreeBSD.org>
Fri, 21 Feb 2014 06:00:06 +0000 (06:00 +0000)
committerIan Lepore <ian@FreeBSD.org>
Fri, 21 Feb 2014 06:00:06 +0000 (06:00 +0000)
commit86a5575402ddb08376142ad762127debd1f76011
tree15ddae0d0bde06f918d54a56587153e6fabcd8c3
parent40a4c9d72e6bf5564042d4e6036900e5a0882320
Add basic cpu frequency control and temperature monitoring to imx6_anatop.

The temperature monitor device is enabled to sample the die temperature at
16hz.  The temperature is published via sysctl.  A callout routine at 10hz
monitors the temperature and throttles back the cpu if the temperature
goes over a user-settable throttle point (by default 10C less than the
critical high-point temperature for the chip).  The hardware is supposed
to be able to deliver an interrupt when the temperature exceeds a settable
limit, but the interrupt never arrives so for now a callout does the job.

At attach time we read the maximum cpu frequency the chip is allowed to run
at and the cpu is set to run at that speed.  It's reported at attach time.
A sysctl variable reports the current speed when queried.

New sysctl values:

  dev.imx6_anatop.0.cpu_mhz: 984
  dev.imx6_anatop.0.temperature: 37.9C
  dev.imx6_anatop.0.throttle_temperature: 95.0C

Steven Lawrance did the initial heavy lifting on this, but I changed
enough stuff that I'm the one to blame if anything breaks.

Submitted by: Steven Lawrance <stl@koffein.net>
sys/arm/freescale/imx/imx6_anatop.c
sys/arm/freescale/imx/imx6_anatopreg.h
sys/arm/freescale/imx/imx6_anatopvar.h
sys/boot/fdt/dts/imx6.dtsi