Jochen Kunz | 1 Nov 2002 19:00
Picon

Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

Hi. 

1. If any developer in Germany (Europe) wants to get a machine like this
contact me off-list. I may be able to get 10 of them for about 20..30
EUR each (+ shipping). 

2. I am trying to get ofppc-current to run on my Motorola PowerStack II
(aka Bull Estrella 300). 1.6 runs more or less. (Single user shell
crashes.)
With the current kernel the machine hangs after printing 

NetBSD does not yet support the "MOT,PowerStack_II_Pro4000".
Using generic OpenFirmware driver support.

I thought about the good old printf debugging, but I found a document at
docs.sun.com describing the use of OpenFirmWare for low level debugging.
So I wrote a small sh/awk script that extracts C-function names from
source files and looks up the address via nm in netbsd.gdb. So it is
easy to set breakpoints in the OFW, "load net" the kernel and stepping
with "go" from breakpoint to breakpoint. When it hangs and doesn't get
to the next breakpoint I know closer where to start putting printfs into
the source.

This was the theory. In practice the kernel prints as usual its "NetBSD
does not yet"... 
when I "load net" and "go" without breakpoints, but hangs immediately
when I set any breakpoints at functions from e.g. ofppc/machdep.c

Is this is a firmware bug or am I completely wrong and it is not
possible to use OFW debugging functionality to debug a NetBSD kernel? 
(Continue reading)

Jochen Kunz | 1 Nov 2002 22:57
Picon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

On 2002.11.01 19:00 Jochen Kunz wrote:

