Skip to contentSkip to conversation

DeviceTree FPGA bitstream

DISCUSSION Federico Vaga 2 participants 3 messages Jun 9, 2015 – Jun 15, 2015 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hello,

I'm evaluating the DeviceTree to describe the content of an FPGA. I noticed that Xilinx is already doing it:

https://www.kernel.org/doc/Documentation/devicetree/bindings/xilinx.txt

I admit that I didn't read the code yet, but before doing it I want to ask you some simple questions that may save me a lot of time. My questions are:

- is there any reccomandation about DeviceTree for FPGA content description? If yes, are they documented somewhere?

- it looks like the DeviceTree is disable for x86 architecture except for some specific platform. Is it possible to enable it for the entire x86 architecture? Are there any reason to disable it by default?

- I read that since versione 3.17 it should be possible to dynamically add portion of DeviceTree from configfs. Is it possible on all architecture?

- I'm working on x86_64 and my FPGA can be on a pluggable board (e.g. PCIe). Is there a way to describe this situation with DeviceTree? Is there any tool that dynamically computes the addresses (interrupts) translation to use (e.g. on PCIe) ?

Thank you :)
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to a message not in the archive

Hi Federico,

Quoted 7 lines · Federico Vaga

Hello,

I'm evaluating the DeviceTree to describe the content of an FPGA. I noticed that Xilinx is already doing it:

https://www.kernel.org/doc/Documentation/devicetree/bindings/xilinx.txt

So is Altera, both for the Nios2 and arm-soc architectures. They're using this tool: https://github.com/wgoossens/sopc2dts to go from their design software (qsys) to a dts file.

Quoted 8 lines

I admit that I didn't read the code yet, but before doing it I want to ask you some simple questions that may save me a lot of time. My questions are:

- is there any reccomandation about DeviceTree for FPGA content description?
If yes, are they documented somewhere?

FPGA's are just like other "hardware" from the device-tree point of view. If there's a UART in your FPGA, then you describe a UART in the devicetree :)

For Altera FPGA's some info is described here:
http://rocketboards.org/foswiki/Documentation/DeviceTreeGenerator141 and I think the xilinx flow is similar.

Quoted 8 lines

- it looks like the DeviceTree is disable for x86 architecture except for some specific platform. Is it possible to enable it for the entire x86 architecture? Are there any reason to disable it by default?

- I read that since versione 3.17 it should be possible to dynamically add
portion of DeviceTree from configfs. Is it possible on all architecture?

Quoted 7 lines

- I'm working on x86_64 and my FPGA can be on a pluggable board (e.g. PCIe).
Is there a way to describe this situation with DeviceTree? Is there any tool
that dynamically computes the addresses (interrupts) translation to use (e.g. on PCIe) ?

I've been using this scheme on PPC for quite some time (before devicetree overlays) by creating a custom pcie driver (that knows the bar addresses and irqs) which then instantiates a "virtual platformbus" at the pcie bar the fpga is located in.
You can adopt this scheme for x86 by creating a bus and using the devicetree code to probe the inside of your FPGA but this is all a bit hackish.
The correct approach (in my opinion) would be to use an overlay describing the contents of the FPGA and loading that when probing the pcie-device. This would however require a base devicetree to apply the overlay to, and I'm not sure how much effort this is going to be on x86_64

Walter

Quoted 6 lines

Thank you :)

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to a message not in the archive

Hi Walter,

Quoted 17 lines · Walter Goossens
Quoted 8 lines · Federico Vaga

- it looks like the DeviceTree is disable for x86 architecture except for some specific platform. Is it possible to enable it for the entire x86 architecture? Are there any reason to disable it by default?

- I read that since versione 3.17 it should be possible to dynamically add
portion of DeviceTree from configfs. Is it possible on all architecture?

Quoted 7 lines

- I'm working on x86_64 and my FPGA can be on a pluggable board (e.g. PCIe).
Is there a way to describe this situation with DeviceTree? Is there any tool
that dynamically computes the addresses (interrupts) translation to use (e.g. on PCIe) ?

Quoted 10 lines

I've been using this scheme on PPC for quite some time (before devicetree overlays) by creating a custom pcie driver (that knows the bar addresses and irqs) which then instantiates a "virtual platformbus" at the pcie bar the fpga is located in.
You can adopt this scheme for x86 by creating a bus and using the devicetree code to probe the inside of your FPGA but this is all a bit hackish.
The correct approach (in my opinion) would be to use an overlay describing the contents of the FPGA and loading that when probing the pcie-device.

This is more or less what I thought

Quoted 2 lines

This would however require a base devicetree to apply the overlay to, and I'm not sure how much effort this is going to be on x86_64

Not sure but I fear that is not enough to make it stable. The compilation of the DeviceTree is allowed only on x86 and on some specific platform.

Of course, I can modify the Kconfig to allow the compilation of the DeviceTree but then I don't know if it will work and how it will work. I mean are there particular reasons to keep the DeviceTree away from x86 ? --
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html