How to check an Acorn’s PCIe link by hand on a Raspberry Pi 5¶
You have an Acorn on a Raspberry Pi 5 and want to load the fpgas.online design and bring the card back.
The boot check does the reading part by itself (pcie-link, pcie-bar0): Acorn tests and their wires on a Raspberry Pi 5. The design is built for the CLE-215+, the CLE-215 and the CLE-101. On a Compute Blade the addresses and the way back differ: How to check an Acorn’s PCIe link by hand on a Compute Blade.
What you need¶
An Acorn in the M.2 slot of a Pi 5 with the M.2 HAT, where the card is at
0001:01:00.0.The JTAG wiring of Acorn wiring on a Raspberry Pi 5, and
openFPGALoaderwith thelibgpiodcable.The fpgas.online Acorn design’s
.bitfile inSOC:The design these steps load is the fpgas.online Acorn design, the only design a package installs.
fpgas-online-acorn-bitstreamsputs it in/usr/share/fpgas-online/acorn-pcie/images/, for each variant (cle-215p,cle-215,cle-101) asacorn-<variant>-sqrl_acorn.bitfor a JTAG load, beside the two flash images. Put its name inSOConce per shell; the example is a CLE-101, so put another card’s variant in place ofcle-101, here and in the release file names of the loopback and pin-ID designs:$ SOC=/usr/share/fpgas-online/acorn-pcie/images/acorn-cle-101-sqrl_acorn.bit
Steps¶
On the Pi, list the card with
lspci; it shows one line, whose ID says which image it runs.$ lspci -nn -s 0001:01:00.0
The line after the address says which image the card runs:
The factory Sqrl firmware: Processing accelerators [1200]: Squirrels Research Labs Acorn CLE-215+ [1e24:021f] Processing accelerators [1200]: Squirrels Research Labs Acorn CLE-101 [1e24:0101] The vendor (RHS Research) XDMA sample image: Processing accelerators [1200]: Xilinx Corporation 7-Series FPGA Hard PCIe block (AXI/debug) [10ee:7011] The fpgas.online Acorn design (or any LiteX x1 PCIe design): Memory controller [0580]: Xilinx Corporation Device [10ee:7021]
On the Pi, detach the card’s PCIe endpoint before any JTAG load (why); the card no longer shows in
lspci.$ echo 1 | sudo tee /sys/bus/pci/devices/0001:01:00.0/remove
On the Pi, make sure
gpiochip0is the header’s GPIO chip, because thelibgpiodcable opensgpiochip0.The header’s GPIO chip is the one
gpiodetectlists aspinctrl-rp1; its number varies from 11 to 15. Where the Acorn packages are installed, the boot check makesgpiochip0a link to it whengpiochip0is missing. The link is gone at each reboot. Check which chipgpiochip0is:$ sudo gpiodetect $ ls -l /dev/gpiochip0
Skip the link if
ls -lshows-> gpiochipNwith N the number ofpinctrl-rp1, orgpiodetectlistsgpiochip0itself aspinctrl-rp1. If/dev/gpiochip0is missing or another chip, link it. The line below is forgpiochip15: put your chip’s number in place of 15.$ sudo ln -sfn /dev/gpiochip15 /dev/gpiochip0
On the Pi, load the design into SRAM; the load’s last line ends with
done 1.$ openFPGALoader --cable libgpiod --pins 10:9:11:8 $SOC
On the Pi, rescan the bus; the link is up the moment the load finishes, so the rescan enumerates the card.
$ echo 1 | sudo tee /sys/bus/pci/rescan
On the Pi, list the Xilinx devices; the card is back, as the LitePCIe default for one lane.
$ lspci -nn -d 10ee:
Check¶
Step 6 shows the fpgas.online design’s ID.
Xilinx Corporation Device [10ee:7021]
If it fails¶
The Acorn is not in step 1: the M.2 card or the HAT’s FPC cable is loose; reseat both and read
dmesg | grep -i pci.The Pi reboots or SSH drops during the load: the endpoint was still enumerated; detach it (step 2) before every load.
Step 6 shows nothing: the card did not link; re-probe the slot’s root complex with the lines below, then run step 6 again.
bindfails withNo such device, and the driver logslink down: the link was down, so the root port0001:00:00.0is gone. Load a design that links (oropenFPGALoader --reset), thenbindagain.The card still does not link: check that the build’s I/O report has the lane on B10 and B6.
The re-probe finds the platform device behind the slot, 1000110000.pcie, then unbinds and binds it. lspci -nn -s 0001:01:00.0 then shows the card:
$ RC=$(readlink -f /sys/bus/pci/devices/0001:00:00.0 | grep -o '[0-9a-f]*\.pcie')
$ echo $RC | sudo tee /sys/bus/platform/drivers/brcm-pcie/unbind
$ echo $RC | sudo tee /sys/bus/platform/drivers/brcm-pcie/bind
$ lspci -nn -s 0001:01:00.0
0001:01:00.0 Memory controller [0580]: Xilinx Corporation Device [10ee:7021]