Skip to contentSkip to conversation

FPGAs and how to program them from kernel

Ksummit-discuss Pavel Machek 11 participants 16 messages Jul 23, 2015 – Aug 4, 2015

lore
Share & tools
lore
#0 lore raw

Hi!

(Please cc me on replies)

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

There are very different requirements for FPGA that implements your SATA controller (so you need it for boot), and one where multiple userland applications directly access FPGA using it for different computations, needing FPGA netlist to be changed based on userspace needs. Yet, it would be nice to come up with single interface that can handle all the different applications, and is suitable for mainline kernel.

People that might be interested:

Michal Simek <[email protected]>
Dinh Nguyen <[email protected]>
<[email protected]>
Steffen Trumtrar <[email protected]>
Marek Vasut <[email protected]>
Alan Cox

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 7 lines · Pavel Machek

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

People that might be interested:

Alan Tull <[email protected]>
Is sending patchsets for this, and would be the primary person to invite for this topic:
http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Yours,
Linus Walleij

#2 lore raw
Quoted 9 lines · Linus Walleij
Quoted 6 lines · Pavel Machek

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

Quoted 6 lines
Quoted 1 line

People that might be interested:

Alan Tull <[email protected]>
Is sending patchsets for this, and would be the primary person to invite for this topic:
http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Actually, I had him in my original email, but without full name.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw
Quoted 12 lines · Pavel Machek
Quoted 11 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

People that might be interested:

Quoted 7 lines
Quoted 4 lines

Alan Tull <[email protected]>
Is sending patchsets for this, and would be the primary person to invite for this topic:
http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Actually, I had him in my original email, but without full name.
Pavel

Do you mean this:

Quoted 1 line · Pavel Machek

Alan Cox

;)

(Happens easily, Linus Torvalds asked me to change my name to avoid confusion...)

Yours,
Linus Walleij

#4 lore raw
Quoted 1 line · Linus Walleij
Quoted 1 line
Quoted 1 line
Quoted 1 line

People that might be interested:

I would be very very interested in the subject matter. Anything that helps creating some abstraction layer that allows the open source development of tools on top.

#5 lore raw
Quoted 4 lines · Christoph Lameter
Quoted 1 line · Linus Walleij
Quoted 1 line
Quoted 1 line
Quoted 1 line

People that might be interested:

Quoted 9 lines

I would be very very interested in the subject matter. Anything that helps creating some abstraction layer that allows the open source development of tools on top.

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

Jason is another person who may be interested in this topic:
Jason Gunthorpe = jgunthorpe at obsidianresearch.com

My work has been to get a uniform API for FPGA programming into the kernel along with an interface for controlling reprogramming. My current patchset separates the two so that if the interface I am proposing doesn't meet somebody's use needs, another interface can be written to use the API functions.

http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Topics that have been discussed in the mailing list could be included here:

* At least two different basic use models:
* FPGA as hardware (containing harware devices that need drivers)
* FPGA as accelerator. If FPGA is an accelerator, it could be allocated in a malloc-like thing - Alan Cox's proposal.
* Device Tree Overlays as an interface in the "FPGA as Hardware" use, where loading an overlay will cause FPGA reconfiguration, bridges getting enabled, and devices being created, drivers probed. The code for accomplishing all this is actually quite small.
* Some use cases are complicated systems that need a lot of userspace to bring things up in a sequenced way (may need another interface with lots of userspace control and FPGA status available to userspace).
* Security issues that arise if FPGA programming can be controlled from userspace.
* How to control the bridges. Some hardware needs the bridges disabled during FPGA programming. How to conceptualize this in the device tree.
* It is likely that these different use cases will best be suited by different interfaces.

Alan Tull

atull at opensource.altera.com is a good email for me for mailing list purposes (to avoid Outlook).

#11 lore raw
In reply to Linus Walleij
Quoted 21 lines · Linus Walleij
Quoted 12 lines · Pavel Machek
Quoted 11 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

People that might be interested:

Quoted 7 lines
Quoted 4 lines

Alan Tull <[email protected]>
Is sending patchsets for this, and would be the primary person to invite for this topic:
http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Actually, I had him in my original email, but without full name.
Pavel

