Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21602 Discussions

Enable the HPS2FPGA bridge from userspace (Linux)

Altera_Forum
Honored Contributor II
1,751 Views

Hi everyone, 

 

I'm running a Mercury SA1 board from Enclustra with a 5CSXFC6C6 SoC. Both the HPS and the FPGA seem to work fine, I can boot the system from the SD card which then configures the FPGA with my bitstream and starts the Linux shell (with busybox). But somehow I can't figure out how to correctly enable the HPS2FPGA bridge (not the LW bridge, if this matters) from the Linux shell. When I interrupt booting and drop to the U-boot shell, I can enable the bridge using "bridge enable". After this, accessing the peripherals either from the U-boot shell or from the Linux system works. 

 

What registers do I need to configure (and in which order) to enable the bridge? Clearing the reset bits in 0xFFD0501C works, but seems to have no effect as a write to the bridge memory (0xC0000000) still fails: 

 

# devmem 0xffd0501c 32 2# devmem 0xc0001040 32 1 Unhandled fault: external abort on non-linefetch (0x818) at 0xb60 pgd = ee610000 *pgd=2ef74831, *pte=c0001743, *ppte=c0001c33 Bus error  

 

After some searching I found that there is a remap register in the NIC-301 interconnect, which should be configured to have the bridge memory space mapped into the mentioned address region. But invoking 

# devmem 0xff800000 32 8  

blocks forever. 

 

What do I need to do to enable the bridge from Linux (and maybe also to disable it again)? I've seen some sysfs files mentioned in other sites, but on my system there is nothing which looks to be directly related to the bridges: 

# find /sys -name '*fpga*' /sys/bus/platform/devices/ff706000.fpgamgr /sys/bus/platform/drivers/socfpga-reset /sys/bus/platform/drivers/altera_fpga_manager /sys/bus/platform/drivers/altera_fpga_manager/ff706000.fpgamgr /sys/devices/platform/soc/ff706000.fpgamgr /sys/devices/platform/soc/ff706000.fpgamgr/fpga /sys/devices/platform/soc/ff706000.fpgamgr/fpga/fpga0 /sys/class/fpga /sys/class/fpga/fpga0 /sys/firmware/devicetree/base/soc/fpgamgr@0xff706000 # find /sys -name '*bridge*'  

 

Probably I'm just missing some stupid detail, but I'd be glad for any hints toward this. 

Thanks! 

 

Best regards, 

Philipp
0 Kudos
0 Replies
Reply