Re: feeding a FIFO from PCI



On Mon, 14 Apr 2008 23:05:17 -0500, James Waldby <no@xxxxx> wrote:

On Sat, 12 Apr 2008 09:38:30 -0700, John Larkin wrote:
[re "box that will control a scientific gadget" possibly using "an
Intel-cpu SBC and a custom board" where "SBC would talk gigabit
ethernet to the customer's system and PCI to our board." with SBC
like http://us.kontron.com/index.php?id=226&cat=527&productid=1726

Our board would have a PCI interface driving a biggish FIFO, say 8k deep
by 48 bits wide, inside an FPGA. [...]
OK, we finally get to a question: If we run some flavor of Linux on the
SBC, what's a good strategy for keeping the fifo loaded? Assuming that
we have the recipe for an entire experimental shot in program ram, some
tens of megabytes maybe, we could...
...
3. Best, if possible: set up a single DMA transfer to do the entire
shot. That involves a dma controller that understands that the target is
sometimes busy [...]

If the linux kernel is given a "mem=n" parameter at boot time, it will use
only n bytes of memory, which leaves the balance of memory to be contiguously
allocated later with "dmabuf = ioremap(...)" (see "Allocating the DMA Buffer"
and "Do-it-yourself allocation" in Chap. 13 of Linux Device Drivers, by
Rubini and Corbet; eg http://www.xml.com/ldd/chapter/book/ch13.html .)

If high memory isn't usable by the DMA controller, you could build a
kernel with your device driver using preallocated fixed buffers,
rather than loading the driver as a module.

User code can access the buffer as a memory-mapped file; see
eg http://www.scs.ch/~frey/linux/memorymap.html for background, and see
eg http://linux.die.net/man/2/mmap for notes on some flags that can lock
the mapped pages in memory, make them private, map to fixed location, etc.

4. If it's a dual-core cpu, is it hard (under Linux) to assign one cpu
to just do the fifo transfers?

Root can use cpusets, described at http://lwn.net/Articles/127936/
to allocate cpu's and memory nodes, or can use system calls as
described in http://linux.die.net/man/2/sched_setaffinity to
control which cpu's given processes will run on.

Good stuff. Thanks.

Oh, Kontron assures us that the PCI connector on their sbc can run at
full 33 MHz, and doesn't share bandwidth with anything else, including
the Ethernet ports.

John


.



Relevant Pages

  • Re: feeding a FIFO from PCI
    ... Intel-cpu SBC and a custom board" where "SBC would talk gigabit ... That involves a dma controller that understands that the target is ... only n bytes of memory, which leaves the balance of memory to be contiguously ...
    (sci.electronics.design)
  • Re: feeding a FIFO from PCI
    ... Intel-cpu SBC and a custom board" where "SBC would talk gigabit ... only n bytes of memory, which leaves the balance of memory to be contiguously ... Kontron assures us that the PCI connector on their sbc can run at ... the digital I/O mode seem just like what you want. ...
    (sci.electronics.design)
  • PCI Driver Read in Linux
    ... I have SBC 104+ which has installed White Dwarf Linux. ... I want to read external data of DSP Board from SBC using PCI Slot. ... White Dwarf linux has already written PCI Device Driver. ...
    (comp.os.linux.embedded)
  • Newbie - SBC dsl
    ... Have ordered dsl from SBC & ordered the wireless networking kit. ... ethernet card so I am assuming that it can't be networked unless one is ... What are the pro's -- con's of installing SBC's software? ...
    (comp.dcom.xdsl)
  • Re: PCI Design
    ... motherboard and with a Single Board Computer? ... in one project that allows a standard form PCI card to be ... I've also developed a PC104+ board that an SBC ...
    (comp.arch.fpga)