coreboot/src/drivers
Raul E Rangel 9bf32b9701 drivers/acpi: Add a chip driver to generate thermal zone
Given the following device tree entry:
    chip drivers/acpi/thermal_zone
        register "description" = ""CPU""

        use chrome_ec as temperature_controller

        register "sensor_id" = "0"

        register "polling_period" = "10"

        register "critical_temperature" = "91"

        register "passive_config" = "{
            .temperature = 85,
        }"

        register "use_acpi1_thermal_zone_scope" = "true"

        device generic 0 on end
    end

It will generate the following:
    Scope (\_TZ)
    {
        ThermalZone (TM00)
        {
            Name (_STR, "CPU")  // _STR: Description String
            Name (_RTV, Zero)  // _RTV: Relative Temperature Values
            Name (_TZP, 0x64)  // _TZP: Thermal Zone Polling
            Name (_CRT, 0x0E39)  // _CRT: Critical Temperature
            Name (_PSV, 0x0DFD)  // _PSV: Passive Temperature
            Name (_PSL, Package (0x10)  // _PSL: Passive List
            {
                \_SB.CP00,
                \_SB.CP01,
                \_SB.CP02,
                \_SB.CP03,
                \_SB.CP04,
                \_SB.CP05,
                \_SB.CP06,
                \_SB.CP07,
                \_SB.CP08,
                \_SB.CP09,
            })
            Name (_TC1, 0x02)  // _TC1: Thermal Constant 1
            Name (_TC2, 0x05)  // _TC2: Thermal Constant 2
            Name (_TSP, 0x14)  // _TSP: Thermal Sampling Period
            Method (_TMP, 0, Serialized)  // _TMP: Temperature
            {
                Return (\_SB.PCI0.LPCB.EC0.CREC.TMP (Zero))
            }
        }
    }

BUG=b:186166365
TEST=Boot guybrush to OS and verify thermal zone works

Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Iee2a42db749f18eef6c3f73cdbb3441567301e5d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/54132
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
2021-05-20 08:01:11 +00:00
..
acpi/thermal_zone drivers/acpi: Add a chip driver to generate thermal zone 2021-05-20 08:01:11 +00:00
amd drivers/amd/i2s_machine_dev: Make DMIC select gpio optional 2021-04-18 20:41:55 +00:00
ams treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
analogix/anx7625 drivers/analogix: Increase the clock tolerance from 0.1% to 2% 2021-03-27 10:02:18 +00:00
asmedia src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
aspeed drivers/aspeed: Fix some issues 2021-02-03 08:53:10 +00:00
broadcom src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
camera drivers/camera: Add config CHROMEOS_CAMERA 2020-10-19 06:50:20 +00:00
crb drivers/crb/tpm: Fix compilation on x86_64 2020-12-10 07:25:23 +00:00
elog commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
emulation/qemu drivers: Replace set_vbe_mode_info_valid 2020-12-17 06:21:56 +00:00
generic src/drivers/generic/nau8315: Add nau8315 support 2021-04-06 07:03:15 +00:00
genesyslogic drivers/genesyslogic/gl9755: Disable debug mode to enable circuit protections 2021-05-05 11:45:06 +00:00
gfx/generic src/drivers: Remove unused <console/console.h> 2021-02-15 10:48:39 +00:00
gic treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
i2c drivers/i2c/cs42l42: Make HS_BIAS_SENSE_EN optional 2021-05-12 08:00:12 +00:00
intel drivers/intel/usb4: Update driver to support Retimer firmware upgrade 2021-05-18 21:58:45 +00:00
ipmi src/drivers/ipmi: Add DEBUG_IPMI option 2021-04-18 20:37:10 +00:00
lenovo src: Retype option API to use unsigned integers 2021-05-06 14:48:15 +00:00
maxim drivers/maxim/max77686/max77686.h: Remove repeated word 2021-01-18 07:39:21 +00:00
mrc_cache drivers/mrc_cache: Fix with VBOOT & VBOOT_STARTS_IN_ROMSTAGE 2021-04-09 06:18:20 +00:00
net cbfs: Replace more instances of cbfs_boot_locate() with newer APIs 2021-03-17 08:10:20 +00:00
ocp/dmi drivers/ocp/dmi/Kconfig: Set FRU_DEVICE_ID depend on OCP_DMI 2021-01-18 07:50:46 +00:00
parade src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
pc80 drivers/pc80/rtc/option.c: Constrain API to integer values 2021-05-06 14:49:10 +00:00
ricoh/rce822 treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
secunet/dmi treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
siemens/nc_fpga src: Remove leading blank lines from SPDX header 2020-05-18 07:00:27 +00:00
sil/3114 treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
smmstore commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
soundwire drivers/soundwire/alc1308 : Add ALC1308 soundwire device 2021-02-27 09:41:42 +00:00
spi Revert "drivers/spi: Stop using a variable-length array" 2021-04-18 11:02:51 +00:00
ti trogdor: Add backlight support for sn65dsi86bridge for Homestar 2021-05-08 00:13:13 +00:00
tpm security/tpm: Add option to init TPM in bootblock 2021-05-06 08:26:41 +00:00
uart lib/trace: Remove TRACE support 2020-12-02 23:35:58 +00:00
usb drivers/usb/pci_xhci: Add cezanne xhci pci devce id 2021-03-10 00:47:18 +00:00
vpd commonlib/region: Turn addrspace_32bit into a more official API 2021-04-21 02:06:26 +00:00
wifi/generic device: Switch pci_dev_is_wake_source to take pci_devfn_t 2021-05-03 16:28:42 +00:00