> With the current kernel the machine hangs after printing 
> 
> NetBSD does not yet support the "MOT,PowerStack_II_Pro4000".
> Using generic OpenFirmware driver support.
[some printfs later]
sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
        /*
         * Initialize kernel pmap and hardware.
         */
        for (i = 0; i < 16; i++) {
                pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
                __asm __volatile ("mtsrin %0,%1"
                     :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
        }

It hangs at the first execution of the inline ASM instruction. 
--

-- 

tschüß,
         Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/

Matt Thomas | 1 Nov 2002 23:27

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

At 01:57 PM 11/1/2002, Jochen Kunz wrote:
>On 2002.11.01 19:00 Jochen Kunz wrote:
>
> > With the current kernel the machine hangs after printing
> >
> > NetBSD does not yet support the "MOT,PowerStack_II_Pro4000".
> > Using generic OpenFirmware driver support.
>[some printfs later]
>sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
>         /*
>          * Initialize kernel pmap and hardware.
>          */
>         for (i = 0; i < 16; i++) {
>                 pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
>                 __asm __volatile ("mtsrin %0,%1"
>                      :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
>         }
>
>It hangs at the first execution of the inline ASM instruction.
>--

What are your IBAT0/DBAT0 set to?  Is PSL_IR and/or PSL_DR set?

--

-- 
Matt Thomas               Internet:   matt <at> 3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message

Chuck Silvers | 3 Nov 2002 17:35
Favicon

Re: Ethernet driver bug?

hi,

what revision of ofnet.c are you using?  I fixed this problem with rev. 1.25:

----------------------------
revision 1.25
date: 2002/09/18 01:47:08;  author: chs;  state: Exp;  lines: +7 -9
use splnet() around the body of ofnet_read().  this is logically the
receive interrupt handler since it passes received packets to the
interface's input handler.  that ends up scheduling a network softint
and queuing the packet on the interface's receive queue (in that order),
so if softnet isn't blocked at this point then softnet() doesn't find
the packet until it's triggered again by something else.
remove all vesitages of dk_establish().
----------------------------

if you've got that fix already then the problem is that the interrupt-masking
code isn't blocking the "softnet" interrupt level when it's supposed to.
are you using the "ofwgen" stuff that's in the ofppc port, or did you
write your own?

-Chuck

On Sun, Nov 03, 2002 at 06:26:19PM +0700, Alexander A. V'ushkov wrote:
> Hi, All!
> I'm continuing to start ofppc port of NetBSD on MPC8260.
> 
> I'm deal with erratic NFS behavior, and as I suppose, there is a bug in the
> implementation of the Ethernet driver (function ether_input, file
> /net/if_ether_subr.c) Sometimes software interrupt, responsible for
(Continue reading)

Wolfgang Solfrank | 4 Nov 2002 17:33
Picon
Favicon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

Hi,

> [some printfs later]
> sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
>         /*
>          * Initialize kernel pmap and hardware.
>          */
>         for (i = 0; i < 16; i++) {
>                 pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
>                 __asm __volatile ("mtsrin %0,%1"
>                      :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
>         }
> 
> It hangs at the first execution of the inline ASM instruction. 

That's to be expexcted: the kernel is modifying the mmu configuration,
but OpenFirmware isn't aware of that.

While newer PPC bindings to OFW specify methods for interoperability
between OFW and the "client" (which is the kernel in our case), the
implementation in the FirePower machine (and probably in your box, too)
predate this specification, and thus there is no possibility for the
kernel to tell OFW about the changed mapping.

Therefor, NetBSD/ofppc does it the hard way by preserving the mmu
configuration found at the start and switching back to this configuration
whenever entering OFW (and disabling interrupts while doing so).

End result is that you cannot expect to run OFW routines (including the
OFW debugger) at arbitrary points while the kernel is running :-(.
(Continue reading)

Jochen Kunz | 5 Nov 2002 23:17
Picon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

On 2002.11.04 17:33 Wolfgang Solfrank wrote:

> > [some printfs later]
> > sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
> >         /*
> >          * Initialize kernel pmap and hardware.
> >          */
> >         for (i = 0; i < 16; i++) {
> >                 pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
> >                 __asm __volatile ("mtsrin %0,%1"
> >                      :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
> >         }
> > 
> > It hangs at the first execution of the inline ASM instruction. 
> That's to be expexcted: the kernel is modifying the mmu configuration,
> but OpenFirmware isn't aware of that.
But why is the machine crashing when the MMU is reinitialized? I would
expect a crash at the next call to the OFW. Or is it because the kernel
expects to run still in "real" mode, i.e. MMU turned off, but the MMU is
active and so it crashes as it reloads the segment registers? (PSL_IR
and PSL_DR are 1 at that time.)

> While newer PPC bindings to OFW specify methods for interoperability
> between OFW and the "client" (which is the kernel in our case), the
> implementation in the FirePower machine (and probably in your box,
> too) predate this specification, and thus there is no possibility for 
> the kernel to tell OFW about the changed mapping.
Aha. The firmware is:
 Open Firmware Revision ID . . . . . . . . . . . . . . . . =1.2 RM11
 Open Firmware Revision Date . . . . . . . . . . . . . . . =Jun 4, 1998
(Continue reading)

Jochen Kunz | 5 Nov 2002 22:04
Picon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

On 2002.11.01 23:27 Matt Thomas wrote:

Sorry for the late answer. I had to partially reinstall my net-boot
server. (Never try to make a tar in a hurry. /dev/rsd0c was not intended
to be the target of the archive...) And I spend some time reading e.g.
pmap(9), ...

> >sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
> >         /*
> >          * Initialize kernel pmap and hardware.
> >          */
> >         for (i = 0; i < 16; i++) {
> >                 pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
> >                 __asm __volatile ("mtsrin %0,%1"
> >                      :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
> >         }
> >
> >It hangs at the first execution of the inline ASM instruction.
> What are your IBAT0/DBAT0 set to?  Is PSL_IR and/or PSL_DR set?
	pmap_print_mmuregs();
	Debugger();
in front of the mtsrin instruction:
SDR1:   0xfff0000
SR[]:   0x00000000,   0x00000001,   0x00000002,   0x00000003,   
        0x00000004,   0x00000005,   0x00000006,   0x00000007,   
        0x00000008,   0x00000009,   0x0000000a,   0x0000000b,   
        0x0000000c,   0x0000000d,   0x0000000e,   0x0000000f,   
iBAT[]: 0x00001ffe 0x00000012, 0x00000000 0x00000000, 
        0x00000000 0x00000000, 0x00000000 0x00000000, 
dBAT[]: 0x00001ffe 0x00000012, 0x00000000 0x00000000, 
(Continue reading)

Wolfgang Solfrank | 6 Nov 2002 00:52
Picon
Favicon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

Hi,

>>>[some printfs later]
>>>sys/arch/powerpc/mpc6xx/pmap.c:pmap_bootstrap():
>>>        /*
>>>         * Initialize kernel pmap and hardware.
>>>         */
>>>        for (i = 0; i < 16; i++) {
>>>                pmap_kernel()->pm_sr[i] = EMPTY_SEGMENT;
>>>                __asm __volatile ("mtsrin %0,%1"
>>>                     :: "r"(EMPTY_SEGMENT), "r"(i << ADDR_SR_SHFT));
>>>        }
>>>
>>>It hangs at the first execution of the inline ASM instruction. 
>>
>>That's to be expexcted: the kernel is modifying the mmu configuration,
>>but OpenFirmware isn't aware of that.
> 
> But why is the machine crashing when the MMU is reinitialized? I would
> expect a crash at the next call to the OFW. Or is it because the kernel
> expects to run still in "real" mode, i.e. MMU turned off, but the MMU is
> active and so it crashes as it reloads the segment registers? (PSL_IR
> and PSL_DR are 1 at that time.)

Well, I assumed that you tried to step over the mtsrin instruction via
the OFW debugger.  If you discovered the hang via some other means
(which I'd wonder how actually), I'd need more data.

But if my assumption is correct, you _are_ entering OFW immediately
after this instruction (as the OFW debugger is of course part of OFW).
(Continue reading)

Jochen Kunz | 6 Nov 2002 01:22
Picon

Re: Motorola PowerStack II / Estrella 300 and options FIRMWORKSBUGS

On 2002.11.06 00:52 Wolfgang Solfrank wrote:

> Well, I assumed that you tried to step over the mtsrin instruction via
> the OFW debugger.  If you discovered the hang via some other means
> (which I'd wonder how actually), I'd need more data.
I placed printf(9)s before and after the instruction. The printf(9)
before was the last executed. The OFW debugger gets unusable at an
earlier point of booting. Then I placed a Debugger(); call before the
mtsrin. If I singlestep over the mtsrin it hangs. Looks to me like the
kernel is already running in virtual adressing mode and is changeing the
mapping it is already using, thus sendig it self to lala-land. I should
make an exact analyze of the register values and CPU / MMU state instead
of wild guessing, but as I need some sleep right now I will interrupt
this till tomorrow^Wtoday evening. ;-) 
--

-- 

tschüß,
         Jochen

Homepage: http://www.unixag-kl.fh-kl.de/~jkunz/

Emmanuel Dreyfus | 16 Nov 2002 22:05
Picon

spr register

Hi

In one special purpose register, there is the type of the CPU stored. I
need it for COMPAT_MACH. Is there a place accessible in C where we store
it? If not, what assembly would I need to get the value?

--

-- 
Emmanuel Dreyfus
manu <at> netbsd.org


Gmane