Patchwork [2/3] Scoop: fix access to registers from second instance

login
register
mail settings
Submitter Dmitry Eremin-Solenikov
Date Jan. 13, 2011, 3:37 p.m.
Message ID <1294933032-12757-2-git-send-email-dbaryshkov@gmail.com>
Download mbox | patch
Permalink /patch/78768/
State New
Headers show

Comments

Dmitry Eremin-Solenikov - Jan. 13, 2011, 3:37 p.m.
Second instance of scoop contains registers shifted to 0x40 from the start
of the page. Instead of messing with register mapping, just limit register
address to 0x00..0x3f.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 hw/zaurus.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/zaurus.c b/hw/zaurus.c
index 54ec3f0..36be94a 100644
--- a/hw/zaurus.c
+++ b/hw/zaurus.c
@@ -70,7 +70,7 @@  static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr)
 {
     ScoopInfo *s = (ScoopInfo *) opaque;
 
-    switch (addr) {
+    switch (addr & 0x3f) {
     case SCOOP_MCR:
         return s->mcr;
     case SCOOP_CDR:
@@ -104,7 +104,7 @@  static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value)
     ScoopInfo *s = (ScoopInfo *) opaque;
     value &= 0xffff;
 
-    switch (addr) {
+    switch (addr & 0x3f) {
     case SCOOP_MCR:
         s->mcr = value;
         break;