Quoted 7 lines

Do you mean this:

Quoted 1 line · Pavel Machek

Alan Cox

;)

Yes, happens easily, but did not happen this time:

Quoted 4 lines

<[email protected]>
Steffen Trumtrar <[email protected]>
Marek Vasut <[email protected]>
Alan Cox

:-).

Quoted 2 lines

(Happens easily, Linus Torvalds asked me to change my name to avoid confusion...)

Hmm, at one point, I had both real Linus Torvalds and fake Linus Torvalds on the cc list. And fake one tried helping me debugging graphics problems. It was weird.

Pavel

--
(english)
http://www.livejournal.com/~pavelmachek (cesky, pictures)
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

#6 lore raw
In reply to atull
Quoted 40 lines · atull
Quoted 4 lines · Christoph Lameter
Quoted 1 line · Linus Walleij
Quoted 1 line
Quoted 1 line
Quoted 1 line

People that might be interested:

Quoted 9 lines

I would be very very interested in the subject matter. Anything that helps creating some abstraction layer that allows the open source development of tools on top.

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

Jason is another person who may be interested in this topic:
Jason Gunthorpe = jgunthorpe at obsidianresearch.com

My work has been to get a uniform API for FPGA programming into the kernel along with an interface for controlling reprogramming. My current patchset separates the two so that if the interface I am proposing doesn't meet somebody's use needs, another interface can be written to use the API functions.

http://marc.info/?l=linux-kernel&m=143714949226387&w=2

Topics that have been discussed in the mailing list could be included here:

* At least two different basic use models:
* FPGA as hardware (containing harware devices that need drivers)
* FPGA as accelerator. If FPGA is an accelerator, it could be allocated in a malloc-like thing - Alan Cox's proposal.
* Device Tree Overlays as an interface in the "FPGA as Hardware" use, where loading an overlay will cause FPGA reconfiguration, bridges getting enabled, and devices being created, drivers probed. The code for accomplishing all this is actually quite small.
* Some use cases are complicated systems that need a lot of userspace to bring things up in a sequenced way (may need another interface

Quoted 8 lines

with lots of userspace control and FPGA status available to userspace).
* Security issues that arise if FPGA programming can be controlled from userspace.
* How to control the bridges. Some hardware needs the bridges disabled during FPGA programming. How to conceptualize this in the device tree.
* It is likely that these different use cases will best be suited by different interfaces.

user space part is probably the most problematic topic which needs to be discussed.

Thanks,
Michal

Signature · 5 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform
#13 lore raw
In reply to Pavel Machek
Quoted 18 lines · Pavel Machek

Hi!

(Please cc me on replies)

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

There are very different requirements for FPGA that implements your SATA controller (so you need it for boot), and one where multiple userland applications directly access FPGA using it for different computations, needing FPGA netlist to be changed based on userspace needs. Yet, it would be nice to come up with single interface that can handle all the different applications, and is suitable for mainline kernel.

Quoted 9 lines

People that might be interested:

Michal Simek <[email protected]>
Dinh Nguyen <[email protected]>
<[email protected]>
Steffen Trumtrar <[email protected]>
Marek Vasut <[email protected]>
Alan Cox

Definitely add me to that list.

-hpa

#14 lore raw
In reply to Pavel Machek
Quoted 18 lines · On Thursday 23 July 2015 12:57:11 Pavel Machek wrote:

Hi!

(Please cc me on replies)

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

There are very different requirements for FPGA that implements your SATA controller (so you need it for boot), and one where multiple userland applications directly access FPGA using it for different computations, needing FPGA netlist to be changed based on userspace needs. Yet, it would be nice to come up with single interface that can handle all the different applications, and is suitable for mainline kernel.

Quoted 8 lines

People that might be interested:

Michal Simek <[email protected]>
Dinh Nguyen <[email protected]>
<[email protected]>
Steffen Trumtrar <[email protected]>
Marek Vasut <[email protected]>
Alan Cox

