Subject: Re: Need sparc openboot reference (fwd)
To: None <eeh@netbsd.org>
From: Alfred Perlstein <bright@hotjobs.com>
List: port-sparc
Date: 01/27/1999 23:36:04
On Wed, 27 Jan 1999, Eduardo E. Horvath wrote:

> > Does anyone know how i can 'map' my zs chip as Kapil suggested to me?
> > (below)
> > 
> > I picked up the firmware books, but i'm still at a loss on how to do that.
> > 
> > I'm trying to boot netbsd and it freaks out when it can't map the zs
> > chips in my ultra1/170e.
> > 
> > suggestions? 
> 
> Let me see if I can remember how I did this... here's the general idea;
> you may need to modify these instructions somewhat:
> 
> At the OBP you first need to use the `cd' and `ls' commands to find your
> zs node.  Once you find it type `.properties' to get the properties.  You
> need to find the `reg' property.  That should be a set of 3 32-bit
> numbers.  The first is the SBUS slot, the second is the offset into the
> SBUS slot, and the final one is the size.  You need to take the first,
> shift it right by 4 bits and add it to the second to get the offest into
> the SBUS address space. For example if the reg value is
> `0000000f.01100000.00000004', then the offset would be 0xf1100000.
> Now go up one directory and get the SBUS controller's `reg'
> propert.  This one should be 2 64-bit values (or 4 32-bit values), the
> first one is the physical address of the SBUS controller, and the second
> is the size of the registers.  Take this address and add it to the offset
> of the zs controller you just calculated.  This is the physical address of
> the zs controller.  Following me so far?

yup :)

> Now you need to generate a mapping for the device by using the memmap
> function:
> 
> memmap		(phys space size -- virt)
> 
> Let's suppose that the SBUS controller is at 000001fe.00000000, then you
> need to type:
> 
> 1fef1100000 sbus 4 mmap

ok 1fef1000000 sbus 4 memmap
ok 

> 
> This creates the mapping and leaves the virtual address on the stack.
> Then `cd' back to the zs node and type:
> 
> encode-in " address" property

ok cd /zs
ok encode-in " address" property
encode-in ?
ok encode " address" property
Fast Data Access MMU miss

i haven't found anything akin to 'encode-in' in my books yet, but i'll
look.

are you sure that 'encode-in' is correct?

> This should create a property called address with the value of the mapping
> you just created.  You can check this with the `.properties' command.
> 
> The problem with this is that the property you created and the mapping
> will go away when the firmware is reset, so you need to use `nvedit' to 
> add those commands to the nvramrc and set the `use-nvramrc?' property to
> `true' if you want this to persist.

yup :)

> 
> Having done all this, you still will have some problems getting NetBSD to
> run on a Ultra1/170e since the `e' models have `fas' SCSI controllers,
> `hme' ethernet controllers, and `ffb' frame buffers, none of which we have
> drivers for.

i know, this is why i downloaded the linux sparc64 kernel source :)

thank you very much,
-Alfred