04-12-2013 05:00 PM
I'm designing a PCIe card.
Basically, I have sixteen Rx/Tx lines that I want to expose to the Linux kernel as /dev/ttyS0, /dev/ttyS1, /dev/ttyS2, ... , /dev/ttyS15
Here's some similar hardware that I want to re-create:
What is the best way to go about doing this?
Many thanks in advance,
04-13-2013 12:21 AM
That should be fairly simple - just use an FPGA with a PCIe transciever (e.g. the XC6SLX25T) and a bunch of appropriate level translators so that you can comply with the RS-232 voltage standard.
The only mildly complex bit will be the HDL and Linux driver.
04-13-2013 03:16 AM
Many thanks for your very helpful reply.
I'm glad to hear this is "fairly simple" (to you maybe!) I'm very inexperienced with FPGA design.
I'm going to buy a PCI-e board. I only have a Digilent Altys Spartan 6 board (no PCI-e). Do you think this one would be suitable? http://www.mesanet.com/fpgacardinfo.html (Search for 6I25)
I understand I'll have 16 Tx pins and 16 Rx pins going into my FPGA (9600 baud). Then I'll have the PCI-e interface pins and I'm guessing I'll only need to use one transmit lane (i.e. PCI-e x1). I think I can do this bit.
However, I don't really have any idea how to present these Rx/Tx lines to the Linux kernel. I was wondering if you knew where I might start my research? For every one of my PCI-e boards plugged into the motherboard, 16 new /dev/ttySx's should appear.
I will eventually have a 46U cabinet full of these PCI-e cards (http://www.magma.com/expressbox-16-basic -- 16 PCI-e cards in each 4U), so I need to get it right!
Many thanks again,
04-15-2013 09:32 PM
Yes, that Mesa board looks okay and it's pretty inexpensive.
Have a look at the Linux kernel source to see if there are any existing drivers for PCI-e serial cards. I'm sure there are some!
04-15-2013 09:53 PM
Just one thing to be aware of, it looks like the FPGA on the 6I25 is a Spartan-6 LX-9 in a QFP package. That doesn't have a PCIe interface built-in, so presumably there is a interface chip of some sort (PCIe to PCI converter?) connecting to the PCIe.
It shouldn't stop you from doing what you need, but obviously you'll need to take it into account - e.g., will the bridge chip be flexible enough to allow you to emulate standard 16550 UARTs with standard kernel drivers or will you need to do something custom on the kernel side.
04-15-2013 09:57 PM
Good point - according to the manual there is some sort of PCIe-PCI bridge. If I were designing your product I'd be inclined to just use Spartan-6 with the PCIe interface (the bridge will introduct other complications).
For development I'd just get something like the Xilinx SP605. It's not too expensive, relatively, and it has plenty of other goodies.