hw/pxa2xx.c: Fix handling of RW bits in PMCR
authorPeter Maydell <peter.maydell@linaro.org>
Sun, 13 Nov 2011 14:18:39 +0000 (14:18 +0000)
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>
Mon, 14 Nov 2011 01:26:20 +0000 (02:26 +0100)
Fix an error in commit afd4a6522 which meant that writing a zero
to the RW bits in the PMCR wouldn't actually clear them. (Error
spotted by Andrzej Zaborowski.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
hw/pxa2xx.c

index d38b92292471eccea9d8349f70e615d9bc73f74d..e9a507ece56c5051bda6ce371c1be54189fa67e8 100644 (file)
@@ -117,6 +117,7 @@ static void pxa2xx_pm_write(void *opaque, target_phys_addr_t addr,
         /* Clear the write-one-to-clear bits... */
         s->pm_regs[addr >> 2] &= ~(value & 0x2a);
         /* ...and set the plain r/w bits */
+        s->pm_regs[addr >> 2] &= ~0x15;
         s->pm_regs[addr >> 2] |= value & 0x15;
         break;