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 04:47:30
> 
> On Thu, Jan 06, 2000 at 08:25:26AM -0800, Eduardo E. Horvath wrote:
> > 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()?
> 
> I am using the sbus_bus_map() call (not sa_promvaddrs).
> 
> > Can you dump the bustag and the
> > contents of sc->sc_reg?  
> 
> sa->sa_bustag == 0xf031bf60
>     I am not sure if this is what you wanted to know, but
>     the sparc_bus_space_tag pointed to by sa_bustag also
>     contains only pointers...
> 
> sc->sc_reg == 0xfe02a040
>     This is a pointer to an sbus_reg structure containing
>     the values as mentioned in be previous mail (slot==2,
>     offset==0x40, size==0x100)

What?  No.  bus_space_read_2() is defined as:

#define bus_space_read_2(t, h, o)                                       \
            ((void)t, *(volatile u_int16_t *)((h) + (o)))

which means that sc->sc_reg should point to the register's VA, and the
tag is ignored.

The sa->sa_bustag should point to a sparc_bus_space_tag structure.
The first element is a cookie, which points to the bus softstate.  See
arch/sparc/include/bus.h for details.

> 
> > Secondly, the function of sbus_bus_map() varies according to the
> > hardware.  What are you using here?
> 
> It's a SPARCbook 3GX (sun4m).

Never mucked with one of those.

> 
> > What are the OBP nodes involved?
> > What are the contents of the OBP node for this device?
> 
> ok cd /iommu/sbus

O.K.  It's bound to an iommu.

> ok ls
> ffd4d454 SUNW,DBRIs3@2,40     <--
> ffd4ce3c ts102@1,2000000
> ffd4b014 ledma@4,8400000
> ffd4a9f8 SUNW,bpp@4,c800000
> ffd4749c espdma@4,8400000
> ffd45d50 p9100@0,8000000

Now do:

cd SUNW,DBRIs3@2,40
.properties

> 
> > 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.
> 
> How can I do this? (I am no OBP expert.)

Take a look at the OBP manual.  It should be available at
www.docs.sun, in the section about device driver developmant.

One thing to try is once the machine has panic'ed, grab the address it
panic'ed on and:

<addr>	map?

This will try to dump the MMU PTE of that address.

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