Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Oct 1998 09:53:44 -0700
From:      Amancio Hasty <hasty@rah.star-gate.com>
To:        Etienne de Bruin <Etienne.Debruin@KryptoKom.DE>, freebsd-hackers@FreeBSD.ORG (Hackers FreeBSD)
Subject:   Re: BMaster Examples 
Message-ID:  <199810231653.JAA02207@rah.star-gate.com>
In-Reply-To: Your message of "Fri, 23 Oct 1998 09:27:32 PDT." <199810231627.JAA03120@dingo.cdrom.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

PCI bus mastering is different than ISA DMA in which there is 
a standard way of doing dma transfer, for PCI devices bus transfer
is device specific.  I realize that device specific is vague so 
let me give you a short example from the Bt848 driver:

      /* sync vre IRQ bit */
        *dma_prog++ = OP_SYNC |  1 << 24 | 1 << 15 | BKTR_VRE;
        *dma_prog++ = 0;  /* NULL WORD */
        *dma_prog++ = OP_JUMP ;
        *dma_prog++ = (u_long ) vtophys(bktr->dma_prog) ;

The bt848 reads a dma program from the host memory and then it executes
a series of micro instructions. There is a register bit which one sets
to start or stop reading the host program and another register to load
the starting address of the RISC program. Needless to say 
that just about every PCI device does dma differently.

	Cheers,
	Amancio


> > i need code examples of bus mastering being implemented in pci device
> > drivers.
> 
> As has already been explained to you, bus mastering for PCI devices is 
> almost entirely specific to the device in question.  You will have to 
> consult the documentation for this device, and then look at almost any 
> of the PCI drivers, as most of them use the device's busmaster support.
> 
> -- 
> \\  Sometimes you're ahead,       \\  Mike Smith
> \\  sometimes you're behind.      \\  mike@smith.net.au
> \\  The race is long, and in the  \\  msmith@freebsd.org
> \\  end it's only with yourself.  \\  msmith@cdrom.com
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
> 



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?199810231653.JAA02207>