From: "Cédric Le Goater" <clg@kaod.org>
To: Peter Maydell <peter.maydell@linaro.org>, <qemu-arm@nongnu.org>,
<qemu-devel@nongnu.org>
Subject: Re: [PATCH 1/2] hw/misc/tmp105: reset the T_low and T_High registers
Date: Mon, 16 Nov 2020 17:31:02 +0100 [thread overview]
Message-ID: <b888c94a-eb24-36a6-ee76-a572cf6f71f9@kaod.org> (raw)
In-Reply-To: <20201110150023.25533-2-peter.maydell@linaro.org>
On 11/10/20 4:00 PM, Peter Maydell wrote:
> 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>
> ---
> hw/misc/tmp105.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c
> index b47120492a..0a4aad4854 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);
> }
>
next prev parent reply other threads:[~2020-11-16 16:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 15:00 [PATCH 0/2] hw/misc/tmp105: Correct temperature limit check logic Peter Maydell
2020-11-10 15:00 ` [PATCH 1/2] hw/misc/tmp105: reset the T_low and T_High registers Peter Maydell
2020-11-16 16:31 ` Cédric Le Goater [this message]
2020-11-10 15:00 ` [PATCH 2/2] tmp105: Correct handling of temperature limit checks Peter Maydell
2020-11-16 17:00 ` Cédric Le Goater
2020-11-10 15:09 ` [PATCH 0/2] hw/misc/tmp105: Correct temperature limit check logic no-reply
2020-11-16 16:14 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b888c94a-eb24-36a6-ee76-a572cf6f71f9@kaod.org \
--to=clg@kaod.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).