On Jun 18, 2005, at 9:58 AM, Timothy Legge wrote:
> Krzysztof Lichota wrote:
>> Victory! :)
>> I suspected a problem with interrupts and it was it!
>> I looked into AMD specs for the chip, added code to disable
>> interrupts and it worked :) I am able to boot into LTSP up to XDM
>> login screen :)
>> Patch attached. It is a bit verbose, but probably it has to be
>> changed anyway as I don't know if it does not spoil something for
>> other chips
>> ...
>> + //disable interrupts
>> + val = lp->a.read_csr(ioaddr, 3);
>> + val = val
>> + | (1 << 14) //BABLM intr disabled
>> + | (1 << 12) //MISSM missed frame mask intr disabled
>> + | (1 << 10) //RINTM receive intr disabled
>> + | (1 << 9) //TINTM transmit intr disabled
>> + | (1 << 8) //IDONM init done intr disabled
>> + ;
>> + lp->a.write_csr(ioaddr, 3, val);
>
> Can you verify whether a subset of the interupts would also work? I
> would be particularily interested in the whether leaving the receive
> interrupt RINTM enabled would be OK. The receive interruupt would
> need to be in place if the driver gets PXE enabled.
I believe that those bits must remain masked (all interrupts from the
NIC turned OFF) unless the PXE code decides to have us run in interrupt
mode. The reason for the crashing is probably that a packet got
received and an interrupt got generated that we were not ready to
handle (or we transmitted, and got a transmit_done interrupt that was
not handled).
Using the rtl8139.c driver as an example, note the following in the
rtl_reset function:
/* Disable all known interrupts by setting the interrupt mask.
*/
outw(0, nic->ioaddr + IntrMask);
In every driver, the first thing we do is to disable all interrupts
from the NIC, because normally Etherboot runs in polled mode, and if
the NIC generates an interrupt, we (the non-PXE part of Etherboot) have
no idea what to do with it, because no routine has been installed to
handle the interrupt.
Note also that there is an rtl_irq routine that exists so that the pxe
code can enable the interrupts if (and only if) needed:
case ENABLE :
mask = inw(nic->ioaddr + IntrMask);
mask = mask & ~interested;
if ( action == ENABLE ) mask = mask | interested;
outw(mask, nic->ioaddr + IntrMask);
break;
So, many thanks to Krzystof for finding this bug. It's nice to have
another working driver.
If you're in the mood, and would like to help a bit more, you could
read the file src/README.pixify, which describes how to modify the
driver source so that we can actually deal with interrupts. You can
use rtl8139.c as an example.
This discussion should probably migrate to Etherboot-Developers, and
people interested in things like this (and who wouldn't be?? :) are
welcome to subscribe to Etherboot-Developers using the following link:
http://lists.sourceforge.net/lists/listinfo/etherboot-developers
We'd enjoy your company.
Marty
--
Try: http://rom-o-matic.net/ to make Etherboot images instantly.
Name: Marty Connor
US Mail: Entity Cyber, Inc.; P.O. Box 391827;
Cambridge, MA 02139; USA
Voice: (617) 491-6935; Fax: (617) 491-7046
Email: md...@et...
Web: http://www.etherboot.org/
|