Subject: NeXT TurboColor panics in esp_read_reg() with any SCSI devices connected
To: None <port-next68k@netbsd.org>
From: Andrew Daugherity <andrew.daugherity@gmail.com>
List: port-next68k
Date: 03/11/2005 00:54:20
I have a NeXT TurboColor with system ROM 3.1 v71.  It works perfectly
in OpenStep 4.2 (of course).  I attempted to netboot NetBSD, and I
finally got it to boot, but the kernel panics during the esp
initialization, before it attempts to mount root or start init, etc. 
Unfortunately I don't have the proper serial cable but I'll include
the output of "trace" from the debugger and part of the dmesg.

I have tried both the 2.0 release and the 20041106 snapshot; both
panic at the same point.  I also tried varying amounts of memory
installed (128MB, 64MB, 32MB), and aside from changing the addresses
of the kernel stack, it has no effect.

I also tried various SCSI configurations, to no avail.  My normal SCSI
config is one internal hard disk (Seagate ST51080N, 1GB) with OpenStep
4.2 installed (which NetBSD detects as sd0).  I have also tried an old
80MB IBM/Apple SCSI disk from a mac68k machine (not detected by
NetBSD); my normal disk plus an external CD-ROM (sd0 found, no mention
of CD-ROM); only a CD-ROM (no SCSI devices enumerated); no SCSI
devices at all (fails system SCSI test, presumably due to lack of
termination on the bus); and with the hard drive connected to the SCSI
bus but its power connector unplugged (this actually works and
continues booting).  All configurations except the last result in a
panic at the same point.

The messages from a panic (with only sd0, and 32MB RAM) are as follows:
===
... various dmesg stuff, typed by hand (argh!)...
Lookis like a MCS1850 (new style) clock chip.
scsibus0: waiting 2 seconds for devices to settle...
sd0 at scsibus0 target 1 lun 0: <SEAGATE, ST51080N, 0943> disk fixed
sd0: 1030MB, 4826 cyl, 4 head, 109 sec, 512 bytes/sect x 2109840 sectors
trap type 0, code = 0x125, v = 0xbf4007
kernel program counter = 0x1714c6
kernel: Bus error trap
pid = -1, lid = -1, pc = 001714C6, ps = 2310, sfc = 1, dfc = 1
Registers:
(hex dump of all registers)
Kernel stack (004DDAAC):
(bigass hex dump of stack)
panic: Bus error
Stopped at    netbsd:cpu_Debugger+0x6:    unlk    a6
db> trace
cpu_Debugger (ffffff7f, 0, 5ddb30, 5ddb1c, 14d702) + 6
panic(1a0d33,2310,0,1025f00,0) + f8
trap(0,125, bf4007) + 268
esp_read_reg(101a000, 7,10,0,1) + 10
esp_dma_intr(101a000) + 6e
ncr53c9x_intr(101a000) + ec6
isrdispatch_autovec(5ddd68) + 72
intrhand_autovec(?)
mi_switch(5da080,0,ffff2004,0,0) + 10
ltsleep(102f000,10,1a30d1,0,0) + 2da
scsipi_execute_xs(102f000,401024,5ddee8,15593c,5dde80) + 1d0
scsipi_command(102d300,5dde78,6,5ddee8,24,0,2710,0,401024) + 6a
scsipi_inquire(102d300,5ddee8,400024) + 5a
scsibus_config(101a088,1025ec0) + 56
scsipi_completion_thread(101a088) + 1ae
proc_trampoline() + 2
db>
===
Hopefully I didn't fudge any of those hex digits...
dmesg with SCSI disc disconnected (and successful netboot):
===
cat denethor.dmesg.txt
^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^D8~^A^D8aM-e^D8^LM-`^D8^L^P^D8^LM-D^D8=:^D8aM-h^D8^Zj^D8^Y4^D800000
00000000 10400008 047DF000 001AB220 FFFFF000 001AB1F0 FFEFFFFC

Kernel stack (001AB0A8):
1AB0A8: 0014811E 001AB12C 00000080 00000003 00002004 005D1024 00000000 047DF00D
1AB0C8: 00002000 10400008 047DF000 001AB220 FFFFF000 00000001 00000000 00000000
1AB0E8: 00000001 00000000 00000000 00000000 00000000 00000000 00000000 00000008
1AB108: 00000000 00000000 00000000 00000000 001AB1F0 0000134C 00000008 00000505
1AB128: 0000001C 00000001 00000008 00000003 00002004 005D1024 00000000 047DF00D
1AB148: 00002000 00000000 00000000 10400008 047DF000 001AB220 FFFFF000 001AB1F0
1AB168: FFEFFFFC 00000000 26040014 64247008 00000010 05050005 00050005 0000001C
1AB188: 10400008 00000000 00000000 00000000 00000000 001AB1F0 00146AD4 047DF000
1AB1A8: 047DF000 00002000 00002004 047DF000 00000000 00000000 00000000 002D4A40
1AB1C8: 10400008 001AB220 FFFFF000 00000008 00000518 0480C000 00000010 00000518
1AB1E8: 00000000 00000000 001AB224 00145222 005D1024 00002000 10400008 00000003
1AB208: 00000001 00000010 00000000 00275D50 005FCC7C 7FFFFFFF 00000518 001AB368
1AB228: 000FAEAC 00275D50 00000000 00003000 001E3EB8 00000000 00000000 0026CE40
1AB248: 7FFFFFFF FFFFF000 001AB1B8 001AB200 0000028B 001AB274 0014630C 00000013
1AB268: 00000000 00000000 005E2A80 001AB3B4 000FAE74 00000002 00000001 00000008
1AB288: 00000000 00000000 00000001 005FCC7C 005FCC7C 000EF0C6 0105C000 00000001
panic: MMU fault
rebooting...
done clearing
Loaded initial symtab at 0x1f752c, strtab at 0x239688, # entries 16198
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 2.99.10 (GENERIC) #0: Sun Nov  7 04:49:15 PST 2004
        mw@ultra:/usr/src/obj/next68k/sys/arch/next68k/compile/GENERIC
NeXT/MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
total memory = 32760 KB
avail memory = 28480 KB
intrmask: 0xae7800
intrstat: 0xae7000
mainbus0 (root)
intio0 at mainbus0
esp0 at intio0 addr 0x2114000
zsc0 at intio0 addr 0xbf8000
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
nextdma0 at intio0 addr 0x2000010: channel 0 (scsi)
nextdma1 at intio0 addr 0x2000110: channel 1 (enetx)
nextdma2 at intio0 addr 0x2000150: channel 2 (enetr)
xe0 at intio0 addr 0x2106000
xe0: MAC address 00:00:0f:01:28:7e
xe0: using DMA channels nextdma1 nextdma2
nextkbd0 at intio0 addr 0x200e000
wskbd0 at nextkbd0 (mux ignored): console keyboard
esp0: ESP100, 20MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
esp0: using DMA channel nextdma0
nextdisplay0 at mainbus0: 1120 x 832, 16bpp
wsdisplay0 at nextdisplay0 (kbdmux ignored): console (color, vt100
emulation), using wskbd0
Looks like a MCS1850 (new style) clock chip.
scsibus0: waiting 2 seconds for devices to settle...
boot device: xe0
root on xe0
mountroot: trying nfs...
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 172.17.17.100
nfs_boot: my_name=denethor
nfs_boot: my_domain=cox-internet.com
nfs_boot: my_addr=172.17.17.103
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=172.17.17.254
root on 172.17.17.100:/usr/local/next_root
root time: 0x4231342f
root file system type: nfs
WARNING: clock lost 23119 days
init: copying out path `/sbin/init' 11
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
===
Behavior is pretty much the same with the 2.0-RELEASE GENERIC kernel,
except that nearly everything (except vi!) coredumps.  This could be
an effect of mixing that kernel with the snapshot's userland, though.

