> 
> I'm debugging a hunk of PCI hardware that I have under NDA.  It
> doesn't seem to be initiating DMA transfers.  This may be a hardware
> problem, but before I go back to the vendor, I want to make sure that
> I'm doing the DMA initialization right.  It was my understanding that
> DMA just happened on the PCI bus and nothing special was needed.

Make sure that the busmaster bit is set in the PCI command register:

    /* force the busmaster enable bit on */
    if (!(command & PCIM_CMD_BUSMASTEREN)) {
        device_printf(dev, "busmaster bit not set, enabling\n");
        command |= PCIM_CMD_BUSMASTEREN;
        pci_write_config(dev, PCIR_COMMAND, command, 2);
    }


> Here's what I'm doing in my attach routine.  Most of this code was
> culled from ahc.c and friends.

Not to bounce too much, but you may find the examples in the amr and mlx 
drivers easier to follow (maybe not, too).  I forgot who I stole them 
from though - probably Jonathan's ida code.  This isn't your problem 
though.

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime.             \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to