qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] (master, stable-0.13) zaurus: workaround for io


From: Juergen Lock
Subject: Re: [Qemu-devel] [PATCH] (master, stable-0.13) zaurus: workaround for io base address rounded down
Date: Wed, 13 Oct 2010 23:30:17 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Oct 13, 2010 at 07:45:19PM +0000, Blue Swirl wrote:
> On Wed, Oct 13, 2010 at 7:12 PM, Juergen Lock <address@hidden> 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:  (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...]
> 
> 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.
> 
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 = qemu_allocate_irqs(scoop_gpio_set, s, 16);
     iomemtype = 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);
 
     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 &= 0x3f changes works tho.)

 Thanx, :)
        Juergen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]