Received: from [140.186.70.92] (port=38273 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P66yJ-0008FJ-Ie for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:26:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P66yG-0002uY-9D for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:26:42 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:52824 helo=smtp.kn-bremen.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P66yG-0002uJ-3t for qemu-devel@nongnu.org; Wed, 13 Oct 2010 15:26:40 -0400 From: Juergen Lock Date: Wed, 13 Oct 2010 21:12:50 +0200 Message-ID: <20101013191250.GA59919@triton8.kn-bremen.de> References: <201010122134.o9CLYoxu005707@triton8.kn-bremen.de> <4CB4DA82.3080805@codemonkey.ws> <20101013032837.GA14923@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101013032837.GA14923@triton8.kn-bremen.de> Subject: [Qemu-devel] [PATCH] (master, stable-0.13) zaurus: workaround for io base address rounded down List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org The 2nd scoop's base address (0x08800040) now gets rounded down to start of page which causes its io read/write callbacks to be passed addresses 0x40 higher than the code expects: (as witnessed by "Bad register offset" messages and failure to attach the internal CF disk aka microdrive at least.) [There may be more bugs of this kind hiding in other targets, this was just the one I tested...] Signed-off-by: Juergen Lock --- a/hw/zaurus.c +++ b/hw/zaurus.c @@ -70,6 +70,10 @@ static uint32_t scoop_readb(void *opaque { ScoopInfo *s = (ScoopInfo *) opaque; + // XXX Workaround for base address (0x08800040 in this case) + // rounded down to start of page + addr &= 0x3f; + switch (addr) { case SCOOP_MCR: return s->mcr; @@ -104,6 +108,10 @@ static void scoop_writeb(void *opaque, t ScoopInfo *s = (ScoopInfo *) opaque; value &= 0xffff; + // XXX Workaround for base address (0x08800040 in this case) + // rounded down to start of page + addr &= 0x3f; + switch (addr) { case SCOOP_MCR: s->mcr = value;