Received: from [140.186.70.92] (port=53866 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P68wv-0003VZ-Fc for qemu-devel@nongnu.org; Wed, 13 Oct 2010 17:33:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P68vv-00086r-2e for qemu-devel@nongnu.org; Wed, 13 Oct 2010 17:32:25 -0400 Received: from gelbbaer.kn-bremen.de ([78.46.108.116]:48451 helo=smtp.kn-bremen.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P68vu-00086f-QJ for qemu-devel@nongnu.org; Wed, 13 Oct 2010 17:32:23 -0400 From: Juergen Lock Date: Wed, 13 Oct 2010 23:30:17 +0200 Subject: Re: [Qemu-devel] [PATCH] (master, stable-0.13) zaurus: workaround for io base address rounded down Message-ID: <20101013213017.GA64867@triton8.kn-bremen.de> References: <201010122134.o9CLYoxu005707@triton8.kn-bremen.de> <4CB4DA82.3080805@codemonkey.ws> <20101013032837.GA14923@triton8.kn-bremen.de> <20101013191250.GA59919@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org On Wed, Oct 13, 2010 at 07:45:19PM +0000, Blue Swirl wrote: > On Wed, Oct 13, 2010 at 7:12 PM, Juergen Lock wrote: > > 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: =A0(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 > > =A0was just the one I tested...] >=20 > The devices are passed an offset to base address. Perhaps the real > problem is that scoop_init registers too much MMIO: 0x1000, when the > real range should be only 0x28. Also the registers are in 4 byte > intervals and any access to address between the registers also > triggers a warning. >=20 Well I just tried registering only 0x28 bytes and still got the messages: --- a/hw/zaurus.c +++ b/hw/zaurus.c @@ -237,7 +241,7 @@ ScoopInfo *scoop_init(PXA2xxState *cpu, s->in =3D qemu_allocate_irqs(scoop_gpio_set, s, 16); iomemtype =3D cpu_register_io_memory(scoop_readfn, scoop_writefn, s); - cpu_register_physical_memory(target_base, 0x1000, iomemtype); + cpu_register_physical_memory(target_base, 0x28, iomemtype); register_savevm(NULL, "scoop", instance, 1, scoop_save, scoop_load, = s); =20 return s; > What were the messages exactly? Excerpt: [...] scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 scoop_readb: Bad register offset 0x4c scoop_readb: Bad register offset 0x48 scoop_readb: Bad register offset 0x4c scoop_readb: Bad register offset 0x48 scoop_readb: Bad register offset 0x4c scoop_readb: Bad register offset 0x48 spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. spitz_out_switch: Green LED off. spitz_out_switch: Green LED on. scoop_readb: Bad register offset 0x4c scoop_writeb: Bad register offset 0x54 scoop_writeb: Bad register offset 0x5c scoop_writeb: Bad register offset 0x54 scoop_readb: Bad register offset 0x48 scoop_writeb: Bad register offset 0x44 spitz_out_switch: Green LED off. (The above patch together with the addr &=3D 0x3f changes works tho.) Thanx, :) Juergen