[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/14] timer: ds1338 remove vestige of un-modeled OS
From: |
Michael Davidsaver |
Subject: |
[Qemu-devel] [PATCH 10/14] timer: ds1338 remove vestige of un-modeled OSF |
Date: |
Thu, 5 Jul 2018 11:19:57 -0700 |
Oscillator stop has never been modeled, so the
Oscillator Stop Flag can never be set.
Signed-off-by: Michael Davidsaver <address@hidden>
---
hw/timer/ds-rtc.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/hw/timer/ds-rtc.c b/hw/timer/ds-rtc.c
index 3c5781d53c..126566ce1f 100644
--- a/hw/timer/ds-rtc.c
+++ b/hw/timer/ds-rtc.c
@@ -21,8 +21,6 @@
*/
#define NVRAM_SIZE 64
-#define CTRL_OSF 0x20
-
#define TYPE_DSRTC "ds1338"
#define DSRTC(obj) OBJECT_CHECK(DSRTCState, (obj), TYPE_DSRTC)
@@ -216,13 +214,11 @@ static int dsrtc_send(I2CSlave *i2c, uint8_t data)
if (s->ptr == R_CTRL) {
/* Control register. */
- /* Ensure bits 2, 3 and 6 will read back as zero. */
- data &= 0xB3;
-
- /* Attempting to write the OSF flag to logic 1 leaves the
- value unchanged. */
- data = (data & ~CTRL_OSF) | (data & s->nvram[s->ptr] & CTRL_OSF);
-
+ /* Allow guest to set no-op controls for clock out pin and
+ * rate select. Ignore write 1 to clear OSF. We don't model
+ * oscillator stop, so it is never set.
+ */
+ data = data & 0x93;
}
s->nvram[s->ptr] = data;
if (s->ptr <= R_YEAR) {
--
2.11.0
- Re: [Qemu-devel] [PATCH 03/14] timer: ds1338 persist 12-hour mode selection, (continued)
- [Qemu-devel] [PATCH 05/14] timer: ds1338 change write handling and fix wday_offset handling, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 06/14] tests: ds-rtc test 12 hour mode, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 07/14] tests: ds-rtc test wday offset, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 09/14] timer: rename file ds1338.c -> ds-rtc.c, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 10/14] timer: ds1338 remove vestige of un-modeled OSF,
Michael Davidsaver <=
- [Qemu-devel] [PATCH 08/14] timer: rename ds1338 -> dsrtc, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 12/14] timer: ds-rtc handle CENTURY bit, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 13/14] timer: ds-rtc model ds1375, Michael Davidsaver, 2018/07/05
- [Qemu-devel] [PATCH 14/14] tests: drop ds1338-test, Michael Davidsaver, 2018/07/05
- Message not available