Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Apr 2000 21:44:10 -0700
From:      Mike Smith <msmith@freebsd.org>
To:        Warner Losh <imp@village.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: PCI DMA Questions 
Message-ID:  <200004120444.VAA00544@mass.cdrom.com>
In-Reply-To: Your message of "Tue, 11 Apr 2000 21:57:35 MDT." <200004120357.VAA34787@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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,  \\  msmith@freebsd.org
\\ and he'll hate you for a lifetime.             \\  msmith@cdrom.com




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004120444.VAA00544>