I've been working on V4L2 drivers for Xilinx FPGAs and I'm interested in this topic from that point of view. I see interactions with userspace being one of the most complex part, both in terms of triggering the reprogramming operations and handling applications that actively use the FPGA resources.

Signature · 3 lines
Regards,

Laurent Pinchart
#12 lore raw
In reply to Linus Walleij

[cc: CASPER]

Quoted 9 lines · Linus Walleij
Quoted 6 lines · Pavel Machek

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

Quoted 6 lines
Quoted 1 line

People that might be interested:

Alan Tull <[email protected]>
Is sending patchsets for this, and would be the primary person to invite for this topic:
http://marc.info/?l=linux-kernel&m=143714949226387&w=2

I'm adding the CASPER list to see if anyone is interested. CASPER is a big Berkeley-based project that, among other things, designs powerful programmable boards with PowerPC CPUs running Linux and giant FPGAs for signal processing and I/O.

https://casper.berkeley.edu/wiki/ROACH2

I haven't used ROACH2, but I've used ROACH a bunch, and it would be really nice if there was a standard Linux API for dealing with FPGAs.

--Andy

#15 lore raw
In reply to Pavel Machek
Quoted 10 lines · Pavel Machek

Hi!

(Please cc me on replies)

FPGAs are common in embedded systems, where they can provide missing hardware interfaces, directly implement functionality, or provide custom hardware modules. These days they become available for servers, too, where they can act as high-performance co-processors (which are tricky to program).

Quoted 7 lines

There are very different requirements for FPGA that implements your SATA controller (so you need it for boot), and one where multiple userland applications directly access FPGA using it for different computations, needing FPGA netlist to be changed based on userspace needs. Yet, it would be nice to come up with single interface that can handle all the different applications, and is suitable for mainline kernel.

I am interested as well. POWER has this thing called "CAPI" for coherent accelerators which is essentially FPGA based. It allows you to design an FPGA solution that is both cache coherent (ie, can hold cache lines locally) and has an MMU allowing to operate within a user space context.

We have been developing interfaces for that in Linux but mostly as a specific driver, it might be worthwhile seeing whether there are any commonalities.

Ben.

Quoted 11 lines

People that might be interested:

Michal Simek <[email protected]>
Dinh Nguyen <[email protected]>
<[email protected]>
Steffen Trumtrar <[email protected]>
Marek Vasut <[email protected]>
Alan Cox

Pavel

#7 lore raw
In reply to Christoph Lameter
Quoted 7 lines · Christoph Lameter
Quoted 1 line · Linus Walleij
Quoted 1 line
Quoted 1 line
Quoted 1 line

People that might be interested:

I would be very very interested in the subject matter. Anything that helps creating some abstraction layer that allows the open source development of tools on top.

Which tools would be that?

So far we have netlists in .rbf format, and open source code to load them to the FPGA.

Unfortunately, VHDL to .rbf compiler is not open source. (But it would be great to have one). What other tools are important in this area?

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#8 lore raw
Quoted 1 line · Pavel Machek

Which tools would be that?

FPGA firmware upload. Up/down. State determinations etc? Administrative tasks first. Lets do easy low hanging fruit first.

That way one can write scripts / tools to administer FPGAs from different manufacturers with the same commands.

#9 lore raw
Quoted 6 lines · Christoph Lameter
Quoted 1 line · Pavel Machek

Which tools would be that?

FPGA firmware upload. Up/down. State determinations etc? Administrative tasks first. Lets do easy low hanging fruit first.

Exactly what my patchset is intended to do.

Alan Tull

Quoted 9 lines

That way one can write scripts / tools to administer FPGAs from different manufacturers with the same commands.

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

#10 lore raw

I've been working on the patchset for this. I nominate myself.

Alan Tull

Quoted 26 lines · atull
Quoted 6 lines · Christoph Lameter
Quoted 1 line · Pavel Machek

Which tools would be that?

FPGA firmware upload. Up/down. State determinations etc? Administrative tasks first. Lets do easy low hanging fruit first.

Exactly what my patchset is intended to do.

Alan Tull

Quoted 9 lines

That way one can write scripts / tools to administer FPGAs from different manufacturers with the same commands.

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss