Forum Discussion
dpeng
Occasional Contributor
1 year agoenable bridge crashes Linux
Hi, We selected a Cyclone V SoC FPGA for our project. I started on Terasic demo boards (DE0 and ADC-SoC). On these boards, that both bear a Cyclone V (P/N 5CSEMA4U23C6N), I could, with a devicetree ...
- 11 months ago
So, I think I made some progress.
- I enable the bridges in Barebox by setting the status and bridge-enable properties.
- In the Linux devicetree overlay, I only set the status property, not the bridge-enable property.
The Barebox DT (the "0x1" syntax matters, it seems):
&fpga_bridge0 { status = "okay"; bridge-enable = <0x1>; };The Linux DT overlay:
/dts-v1/; /plugin/; / { fragment@0 { target = <&base_fpga_region>; __overlay__ { #address-cells = <0x1>; #size-cells = <0x1>; // The .rbf file must be placed in /lib/firmware firmware-name = "soc_firwmare.rbf"; fpga-bridges = <&fpga_bridge0 &fpga_bridge1>; }; }; /* Enable the lightweight FPGA to HPS bridge (lwhps2fpga) */ fragment@1 { target = <&fpga_bridge0>; __overlay__ { status = "okay"; // Don't set bridge-enable! // bridge-enable = <1>; }; }; /* Enable the HPS to FPGA bridge (hps2fpga) */ fragment@2 { target = <&fpga_bridge1>; __overlay__ { status = "okay"; // Don't set bridge-enable! // bridge-enable = <1>; }; }; };Then, I when I check the status of the bridges, I get what I expect:
# for f in /proc/device-tree/soc/fpga?bridge*; do echo $(basename $f)":" $(cat $f/status); done fpga-bridge@ff600000: disabled fpga-bridge@ffc25080: disabled fpga_bridge@ff400000: okay fpga_bridge@ff500000: okay #I didn't try to communicate between the HPS and the FPGA yet, but it looks promising.
dpeng
Occasional Contributor
1 year ago@JitLoonL_Altera, I enabled the bridge driver in Barebox:
CONFIG_FPGA=y CONFIG_FPGA_BRIDGE=y CONFIG_SOCFPGA_FPGA_BRIDGE=y
And the bridge in Barebox:
&fpga_bridge0 {
status = "okay";
bridge-enable = <0x1>;
};Barebox boot log (note the "altera-hps2fpga-bridge" lines):
barebox 2025.07.0 #2 Thu Aug 28 15:09:04 CEST 2025 Board: Enclustra Mercury+ SA2 netconsole: registered as netconsole-1 altera-hps2fpga-bridge [email protected]: enabling bridge altera-hps2fpga-bridge [email protected]: fpga bridge [lwhps2fpga] registered socfpga_designware_eth [email protected]: user ID: 0x10, Synopsys ID: 0x37 mdio_bus: miibus0: probed dw_mmc [email protected]: registered as mmc0 cadence_qspi [email protected]: couldn't determine block-size cadence_qspi [email protected]: probing for flashchip failed cadence_qspi [email protected]: Cadence QSPI NOR probe failed malloc space: 0x1ff00000 -> 0x3fdfffff (size 511 MiB) mmc0: detected SD card version 2.0 mmc0: registered mmc0 eth0: got preset MAC address: 20:b0:f7:0a:6c:08 Hit any to stop autoboot: 1 barebox@Enclustra Mercury+ SA2:/
But the system still hangs when I apply the DT overlay.