FPGA image shall be also added to SDMMC. It will be loaded automatically during boot by U-Boot. U-Boot requires special format for the file: RBF - Raw Binary File, and special name for the file: 'soc_system.rbf' on De0 Nano Board and soc_system.core.rbf for Arria10 SoC DevKit Board. File shall be put in the FAT partition. </br>
### De0 Nano Board:
Convert .SOF to .RBF (folder quartus/output_files):
* Under Windows/Linux: https://www.intel.com/content/www/us/en/docs/programmable/683536/current/single-rbf-conversion-using-the-gui.html
* Under Linux: `quartus_cpf -o bitstream_compression=on -c soc_system.sof soc_system.rbf`
### Arria10 SoC DevKit Board:
Convert .SOF to .RBF (folder quartus/output_files):
* Under Linux: `quartus_cpf --hps -o bitstream_compression=on -c soc_system.sof soc_system.rbf`
Create `fit_spl_fpga.its` file with the following content:
description = "Boot with FPGA early IO release config";
fpga = "fpga-periph-1";
};
};
};
```
Make image for U-boot:
mkimage -E -f fit_spl_fpga.its fit_spl_fpga.itb
## Updating image on SDMMC
### De0 Nano Board:
1. Copy .wic image to sdmmc:
* Under Linux (with SDMMC mounted): sudo dd if=image.wic of=/dev/sdX bs=1M iflag=fullblock oflag=direct conv=fsync
* Under Windows (with SDMMC mounted): use Win32DiskImage or any other available tool
2. Copy soc_system.rbf to sdmmc
### Arria10 SoC DevKit Board:
1. Copy .wic image to sdmmc:
* Under Linux (with SDMMC mounted): sudo dd if=image.wic of=/dev/sdX bs=1M iflag=fullblock oflag=direct conv=fsync
* Under Windows (with SDMMC mounted): use Win32DiskImage or any other available tool
2. Copy 3 files to sdmmc: `fit_spl_fpga.itb`, `soc_system.core.rbf` and `soc_system.periph.rbf`
3. Rename `a10soc-devkit.dtb` to `socfpga_arria10_socdk_sdmmc.dtb`
### Under U-Boot:
* download .wic image to RAM using TFTP using 'tftp'(set up mac address, ip address, tftp server ip address) or 'dhcp'(set up mac address, tftp server ip address) commands
* write .wic image from RAM to SDMMC: mmc write $loadaddr 0x0 [size of .wic image in blocks], block is 512 bytes size
### Under Linux:
Some parts (kernel, dtb, fpga) can be also updated under Linux. The following steps shall be taken:
* mkdir /mnt/boot
* mount /dev/mmcblk0p1 /mnt/boot/
Under /mnt/boot the following images shall be available:
* zImage - Kernel
* de0-nano.dtb/a10soc-devkit.dtb - Device Tree
* soc_system.rbf - FPGA Bitstream
It is enought to copy new images there and reboot the system
## Network
### MAC address
Boards does not have any EEPROM or ther non-volatile memory except SDMMC. Thius after each SDMMC re-flash need to provision MAC address. To do that please run the follo
wing command in U-Boot console (replace example MAC address with the right one):
```
setenv ethaddr 66:55:44:33:22:11
saveenv
reset
```
In case 'ethaddr' avariable is already available and it not possible to override it, please run the following command to bring back enviroment to default state.
```
env default -a -f
```
MAC address could be also changed in runtime under Linux. Please be aware that this setting is volatile.
```
# Change MAC address
sudo ip link set dev eth0 down
sudo ip link set dev eth0 address 66:55:44:33:22:11
sudo ip link set dev eth0 up
```
To set up non-volatile cofiguration please edit "/etc/systemd/network/00-fpga-iot-eth0.network" file.
To set up MAC address please add "[Link]" section and MACAddress variable under it (https://wiki.archlinux.org/index.php/MAC_address_spoofing#systemd-networkd), e.g.:
```
[Link]
MACAddress=66:55:44:33:22:11
```
This method has precedence over setting MAC address via U-Boot enviroment variable.
### IP address
IP address could be changed in runtime under Linux. Please be aware that this setting is volatile.
```
# Change IP address
sudo ip addr add 192.168.1.2 dev eth0
```
To set up non-volatile cofiguration for both IP please edit "/etc/systemd/network/00-fpga-iot-eth0.network" file.
To set up IP please under "[Network]" section comment DHCP variable and add Address and Gateway variables (https://wiki.archlinux.org/index.php/Systemd-networkd#Wired_adapter_u
sing_a_static_IP), e.g.:
```
[Network]
#DHCP=ipv4
LinkLocalAddressing=no
Address=192.168.1.2
Gateway=192.168.1.1
```
## Linux
### Credentials
* user: root
* pass: fpgai0t
### More users
In case more userers are required there are two options:
DE0 Nano SoC board: git checkout de0-nano-soc
* additionals users can be added on already deployed system: https://linuxize.com/post/how-to-create-users-in-linux-using-the-useradd-command/
* users can be added by modification 'EXTRA_USERS_PARAMS' in local.conf.sample