How to install the fpgas.online images on an Acorn¶
You have an Acorn on a Raspberry Pi 5 whose JTAG answers. You want its flash to hold the fpgas.online golden and operational images. This page covers a Raspberry Pi 5. A card on a Compute Blade is not covered: its conversion was begun and stopped, as test-designs issue #213 describes.
What the two images are is on the fpgas.online Acorn design. What to do when an image is bad is on How to recover an Acorn with a bad image.
What you need¶
The Acorn on a Raspberry Pi 5 with the M.2 HAT, wired for JTAG (Acorn wiring on a Raspberry Pi 5).
The packages
fpgas-online-acorn-toolsandfpgas-online-acorn-bitstreams(How to install the Acorn packages). The tools package installsspi_flash.pyas/usr/bin/fpgas-acorn-flash, so on a host with the packagessudo fpgas-acorn-flash idissudo python3 spi_flash.py id.The images in
/usr/share/fpgas-online/acorn-pcie/images/, wheremanifest.jsonlists them. For a CLE-215+ the operational image (sqrl_acorn_operational.binbelow) isacorn-cle-215p-sqrl_acorn_operational.binthere. The golden image (sqrl_acorn_fallback.binbelow) isacorn-cle-215p-golden-sqrl_acorn_fallback.bin. For a CLE-101 putcle-101in place ofcle-215p.The card’s PCIe address,
<bdf>below:0001:01:00.0on a Raspberry Pi 5 with the M.2 HAT.A way to PoE-cycle the host’s switch port, for step 9.
The load command of How to run JTAG by hand on an Acorn on a Raspberry Pi 5.
The rescan command of How to check an Acorn’s PCIe link by hand on a Raspberry Pi 5.
Steps¶
The tool is spi_flash.py. How it reaches the flash is on Reaching an Acorn’s flash through PCIe.
Steps 5, 8 and 10 give no command: docs issue #126 holds what is missing. The warm boot’s mechanism is under Multiboot.
On the Pi, prove JTAG with
--detect, detach the endpoint and load the operational.bitinto SRAM, then rescan: PCIe enumerates10ee:7021.The
libgpiodcable opensgpiochip0, which must be the header’s GPIO chip.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
Then prove JTAG, detach the endpoint, load the operational
.bitand rescan. The file is the CLE-215+ one. For a CLE-101 putcle-101in place ofcle-215p.openFPGALoaderleaves the JTAG pins driven, so they go back to inputs.$ openFPGALoader --cable libgpiod --pins 10:9:11:8 --detect # Expected on a CLE-215+: idcode 0x3636093 (XC7A200T). No idcode line, or no output: stop here. $ echo 1 | sudo tee /sys/bus/pci/devices/0001:01:00.0/remove $ sudo openFPGALoader --cable libgpiod --pins 10:9:11:8 /usr/share/fpgas-online/acorn-pcie/images/acorn-cle-215p-sqrl_acorn.bit $ for p in 8 9 10 11; do sudo pinctrl set $p ip pd; done $ echo 1 | sudo tee /sys/bus/pci/rescan $ lspci -nn -s 0001:01:00.0 # Expected: 10ee:7021
Read the flash ID with
sudo python3 spi_flash.py id: S25FL256S, RDID01 02 19 4d 01 80, 32 MiB, QUAD bit set.Dump the flash twice with
sudo python3 spi_flash.py dump factory.binand compare the two dumps: their SHA-256 is identical. Keep one as the backup of the factory contents, which is the only copy.Write the operational image with
sudo python3 spi_flash.py write sqrl_acorn_operational.bin 0x400000 --idcode 0x3636093: it is erased, programmed and verified.Warm-boot to
0x400000over ICAP, endpoint detached, triggered over the UART bridge: the operational image runs from flash.BOOTSTS = 0x105means no fallback and no error.
The operational image runs from flash. The golden image goes in next.
Danger
If writing the golden slot goes wrong, JTAG is the only way back. Go on only if step 1 showed that --detect answers.
Load the golden
.bitinto SRAM as in step 1, and check it: UART, PCIe and flash access all work.From the golden design, write the golden slot with
sudo python3 spi_flash.py write sqrl_acorn_fallback.bin 0x0 --idcode 0x3636093 --i-know-this-writes-golden: both slots are verified again.Warm-boot to
0x0over ICAP: the golden image chain-loads the operational one.PoE-cycle the host’s switch port and wait more than 90 s. The card shows
10ee:7021, subsystem1e24:021f, 5 GT/s x1, and the UART, PCIe, P2 GPIO and flash checks pass.Reset the SoC’s CPU and read the BIOS log from the crossover UART through BAR0, after
setpci -s <bdf> COMMAND=0002:0002. The log shows DDR3 1 GiB at 800 MT/s, read leveling clean on both modules, andMemtest OK.
Check¶
The card passes when each of these shows:
idcode 0x3636093 (XC7A200T)from--detect, and10ee:7021after each rescan.BOOTSTS = 0x105(no fallback, no error) after the warm boot to0x400000.10ee:7021, subsystem1e24:021f, 5 GT/s x1 after the PoE cycle.Memtest OKin the BIOS log.
If it fails¶
No
idcodeline at step 1, or no output. JTAG does not answer. Stop, and follow Acorn wiring faults on a Raspberry Pi 5.spi_flash.pyrefuses a write before erasing. The image does not match the slot. The golden slot wants the flavour that chain-loads0x400000, and the operational slot the one with the watchdog. Both need the IDCODE of the part that is there. Address0x0also needs--i-know-this-writes-golden. Use the right file.The old configuration still runs after
sudo reboot. A reboot need not drop the M.2 rail, so the FPGA can keep its configuration. PoE-cycle the host’s switch port, as in step 9.An image is bad after a write. Follow How to recover an Acorn with a bad image.