Hit a small roadblock. /dev/fpga0 no longer exists in the Linux kernel 4 so I need to learn the new way to reconfigure the fpga!
Looking like the simple one liner dd (+ cat to disable/enable bridges) has been replaced by an incredibly complicated setup called a 'device tree overlay', which seems to involve writing some json-like patch to a configfs mount point. Or something like that...
---
Things found so far:
ls /proc/device-tree/ #device tree exists in filesystem form in proc
ls /proc/device-tree/soc/*fpga* #Some fpga devices in the device tree: bridge and fpga manager
ls /sys/firmware/devicetree/base/soc/*fpga* #mirror of proc?
mount -t configfs none /sys/kernel/config/ #configfs allows making runtime changes to the device tree, usually mounted here
ls -l /sys/kernel/config/device-tree/overlays/ #empty except this folder
https://rocketboards.org/foswiki/Docume ... eGenerator #Has documentation on device trees in general
https://forum.rocketboards.org/t/load-f ... 0nano/1836 # Useful snippets!
installed dtc compiler does not seem to understand /plugin/ in the .dts file
---
Voodoo for overlay:
Put this in program.dts
Code: Select all
/dts-v1/;
/{
fragment@0 {
target-path = "/soc/base-fpga-region";
#address-cells = <1>;
#size-cells = <1>;
__overlay__ {
#address-cells = <1>;
#size-cells = <1>;
firmware-name = "core.rbf";
};
};
};
Then run this to flash:
Code: Select all
cp _Computer/Minimig_20210308.rbf /lib/firmware/core.rbf
mount -t configfs none /sys/kernel/config/
mkdir /sys/kernel/config/device-tree/overlays/programfpga
dtc --in-format dts --out-format dtb program.dts > /sys/kernel/config/device-tree/overlays/programfpga/dtbo
If all is well will see core.rbf here:
cat /proc/device-tree/soc/base-fpga-region/firmware-name
...
Problem: doesn't flash rbf!
---
https://elixir.bootlin.com/linux/latest ... region.txt #More light reading
---
Unclear why it doesn't work, is there a kernel patch?
https://github.com/MiSTer-devel/Linux-Kernel_MiSTer
Nope, looks normal. Should see fpga_mgr_firmware_load in fpga-mgr.c which logs 'writing to'.
---
Plan C: fpga-mgr device tree overlays do not work, no idea why. So use direct hardware access.
https://github.com/nhasbun/de10nano_fpga_linux_config
This tool runs, logs stuff that looks promising, then linux crashes!
It works if I kill the Mister process first
![Smile :-)](./images/smilies/icon_e_smile.gif)
Then I start mister afterwards and I see the core and mister communicating. However the core does not work beyond the overlay menu, so clearly missing one step still.
Final step: start /media/fat/Mister from the / working directory. Now we're cooking with gas!
---
In summary
--------------
Cross compiler working
Can flash rbf core locally on mist and have it work (yes I know I can flash a sof via jtag, wasn't sure how that'd work with the hps2fpga bridges...)
Trying to map memory next and talk to chip ram