Date: Wed, 7 Apr 2004 23:19:53 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Michael Wang <mwang@unixlabplus.com> Cc: freebsd-hardware@FreeBSD.org Subject: Re: 4.9-R panic with Lava DSerial-PCI 3.3v and device puc Message-ID: <20040407222807.Y11144@gamplex.bde.org> In-Reply-To: <20040407042821.GB1060@unixlabplus.com> References: <20040407042821.GB1060@unixlabplus.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 7 Apr 2004, Michael Wang wrote: > I posted it in freebsd-questions, but no response. I try > my luck here. This hardware is supported, but it panics. > .... > (1) > > without "device puc", upon boot, I have > > pcib3: <Host to PCI bridge> on motherboard > pci3: <PCI bus> on pcib3 > pci3: <unknown card> (vendor=0x1407, dev=0x0110) at 6.0 irq 0 > pci3: <unknown card> (vendor=0x1407, dev=0x0111) at 6.1 irq 0 > pcib4: <Host to PCI bridge> on motherboard > pci4: <PCI bus> on pcib4 irq 0 is from the card's PCI registers. The irq should be nonzero here. This is hard to recover from, and FreeBSD-4.9 apparently doesn't manage to figure out the actual irq. Look at BIOS boot messages to see if the BIOS prints a useable irq number. My guess is that it doesn't. > pciconf -lv shows: > > none1@pci3:6:0: class=0x070002 card=0x01101407 chip=0x01101407 rev=0x00 hdr=0x00 > vendor = 'Lava Computer Manufacturing Inc' > device = 'Lava DSerial PCI Port A' > class = simple comms > subclass = UART > none2@pci3:6:1: class=0x070002 card=0x01111407 chip=0x01111407 rev=0x00 hdr=0x00 > vendor = 'Lava Computer Manufacturing Inc' > device = 'Lava DSerial PCI Port B' > class = simple comms > subclass = UART Also look at boot -v messages. > > (2) > after adding > options COM_MULTIPORT > device puc > device sio > > I have the following upon boot. Please note "irq 0". Leave out COM_MULTIPORT (it is for old isa multiport cards). Otherwise, this is the correct (software) configuration, but it won't work if the irq ends up being 0. > > pcib3: <Host to PCI bridge> on motherboard > pci3: <PCI bus> on pcib3 > puc0: <Lava Computers serial port> irq 0 at device 6.0 on pci3 > pci_cfgintr_virgin: using routable interrupt 4 > kernel trap 12 with interrupts disabled > > > Fatal trap 12: page fault while in kernel mode > fault virtual address = 0xbc7c > fault code = supervisor read, page not present > instruction pointer = 0x8:0xc00fcd24 > stack pointer = 0x10:0xc057cd94 > frame pointer = 0x10:0xc057ce04 > code segment = base 0x0, limit 0xfffff, type 0x1b > = DPL 0, pres 1, def32 1, gran 1 > processor eflags = resume, IOPL = 0 > current process = 0 (swapper) > interrupt mask = net tty bio cam > kernel: type 12 trap, code=0 > Stopped at 0xc00fcd24: movb %cs:0xbc7c,%al > db> trace > kernbase(40a,c057ce44,c032cc03,c318f180,c057ce44) at 0xc00fcd24 The instruction pointer is in the ROM BIOS. This seems to be from a vm86 call. "trace" doesn't work for (traps in) vm86 calls because it doesn't understand the stack frame. Apparently pci interrupt initialization made a bad vm86 call because it doesn't understand irq 0. > > General questions: > > >From various documentation: > > " > options "COM_MULTIPORT" > device sio4 at isa? port 0x2a0 tty flags 0x781 > device sio5 at isa? port 0x2a8 tty flags 0x781 > device sio6 at isa? port 0x2b0 tty flags 0x781 > device sio7 at isa? port 0x2b8 tty flags 0x781 irq 7 vector siointr > " sio(4) is unfortunately out of date. It doesn't even mention puc(4). The above is essentially only for isa cards. However, if you know the i/o addresses (and the irq!) then you can handle many pci sio cards by pretending that you have and isa card and specifying the addresses as above (but more correctly). > My questions are: > > (3a) My device is PCI device, should I use isa? No. > Why all documentation on sio uses isa? It's out of date in RELENG_4 :-(. -current is a bit better. It says to just use "device sio" for pci cards. It doesn't say that "device puc" is also needed for most pci cards. The addresses don't need to be specified for pci if you have a supported card. However, if you have an unsupported card, then specifying the addresses is even harder -- you must determine the pci BARs and other pci magic for the card and enter them in pucdata.c. This is not the problem here, since the Lava card is supported. > (3b) How do I know the port number? minor number? irq? For isa cards and pci cards fudged as isa cards, the port address is wherever it is; then minor number is whatever you want (but must be between 0 and 31), and the irq is wherever it is. isa port addresses and irq numbers are normally fixed or statically configured using jumpers, DIP switches or BIOS setup. pci port addresses and irq numbers are mostly dynamically configured (PCI slot numbers often affect the irq, and some BIOS setups/hardware support programming specific irq numbers). Normally they don't change unless the hardware changes. To fudge a pci device as an isa one, first determine these values. You already know the (wrong) irq number. If nothing dynamically allocates the irq then there won't by a correct one. Similarly for the port address. The port addresses would be printed by the probe if it didn't crash. They can be determined by looking at the card's pci registers (pciconf -lv doesn't know quite enough to show them). However, if nothing dynamically allocates them, then they may be 0 like the irq. > And what is "vector siointr"? Looks like "tty", and "vector siointr" > are illegal in 4.9-R. See the 4.x man page for sio. These went away long ago, and the man page is not out of date enough to mention them. > > (3c) I have Lava DSerial-PCI 3.3v, should I use this? > > options "COM_MULTIPORT" > device puc > device sio4 at isa? port 0x2a0 flags 0x581 > device sio5 at isa? port 0x2a8 flags 0x581 irq 11 Not except as a hack; see above. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040407222807.Y11144>