Subject: Re: really no help?
To: Ingolf Koch <ingolf@knuut.de>
From: Eduardo E. Horvath <eeh@one-o.com>
List: port-sparc
Date: 01/08/2000 03:33:36
> 
> On Wed, Jan 05, 2000 at 10:05:30AM -0800, Eduardo E. Horvath wrote:
> > You're getting a data error.  This means that while the address is
> > mapped into the MMU, it's either mapped incorrectly (cacheable
> > vs. uncacheable) or there realy is nothing responding to bus cycles at
> > that physical address.
> 
> As these are volatile registers, I have not specified
> BUS_SPACE_MAP_CACHEABLE.
> 
> According to the sbus attach information supplied to
> dbri_attach_sbus() we have
>     sa_nregs  == 1,
>     sa_slot   == 2,
>     sa_offset == 0x40, and
>     sa_size   == 0x100
> 
> Thanks for your reply. How can I find out what physical
> address is used?

Hmm... Let's see the code snippet:

...
sc->sc_bustag = sa->sa_bustag;
sc->sc_dmatag = sa->sa_dmatag;
if (sa->sa_npromvaddrs) {
        sc->sc_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
} else {
        if (sbus_bus_map(sa->sa_bustag,
                        sa->sa_slot,
                        sa->sa_offset,
                        sa->sa_size,
                        BUS_SPACE_MAP_LINEAR,
                        0, &sc->sc_reg) != 0) {
                printf("%s @ sbus: cannot map registers\n",
                                self->dv_xname);
                return;
        }
}
printf("\nat location 0: %04x\n", bus_space_read_2(sc->sc_bustag, sc->sc_reg, 0x0));
...


Notice that if your sa->sa_promvaddrs[0] is not NULL you use the
mapping established by the PROM.  Can you check to see if you're using
that or are calling sbus_bus_map()?  Can you dump the bustag and the
contents of sc->sc_reg?  

Secondly, the function of sbus_bus_map() varies according to the
hardware.  What are you using here?  What are the OBP nodes involved?
What are the contents of the OBP node for this device?

Finally, make sure the registers take up all the space and don't have
holes.  I would suggest trying to poke at them from the OBP and see
what they look like.

=========================================================================
Eduardo Horvath				eeh@netbsd.org
	"I need to find a pithy new quote." -- me