/sys/class/fpga-bridge empty?

Hi,

according to tutorials I found, the /sys/class/fpga-bridge directory should contain files (or dirs) that I can use to control the FPGA-to-HPs and HPS-to-FPGA bridges (enable, disable etc.). I built a custom yocto system and I can’t figure out why these files don’t exist on my system.

The board is a De0-Nano-SoC (Atlas) and I used the board-info xml files from the ghrd as I can’t seem to find them anywhere else. I’m using kernel version 4.3 in this build which is configured with the bridges enabled (I think).

I read somewhere that this could be caused by invalid configuration on the MSEL-switches, so I’ve tried some settings there with no success. My device tree looks fine as well (I think). If you need any information or code, please let me know. I can’t seem to find a lot of information on this.

Thanks in advance!

Does dmesg during kernel boot give you any hints? I tried the same thing with the same board, and it complained about not being able to initialize the bridge. Never checked /sys/class/fpga-brigde thou. I picked up somewhere that the 4.2+ linux should not do the bridge initialization. Dunno why and what that means.

For other reasons, I switched back to the kernel version which is bundled with Quartus, and with that it seems to work.

I probably get there when the system I’m working is going to take use of the bridges, but not quite yet. Please keep us on your learnings about thins

I ran dmesg | grep fpga and got the following result, something about resets not being initiated correctly. I added the property it’s complaining about, but hat just produced another message about another missing property.

[ 0.098850] fpga bridge driver [ 0.104671] socfpga-reset ffd05000.rstmgr: /sopc@0/rstmgr@0xffd05000 missing #reset-cells property [ 0.104687] socfpga-reset: probe of ffd05000.rstmgr failed with error -22 [ 0.104981] altera_hps2fpga_bridge sopc@0:fpgabridge@0: Could not get hps2fpga reset control! [ 0.104996] altera_hps2fpga_bridge: probe of sopc@0:fpgabridge@0 failed with error -22 [ 0.105028] altera_hps2fpga_bridge sopc@0:fpgabridge@1: Could not get lwhps2fpga reset control! [ 0.105040] altera_hps2fpga_bridge: probe of sopc@0:fpgabridge@1 failed with error -22 [ 0.105070] altera_hps2fpga_bridge sopc@0:fpgabridge@2: Could not get fpga2hps reset control! [ 0.105083] altera_hps2fpga_bridge: probe of sopc@0:fpgabridge@2 failed with error -22 [ 0.814672] altera_fpga_manager ff706000.fpgamgr: fpga manager [Altera FPGA Manager] registered as minor 0 [ 1.141636] socfpga-dwmac ff702000.ethernet: snps,phy-addr property is deprecated [ 1.149173] socfpga-dwmac ff702000.ethernet: Could not get reset control! [ 1.155937] socfpga-dwmac ff702000.ethernet: No sysmgr-syscon node found [ 1.162637] socfpga-dwmac ff702000.ethernet: Unable to parse OF data

I’m compiling the 4.1 LTSI kernel right now to see if it happens with that as well.

EDIT: No change, fpga_bridge folder is still empty with LTSI kernel.

I just fired up the board with the kernel and OS which i bundled with EDS (under /path/to/altera/embedded/embeddedsw/socfoga/prebuilt_images/). Which is kernel 3.10.31-ltsi

altera_hps2fpga_bridge fpgabridge.2: fpga bridge [hps2fpga] registered as device hps2fpga
altera_hps2fpga_bridge fpgabridge.2: init-val not specified
altera_hps2fpga_bridge fpgabridge.3: fpga bridge [lshps2fpga] registered as device lwhps2fpga
altera_hps2fpga_bridge fpgabridge.3: init-val not specified
altera_hps2fpga_bridge fpgabridge.4: fpga bridge [fpga2hps] registered as device fpga2hps
altera_hps2fpga_bridge fpgabridge.4: init-val not specified

Then I get the missing files.

root@socfpga:/sys/class/fpga-bridge# ls
fpga2hps    hps2fpga    lwhps2fpga

I have used the GHRD image to verify, I get the files there as well. Question is why I’m not getting them with my custom system. I will have a look at the prebuilt images, maybe there’s something I missed.

Did you ever learn why the bridge files were missing and/or what to expect and what to do instead?

I just compiled 4.1.17-ltsi, and I see the same issue as you did.

For me (at least I think that was it, I tried a bunch of stuff so I’m not 100% sure) the device tree was missing all reset-connection (from the rstmgr) which should have been added by the boardinfo files. I added those manually and my files showed up as they should. Maybe there is a complete version of the .xml files out there that I haven’t found?

Hi, I have encountered the same issue - “Could not get reset control!” message for ethernet and “Could not get reset control!” for all 3 bridges (description of similar problem - https://github.com/dwesterg/atlas-soc-ghrd/issues/6).

I solved this issue with modification of hps_common_board_info.xml file - copied several lines from board info file from last CycloneV GHRD:

=====================================================
<DTAppend name="altr,sysmgr-syscon" parentlabel="hps_0_gmac1">
<val type="phandle">hps_0_sysmgr</val>
<val type="hex">0x60</val>
<val type="number">2</val>
</DTAppend>
<DTAppend name="reset-names" type="string" parentlabel="hps_0_gmac1" val="stmmaceth"/>
<DTAppend name="resets" parentlabel="hps_0_gmac1">
<val type="phandle">hps_0_rstmgr</val>
<val type="number">33</val>
</DTAppend>
<DTAppend name="reset-names" type="string" parentlabel="hps_0_gmac1" val="stmmaceth"/>

<DTAppend name="#reset-cells" type="number" parentlabel="hps_0_rstmgr" val="1"/>


<DTAppend name="reset-names" type="string" parentlabel="fpgabridge0" val="hps2fpga"/>
<DTAppend name="resets" parentlabel="fpgabridge0">
<val type="phandle">hps_0_rstmgr</val>
<val type="number">96</val>
</DTAppend>


<DTAppend name="reset-names" type="string" parentlabel="fpgabridge1" val="lwhps2fpga"/>
<DTAppend name="resets" parentlabel="fpgabridge1">
<val type="phandle">hps_0_rstmgr</val>
<val type="number">97</val>
</DTAppend>


<DTAppend name="reset-names" type="string" parentlabel="fpgabridge2" val="fpga2hps"/>
<DTAppend name="resets" parentlabel="fpgabridge2">
<val type="phandle">hps_0_rstmgr</val>
<val type="number">98</val>
</DTAppend>

===============================================================