Add a userland thermal loop
Add a userland thermal loop

This is a temporary hack to implement a userland thermal loop.  This
code really belongs in the BIOS and will move there once we have
gathered enough data to prove the efficacy (or otherwise) of doing such
throttling. So, please pardon the ugliness of the code -- it's meant to
be short-lived and therefore we wouldn't want to spend too much time on
optimizing it or making it pretty.

BUG=none
TEST="initctl start temp_metrics" and then monitor various parameters
such as CPU min/max frequency, GPU frequency, duty cycle and package
power limits to ensure they are doing the right thing.

Change-Id: I407e4826b4db801298f08fa72c4f2330e127322b
Signed-off-by: Sameer Nanda <3daf6939ed4518939423e49b8a1025b098597787@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28634
Reviewed-by: Vincent Palatin <70a9964ec8fd10b0b08fcc8623c2add25ddf99ac@chromium.org>

coreboot/chrome-ec,longsleep/ec,gelraen/cros-ec,fourier49/BZ_DEV_EC,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics,akappy7/ChromeOS_EC_LED_Diagnostics,fourier49/BIZ_EC,thehobn/ec,alterapraxisptyltd/chromium-ec,longsleep/ec,alterapraxisptyltd/chromium-ec,alterapraxisptyltd/chromium-ec,gelraen/cros-ec,md5555/ec,eatbyte/chromium-ec,mtk09422/chromiumos-platform-ec,akappy7/ChromeOS_EC_LED_Diagnostics,gelraen/cros-ec,eatbyte/chromium-ec,coreboot/chrome-ec,fourier49/BZ_DEV_EC,thehobn/ec,thehobn/ec,fourier49/BZ_DEV_EC,longsleep/ec,coreboot/chrome-ec,mtk09422/chromiumos-platform-ec,md5555/ec,mtk09422/chromiumos-platform-ec,coreboot/chrome-ec,eatbyte/chromium-ec,md5555/ec,thehobn/ec,coreboot/chrome-ec,longsleep/ec,alterapraxisptyltd/chromium-ec,fourier49/BIZ_EC,eatbyte/chromium-ec,coreboot/chrome-ec,fourier49/BZ_DEV_EC,gelraen/cros-ec,mtk09422/chromiumos-platform-ec,md5555/ec,fourier49/BIZ_EC,akappy7/ChromeOS_EC_LED_Diagnostics