xemu/hw/rtc
Alexander Graf 83ad95957c pl031: Expose RTCICR as proper WC register
The current PL031 RTCICR register implementation always clears the
IRQ pending status on a register write, regardless of the value the
guest writes.

To justify that behavior, it references the ARM926EJ-S Development
Chip Reference Manual (DDI0287B) and indicates that said document
states that any write clears the internal IRQ state.  It is indeed
true that in section 11.1 this document says:

  "The interrupt is cleared by writing any data value to the
   interrupt clear register RTCICR".

However, later in section 11.2.2 it contradicts itself by saying:

  "Writing 1 to bit 0 of RTCICR clears the RTCINTR flag."

The latter statement matches the PL031 TRM (DDI0224C), which says:

  "Writing 1 to bit position 0 clears the corresponding interrupt.
   Writing 0 has no effect."

Let's assume that the self-contradictory DDI0287B is in error, and
follow the reference manual for the device itself, by making the
register write-one-to-clear.

Reported-by: Hendrik Borghorst <hborghor@amazon.de>
Signed-off-by: Alexander Graf <graf@amazon.com>
Message-id: 20191104115228.30745-1-graf@amazon.com
[PMM: updated commit message to note that DDI0287B says two
 conflicting things]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-11-19 13:20:27 +00:00
..
Kconfig hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:26:35 +02:00
Makefile.objs hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:31:44 +02:00
aspeed_rtc.c hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:31:44 +02:00
ds1338.c hw: Move DS1338 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:26:35 +02:00
exynos4210_rtc.c hw: Move Exynos4210 RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:29:18 +02:00
m41t80.c hw: Move M41T80 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:22:12 +02:00
m48t59-internal.h hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:20:45 +02:00
m48t59-isa.c hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:20:45 +02:00
m48t59.c hw: Move M48T59 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:20:45 +02:00
mc146818rtc.c Merge commit 'df84f17' into HEAD 2019-10-26 15:38:02 +02:00
pl031.c pl031: Expose RTCICR as proper WC register 2019-11-19 13:20:27 +00:00
sun4v-rtc.c hw: Move sun4v hypervisor RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:23:15 +02:00
trace-events hw: Move Aspeed RTC from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:31:44 +02:00
twl92230.c hw: Move TWL92230 device from hw/timer/ to hw/rtc/ subdirectory 2019-10-24 20:24:50 +02:00
xlnx-zynqmp-rtc.c hw/rtc/xlnx-zynqmp-rtc: Remove unused "ptimer.h" include 2019-10-24 20:34:12 +02:00