From owner-freebsd-hackers Tue Apr 11 21:38:26 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mass.cdrom.com (adsl-63-193-112-57.dsl.snfc21.pacbell.net [63.193.112.57]) by hub.freebsd.org (Postfix) with ESMTP id 7369E37BC50 for ; Tue, 11 Apr 2000 21:38:23 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Received: from mass.cdrom.com (localhost [127.0.0.1]) by mass.cdrom.com (8.9.3/8.9.3) with ESMTP id VAA00544; Tue, 11 Apr 2000 21:44:10 -0700 (PDT) (envelope-from msmith@mass.cdrom.com) Message-Id: <200004120444.VAA00544@mass.cdrom.com> X-Mailer: exmh version 2.1.1 10/15/1999 To: Warner Losh Cc: freebsd-hackers@freebsd.org Subject: Re: PCI DMA Questions In-reply-to: Your message of "Tue, 11 Apr 2000 21:57:35 MDT." <200004120357.VAA34787@harmony.village.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 11 Apr 2000 21:44:10 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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