It still seems to have the clock lost <random> days problem, and
oversize frame on xe0 problem that I saw report some time back, but at
least it boots.  ping seems to be broken, but other network stuff
(telnet, ftp, ssh) works, aside from the "oversize frame" errors.

Here's a dmesg with 128MB RAM installed (and of course, no SCSI devices):
===
andrewx@aragorn:~$ cat denethor.dmesg-128 
done clearing
Loaded initial symtab at 0x1f752c, strtab at 0x239688, # entries 16198
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 2.99.10 (GENERIC) #0: Sun Nov  7 04:49:15 PST 2004
        mw@ultra:/usr/src/obj/next68k/sys/arch/next68k/compile/GENERIC
NeXT/MC68040 CPU+MMU+FPU, 4k on-chip physical I/D caches
total memory = 127 MB
avail memory = 121 MB
intrmask: 0xae7800
intrstat: 0xae7000
mainbus0 (root)
intio0 at mainbus0
esp0 at intio0 addr 0x2114000
zsc0 at intio0 addr 0xbf8000
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
nextdma0 at intio0 addr 0x2000010: channel 0 (scsi)
nextdma1 at intio0 addr 0x2000110: channel 1 (enetx)
nextdma2 at intio0 addr 0x2000150: channel 2 (enetr)
xe0 at intio0 addr 0x2106000
xe0: MAC address 00:00:0f:01:28:7e
xe0: using DMA channels nextdma1 nextdma2
nextkbd0 at intio0 addr 0x200e000
wskbd0 at nextkbd0 (mux ignored): console keyboard
esp0: ESP100, 20MHz, SCSI ID 7
scsibus0 at esp0: 8 targets, 8 luns per target
esp0: using DMA channel nextdma0
nextdisplay0 at mainbus0: 1120 x 832, 16bpp
wsdisplay0 at nextdisplay0 (kbdmux ignored): console (color, vt100
emulation), using wskbd0
Looks like a MCS1850 (new style) clock chip.
scsibus0: waiting 2 seconds for devices to settle...
boot device: xe0
root on xe0
mountroot: trying nfs...
nfs_boot: trying DHCP/BOOTP
nfs_boot: DHCP next-server: 172.17.17.100
nfs_boot: my_name=denethor
nfs_boot: my_domain=cox-internet.com
nfs_boot: my_addr=172.17.17.103
nfs_boot: my_mask=255.255.255.0
nfs_boot: gateway=172.17.17.254
root on 172.17.17.100:/usr/local/next_root
root time: 0x42313c55
root file system type: nfs
WARNING: clock lost 17491 days
init: copying out path `/sbin/init' 11
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
xe0: discarding oversize frame (len=1519)
===

Hopefully someone who knows the system better than me can make use of this info.

-Andrew