Subject: UDB/Multia
To: None <port-alpha@NetBSD.ORG>
From: Matt Thomas <matt@lkg.dec.com>
List: port-alpha
Date: 06/05/1996 15:51:46
I finally got my hands on a multia and have hacked NetBSD/alpha
such that the kernel will boot.

[Before someone asks: I am running a latter console than what is
generally available.]

The problems (as suspected) are in pci/sio_pic.c.

First the boot log and output of show config for Chris:

CPU 0 booting

*** keyboard not plugged in...
starting console on CPU 0
initialized idle PCB
initializing semaphores
initializing heap
initial heap 1c0c0
memory low limit = 14a000
heap = 1c0c0, 17fc0
initializing driver structures
initializing idle process PID
XDELTA enabled.
initializing file system
initializing 8259s
initializing timer data structures
lowering IPL
CPU 0 speed is 6.00 ns (167MHz)

Powerup process has started
CPU ID = 0
Initialize configuration locks etc.
Configure the memory
Initialising ISA/PCI interrupts.
Configure the PCI Bus
Start tt class, port (graphics, keyboard, then serial) drivers
entering idle loop
DEC AXPpci166 MT Common Console X4.5-780, built on Feb 23 1996 at 22:03:13
change stdin/out/err channels from nl to tt
CPU = 166 Mhz LCA
Cache size = 256 K
Memory size = 32 Meg
Testing Memory from 8 to 32 meg...
Start driver phase 4
Build this processor's slot in the hwrpb
Init SCSI class driver
Start driver phase 5
Network is connected to the AUI port.

dka0.0.0.6.0               DKA0               TOSHIBA MK2326FB  A15B
dva0.0.0.0.1               DVA0                               
ewa0.0.0.8.0               EWA0              08-00-2B-E4-0A-89
pka0.7.0.6.0               PKA0                  SCSI Bus ID 7

>>>show config

SRM Console X4.5-780   VMS PALcode V5.53-10, OSF PALcode X1.45-5
MEMORY - 32 Meg of system memory
CACHE - 256 K of backup cache
CPU - 166 Mhz LCA
PCI
Slot            Device          Class           Sub-Class
 6      NCR 53C810              Default         0
 7      Intel 82378IB           Default         0
 8      DECchip 21040-AA        Network         0
 9
 10
 11     DECchip ZLXp 21030      Display         80
 12
ISA
Slot    Device  Name            Type         Enabled  BaseAddr  IRQ     DMA
0
        0       MOUSE           Embedded        Yes     60      12
        1       KBD             Embedded        Yes     60      1
        2       COM1            Embedded        Yes     3f8     4
        3       COM2            Embedded        Yes     2f8     3
        4       LPT1            Embedded        Yes     3bc     7
        5       FLOPPY          Embedded        Yes     3f0     6       2

[note in fact, multia's don't have any ISA slots.  Just one PCI.]

>>> boot -file "netbsd_nfs"
(boot dka0.0.0.6.0 -file netbsd_nfs -flags a)
block 0 of dka0.0.0.6.0 is a valid boot block
reading 16 blocks from dka0.0.0.6.0
bootstrap code read in
base = 158000, image_start = 0, image_bytes = 2000
initializing HWRPB at 2000
initializing page table at 14a000
initializing machine state
setting affinity to the primary CPU
jumping to bootstrap code

Digital UNIX boot - Sun May 19 23:29:33 EDT 1996

Loading netbsd_nfs ...
Loading at fffffc0000230000
Current PAL Revision <0x1000000010535>
Switching to OSF PALcode Succeeded
New PAL Revision <0x100000002012d>

Sizes:
text = 1424528
data = 136896
bss  = 90704
Starting at 0xfffffc0000230000

constype = (null)
ctb->ctb_term_type = 0x2
ctb->ctb_turboslot = 0x10000
sCopyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.

NetBSD 1.1B (GENERIC_NFS) #24: Fri Jun  5 12:24:06 PDT 1970
    thomas@eunics.lkg.dec.com:/usr/src/sys/arch/alpha/compile/GENERIC_NFS
