[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/9] hw/misc/tmp105: reset the T_low and T_High registers
From: |
Peter Maydell |
Subject: |
[PULL 8/9] hw/misc/tmp105: reset the T_low and T_High registers |
Date: |
Tue, 17 Nov 2020 13:48:33 +0000 |
The TMP105 datasheet (https://www.ti.com/lit/gpn/tmp105) says that the
power-up reset values for the T_low and T_high registers are 80 degrees C
and 75 degrees C, which are 0x500 and 0x4B0 hex according to table 5. These
values are then shifted right by four bits to give the register reset
values, since both registers store the 12 bits of temperature data in bits
[15..4] of a 16 bit register.
We were resetting these registers to zero, which is problematic for Linux
guests which enable the alert interrupt and then immediately take an
unexpected overtemperature alert because the current temperature is above
freezing...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20201110150023.25533-2-peter.maydell@linaro.org
---
hw/misc/tmp105.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
index b47120492ab..0a4aad4854e 100644
--- a/hw/misc/tmp105.c
+++ b/hw/misc/tmp105.c
@@ -225,6 +225,9 @@ static void tmp105_reset(I2CSlave *i2c)
s->faults = tmp105_faultq[(s->config >> 3) & 3];
s->alarm = 0;
+ s->limit[0] = 0x4b00; /* T_LOW, 75 degrees C */
+ s->limit[1] = 0x5000; /* T_HIGH, 80 degrees C */
+
tmp105_interrupt_update(s);
}
--
2.20.1
- [PULL 0/9] target-arm queue, Peter Maydell, 2020/11/17
- [PULL 1/9] hw/arm/virt: ARM_VIRT must select ARM_GIC, Peter Maydell, 2020/11/17
- [PULL 2/9] exynos: Fix bad printf format specifiers, Peter Maydell, 2020/11/17
- [PULL 5/9] register: Remove unnecessary NULL check, Peter Maydell, 2020/11/17
- [PULL 4/9] target/openrisc: Remove dead code attempting to check "is timer disabled", Peter Maydell, 2020/11/17
- [PULL 3/9] hw/input/ps2.c: Remove remnants of printf debug, Peter Maydell, 2020/11/17
- [PULL 6/9] util/cutils: Fix Coverity array overrun in freq_to_str(), Peter Maydell, 2020/11/17
- [PULL 8/9] hw/misc/tmp105: reset the T_low and T_High registers,
Peter Maydell <=
- [PULL 9/9] tmp105: Correct handling of temperature limit checks, Peter Maydell, 2020/11/17
- [PULL 7/9] configure: Make "does libgio work" test pull in some actual functions, Peter Maydell, 2020/11/17
- Re: [PULL 0/9] target-arm queue, no-reply, 2020/11/17
- Re: [PULL 0/9] target-arm queue, Peter Maydell, 2020/11/17