Subject: sparcstation 10 boot failures
To: None <current-users@netbsd.org>
From: Holger Rasch <Holger.Rasch@Informatik.Uni-Oldenburg.DE>
List: current-users
Date: 07/15/2003 19:03:01
Hello!

Over the last few months I took several attempts to
convert a sparcstation 10 (1x TMS390Z50 v1 @ 33 MHz, on-chip FPU)
to NetBSD-current, which always ended with the machine locked
up (so that break on the serial console would not work) right
after the 'OBP version ...' message. This happened with
miniroots from complete release builds as well as with single
GENERIC kernel builds. (always by cross compilation on NetBSD/i386)

I finally had some time to analyse the problem and found
the reason to be the call to 'viking_getmid' in
/sys/arch/sparc/sparc/cpu.c : getcpuinfo()
[ bootmid = mp->minfo->getmid(); ].

When I disabled the call (since it looked like it might not
be strictly necessary in the uniprocessor case) the bootstrap
continued through the configuration messages. I did not test
the kernel though, but stopped it before starting init.

Hmm. I can imagine three reasons for these problems:
- viking_getmid() is broken
- the machine is misconfigured at the prom level
  (but I didn't change anything for years)
- cross compilation

Regarding the third point, is the following code

------------------------
000011f8 <viking_getmid>:
    11f8:       05 00 70 03     sethi  %hi(0x1c00c00), %g2
    11fc:       84 10 a3 00     or  %g2, 0x300, %g2     ! 1c00f00 <fsrtoname+0x1
bff5d8>
    1200:       c4 98 80 40     ldda  [ %g2 ] (2), %g2
    1204:       91 30 e0 18     srl  %g3, 0x18, %o0
    1208:       90 0a 20 0f     and  %o0, 0xf, %o0
    120c:       81 c3 e0 08     retl
    1210:       90 02 20 01     inc  %o0
------------------------

a correct translation of

------------------------
int
viking_getmid(void)
{
        u_int v = ldda(MXCC_MBUSPORT, ASI_CONTROL) & 0xffffffff;
        return ((v >> 24) & 0xf);
}
------------------------

Yes, I do not speak sparc :)

I use build.sh for compilation, the source is Jul 11 (cpu.c 1.175).

  Holger