Alpha PC AXPpci33 ("NoName"), 166MHz
8192 byte page size, 1 processor.
real mem = 33554432 (2367488 reserved for PROM, 31186944 used by NetBSD)
avail mem = 25001984
using 203 buffers containing 1662976 bytes of memory
mainbus0 (root)
cpu0 at mainbus0: 21066/21068 (LCA4), UNKNOWN MINOR TYPE (2)
cpu0: VAX FP support, IEEE FP support, Primary Eligible
lca0 at mainbus0
pci0 at lca0 bus 0
ncr0 at pci0 dev 6 function 0: NCR 53c810 SCSI
ncr0: interrupting at ISA irq 11
ncr0: restart (scsi reset).
scsibus0 at ncr0
sd0 at scsibus0 targ 0 lun 0: <TOSHIBA, MK2326FB, A15B> SCSI1 0/direct fixed
sd0: 324MB, 969 cyl, 14 head, 49 sec, 512 bytes/sec
sio0 at pci0 dev 7 function 0: Intel 82378IB PCI-ISA Bridge (System I/O) (rev. 
0x03)
isa0 at sio0
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
intr_establish: irq 4: warning: using edge-triggered on level-triggered
com0: console
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
intr_establish: irq 3: warning: using edge-triggered on level-triggered
lpt0 at isa0 port 0x3bc-0x3c3 irq 7
pcprobe: reset error 1
pckbd0 at isa0 irq 1
mcclock0 at isa0 port 0x70-0x71: mc146818 or compatible
de0 at pci0 dev 8 function 0 at ISA irq 10
de0: DC21040 [10Mb/s] pass 2.3
de0: address 08:00:2b:e4:0a:89
de0: enabling BNC/AUI port
tga0 at pci0 dev 11 function 0: DC21030 step B, board type T8-02
tga0: 1024 x 768, 8bpp, Bt485 RAMDAC
tga0: interrupting at ISA irq 15
wscons0 at tga0
nfs_boot: using network interface 'de0'
nfs_boot: client_addr=0x101478ca
nfs_boot: server_addr=0x101478a0
nfs_boot: hostname=alphy
root on grep:/netbsd/clients/alphy/root
root time: 0x31b5df3e
swap on grep:/netbsd/clients/alphy/swap
swap size: 0xfa00 (blocks)
init: copying out flags `-s' 3
init: copying out path `/sbin/init' 11
Enter pathname of shell or RETURN for sh: 
#

I don't claim that the following diffs are the right fix.  I just know it
did allow the multia to boot (the serial console seems to work just fine
too).

--- sio_pic.c.orig	Wed Jun  5 12:40:37 1996
+++ sio_pic.c.new	Wed Jun  5 12:39:26 1996
@@ -114,6 +114,12 @@
 #define	INITIALLY_LEVEL_TRIGGERED(irq)	0
 #endif
 
+#define	isa_intrsharetype_name(n) \
+	(n == IST_EDGE ? "edge-triggered" : \
+		(n == IST_LEVEL ? "level-triggered" : \
+			(n == IST_PULSE ? "pulse-triggered" : \
+				(n == IST_NONE ? "none" : "unknown-type"))))
+
 void
 sio_setirqstat(irq, enabled, type)
 	int irq, enabled;
@@ -123,8 +129,8 @@
 	int icu, bit;
 
 #if 0
-	printf("sio_setirqstat: irq %d, %s, %s\n", irq,
-	    enabled ? "enabled" : "disabled", isa_intr_typename(type));
+	printf("sio_setirqstat: irq %d: %s, %s\n", irq,
+	    enabled ? "enabled" : "disabled", isa_intrsharetype_name(type));
 #endif
 
 	sio_intrsharetype[irq] = type;
@@ -170,10 +176,10 @@
 	    (ocw1[1] & ~initial_ocw1[1]) != 0 ||
 	    (elcr[0] & initial_elcr[0]) != initial_elcr[0] ||
 	    (elcr[1] & initial_elcr[1]) != initial_elcr[1]) {
-		printf("sio_sis: initial: ocw = (%2x,%2x), elcr = (%2x,%2X)\n",
+		printf("sio_sis: initial: ocw = (%2x,%2x), elcr = (%2x,%2x)\n",
 		    initial_ocw1[0], initial_ocw1[1],
 		    initial_elcr[0], initial_elcr[1]);
-		printf("         current: ocw = (%2x,%2x), elcr = (%2x,%2X)\n",
+		printf("         current: ocw = (%2x,%2x), elcr = (%2x,%2x)\n",
 		    ocw1[0], ocw1[1], elcr[0], elcr[1]);
 		panic("sio_setirqstat: hosed");
 	}
@@ -299,10 +305,20 @@
 		if (type != IST_NONE)
 #if 0 /* XXX */
 			panic("intr_establish: can't share %s with %s",
-			    isa_intrsharetype_name(sio_intrsharetype[irq]),
-			    isa_intrsharetype_name(type));
+			    isa_intrsharetype_name(type),
+			    isa_intrsharetype_name(sio_intrsharetype[irq]));
 #else /* XXX */
-/* XXX */		panic("foo XXX");
+			if (sio_intrhand[irq] == NULL) {
+				printf("intr_establish: irq %d: warning: using %s on %s\n",
+				    irq,
+				    isa_intrsharetype_name(type),
+				    isa_intrsharetype_name(sio_intrsharetype[irq]));
+				type = sio_intrsharetype[irq];
+			} else
+				panic("intr_establish: irq %d: can't share %s with %s",
+				    irq,
+				    isa_intrsharetype_name(type),
+				    isa_intrsharetype_name(sio_intrsharetype[irq]));
 #endif /* XXX */
 		break;
         }

-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt.html
Westford, MA              Disclaimer: I disavow all knowledge of this message