... | ... | @@ -36,3 +36,56 @@ make system/system.bit.bin |
|
|
```
|
|
|
Be prepared that build takes a while (up to 20 minutes, depends on your computer hardware).
|
|
|
|
|
|
## Use design the MZ_APO board
|
|
|
|
|
|
Copy binary FPGA design/configuration bitsream to the target system. Example of the copy to one of the boards
|
|
|
```
|
|
|
scp -i /opt/zynq/ssh-connect/mzapo-root-key system/system.bit.bin root@192.168.202.207:/lib/firmware/system.bit.bin
|
|
|
```
|
|
|
Connect to the board
|
|
|
```
|
|
|
ssh -i /opt/zynq/ssh-connect/mzapo-root-key root@192.168.202.207
|
|
|
```
|
|
|
The application of the bitsream requires to use [device-tree](https://en.wikipedia.org/wiki/Device_tree) [overlay](https://lwn.net/Articles/616859/) mechanism on mainline kernels. The module [dtbocfg](https://github.com/ikwzm/dtbocfg) to apply device-tree overlay to the running kernel devices database. The overlay specifies the name of the bitstream which should be load from `/lib/firmware` directory and applied by FPGA manager to the programmable logic to configure new design function. The device tree can specify list new hardware device nodes. Such setup result in automatic load and binding of corresponding device drivers. The simple device tree overlay (`bitstream-update.dts`) which only asks FPGA manage to load new bitstream looks like this
|
|
|
```
|
|
|
/dts-v1/;
|
|
|
/plugin/;
|
|
|
|
|
|
/ {
|
|
|
fragment@0 {
|
|
|
target-path = "/fpga-full";
|
|
|
|
|
|
__overlay__ {
|
|
|
#address-cells = <1>;
|
|
|
#size-cells = <1>;
|
|
|
|
|
|
firmware-name = "system.bit.bin";
|
|
|
};
|
|
|
};
|
|
|
};
|
|
|
```
|
|
|
The overlay has to be compiled by
|
|
|
```
|
|
|
dtc -O dtb -b 0 -@ -o bitstream-update.dts.dtbo bitstream-update.dts.dts
|
|
|
```
|
|
|
to binary format the first.
|
|
|
|
|
|
Then copy bitstream to `/lib/firmware`
|
|
|
```
|
|
|
mkdir -p /lib/firmware
|
|
|
rm -f /lib/firmware/system.bit.bin
|
|
|
cp /tmp/system.bit.bin /lib/firmware
|
|
|
```
|
|
|
Load [DTB Overlay Configuration module](https://github.com/ikwzm/dtbocfg) if it is not already loaded
|
|
|
```
|
|
|
modprobe dtbocfg || insmod /opt/zynq/upbit/dtbocfg.ko
|
|
|
```
|
|
|
then apply actual overlay and firmware
|
|
|
```
|
|
|
cd /sys/kernel/config/device-tree/overlays
|
|
|
rmdir -f pl
|
|
|
mkdir pl || exit 1
|
|
|
cd pl
|
|
|
cat /opt/zynq/upbit/dts/bitstream-update.dtbo >dtbo
|
|
|
```
|
|
|
If the system does not stuck or report some error then you now running Linux kernel in the new hardware world. |