> 
> It wasn't that simple. The PnP / PCI enumeration needs to be done
> completely by the running OS to make things work.
> 
> But I thought that Linux did do PnP / PCI enumeration ? In that case a
> interrupt should be assigned.

Well - I stuck some printk's in to see what was happening.
When pci.c starts up, if finds the USB controller. The interrupt
pin register is set to 4, the interrupt line register is set to
0xff. 

Based on the comment re FreeBSD and for a laugh, I hacked in some code
to load the interrupt line register to various values of unused
interrupts - 4, 5, 7 and 11 during pci.c's intitialisation. I also
tried 9 to see what it would do, as at least 2 other PCI devices had
their interrupt registers set to 9 as well, with the interrupt pin
register containing 1 or 2. Interrupt 9 is what Windows claims the IRQ
is when I used Device Mangler to see what it has to say.

Using 4, 5, 7 or 11 the kernel boots, recognizes the USB controller
and shortly thereafter reports that it's found an additional USB
device. It then reports a block transfer timeout and shuts down the
USB system. By the time you get to the login prompt, it appears USB is
gone - /proc/bus/usb is empty. I don't know if it ever had anything. 

Setting it to 9 causes the system to lock solid - the sysreq key has
no effect, only removing the batteries and disconnecting the mains
supply gets control back, but no real damage seems to be done - an fsck
later (with a different kernel) and all is well.

I'm guessing - I don't really know either PCI controllers or USB
controllers - that the timeouts may be related to lack of a working
interrupt line. I get the same effect with a kernel using uhci.c or
usb-uhci.c. 

At a guess, either the USB chip needs to be programmed to generate
interrupt requests on a different pin (assuming thats what the
register is telling me) or the PCI chip needs to map that pin to a
different interrupt request line on the 8259 (alike) interrupt
controller. 

Or it's possible that a lot more initialization is needed of the USB
controller chip. I don't have the chip IDs to hand, the machine's at
home, but I can get them.

I don't suppose anyone has machine readable hardware manuals for the
PCI controller and the USB controller? :-)

Or does anyone know how I can read the full register set from the USB
controller when it's set up under Windows, without requiring any kind
of Windows dev kits (I will *never* pay for another MS compiler or
debugger again, many times bitten many times shy).

Or any other suggestions?
 
> > It's PIIX4 and ()someone else said it) the BIOS is broken, so in
> > FreeBSD we have to set the IRQ ourselves. :-(
> > ========================================
> > 
> > Which leads to the question - I don't see this in the FreeBSD 3.2
> > Release code, so does anyone know if there is sample code for this
> > which I could hack into the Linux support?


-- 
Jim Segrave           [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to