diff --git a/README.md b/README.md index fae9f76cf583a6cc8b271baf618799b247466957..ea7de569576fe94857bdfa92ebdbf76ec53d4a8a 100644 --- a/README.md +++ b/README.md @@ -385,6 +385,45 @@ fi run custom_autoboot" > uenv.scr.txt ``` +With DHCP for User Firmware + +``` +$ echo -e "echo [INFO] ===== Scalp board boot settings =====; +echo [INFO] Setup MAC address and IP address; +run setup_eth; +setenv boot_from_qspi \"ubi part \${UBI_PART_NAME} && ubifsmount \${UBI_PART_ID}:\${UBI_DATAFS_VOL_NAME} && ubifsload \${UBI_VOL_LOAD_ADDR} /\${KERNEL_FIT_IMAGE_NAME} && ubifsumount && ubi detach && iminfo \${UBI_VOL_LOAD_ADDR} && bootm \${UBI_VOL_LOAD_ADDR}\"; +setenv boot_from_mmc \"bootm \${loadaddr}\" +setenv bootargs_ubifs \"\${mtdparts} ubi.mtd=1 root=ubi0:rootfs-vol rootfstype=ubifs rw earlyprintk cpuidle.off=1 crashkernel=256M uio_pdrv_genirq.of_id=generic-uio ip=\${ipaddr}:::::eth0\" +setenv bootargs_ext4 \"\${mtdparts} root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait earlyprintk cpuidle.off=1 crashkernel=256M uio_pdrv_genirq.of_id=generic-uio ip=dhcp:::::eth0\" +setenv custom_autoboot \"echo Scalp board autoboot from QSPI && run boot_from_qspi\" +setenv bootcmd \"run spi_init && run uenv_scr_load\"; +echo [INFO] Check if the file /\${KERNEL_FIT_IMAGE_NAME} exists; +if ext4load mmc 0:1 \${loadaddr} /\${KERNEL_FIT_IMAGE_NAME} ; then +echo [INFO] \${KERNEL_FIT_IMAGE_NAME} found; +echo [INFO] Check if the file /init exists; +if ext4load mmc 0:2 \${initloadaddr} /init ; then +echo [INFO] /init found; +echo [INFO] Config bootargs for MMC EXT4; +setenv bootargs \"\${mtdparts} root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait earlyprintk cpuidle.off=1 crashkernel=256M uio_pdrv_genirq.of_id=generic-uio ip=dhcp:::::eth0\"; +echo [INFO] Config boot mode from MMC; +setenv custom_autoboot \"echo Scalp board autoboot from MMC && run boot_from_mmc\"; +else +echo [INFO] init not found; +echo [INFO] Config bootargs for UBI/UBIFS; +setenv bootargs \"\${mtdparts} ubi.mtd=1 root=ubi0:rootfs-vol rootfstype=ubifs rw earlyprintk cpuidle.off=1 crashkernel=256M uio_pdrv_genirq.of_id=generic-uio ip=\${ipaddr}:::::eth0\"; +echo [INFO] Config boot mode from SPI NOR; +setenv custom_autoboot \"echo Scalp board autoboot from QSPI && run boot_from_qspi\"; +fi +else +echo [INFO] /\${KERNEL_FIT_IMAGE_NAME} not found; +echo [INFO] Config bootargs for UBI/UBIFS; +setenv bootargs \"\${mtdparts} ubi.mtd=1 root=ubi0:rootfs-vol rootfstype=ubifs rw earlyprintk cpuidle.off=1 crashkernel=256M uio_pdrv_genirq.of_id=generic-uio ip=\${ipaddr}:::::eth0\"; +echo [INFO] Config boot mode from SPI NOR; +setenv custom_autoboot \"echo Scalp board autoboot from QSPI && run boot_from_qspi\"; +fi +run custom_autoboot" > uenv.scr.txt +``` + ``` $ ../../../tools/u-boot-tools/mkimage -T script -C none -n 'Scalp U-Boot Script File' -A arm -d uenv.scr.txt uenv.scr ``` @@ -732,6 +771,12 @@ Then checkout the **SCALP-USER-v0.5.1** tag. $ git checkout SCALP-USER-v0.5.1 ``` +**For the design with the NoC Scalp :** + +``` +$ git checkout SCALP-ROUTER-v0.1 +``` + **If you have not gone through the scalp\_safe\_petalinux firmware creation section, please go to section [Copy Scalp board files](#copy-scalp-board-files).** #### Build the user bitstream file. @@ -751,6 +796,10 @@ and File -> Export -> Export Hardware -> include bitstream In my case **\<SCALP_USER_FIRMWARE\>** corresponds to "scalp\_user\_firmware". +**For the design with the NoC Scalp :** + +**\<SCALP_USER_FIRMWARE\>** corresponds to "scalp\_router\_firmware". + **If you have not gone through the scalp\_safe\_petalinux firmware creation process, please follow the instructions below to clone the scalp\_petalinux GIT repository.** **ONLY IF YOU HAVEN'T DONE IT YET.** @@ -769,6 +818,12 @@ $ git checkout SCALP-USER-v0.5.1 **Use version 0.5.1 for the GIT scalp_petalinux repository and version 0.5.1 for the GIT scalp_firmware repository. Be careful, sometimes the versions are identical, but depending on the evolution of the FPGA firmware and the PetaLinux firmware, the versions may be different.** +**For the design with the NoC Scalp :** + +``` +$ git checkout SCALP-ROUTER-v0.1 +``` + ### Create a new Scalp User Petalinux project from a BSP **If you want to name your "scalp_user_firmware" project, please delete the one already present. This folder has been left deliberately.** @@ -781,6 +836,10 @@ $ cd <PROJECT NAME> In my case **\<path-to-bsp\>** corresponds to /home/jo/Documents/Projets/Hepia/scalp_project/scalp_petalinux/bsp/SCALP-USER-FIRMWARE-BSP-V0.5.1.bsp +**For the design with the NoC Scalp :** + +**\<path-to-bsp\>** corresponds to /home/jo/Documents/Projets/Hepia/scalp_project/scalp_petalinux/bsp/SCALP-ROUTER-FIRMWARE-BSP-V0.1.bsp + ### Importing hardware configuration **The hardware description of the project must have been exported from Vivado beforehand.** @@ -793,6 +852,10 @@ $ petalinux-config --get-hw-description=$(find ${SCALP_FIRMWARE_PATH} -name ${SC In my case **\<PATH_TO_SCALP_FIRMWARE_PROJECT\>** corresponds to /home/jo/Documents/Projets/Hepia/scalp_project/scalp_firmware/ and **\<SCALP_USER_FIRMWARE\>** corresponds to **scalp_user_firmware**. +**For the design with the NoC Scalp :** + +**\<PATH_TO_SCALP_FIRMWARE_PROJECT\>** corresponds to /home/jo/Documents/Projets/Hepia/scalp_project/scalp_firmware/ and **\<SCALP_USER_FIRMWARE\>** corresponds to **scalp_router_firmware**. + **In the case of user firmware, it is not necessary to configure U-Boot. It is not used.** ### Added some utilities including Python @@ -832,12 +895,23 @@ $ cat project-spec/meta-user/recipes-apps/bitstream-conf/files/bitstream-conf | > export BITSTREAM_FILE_NAME="scalp_user_firmware.bit.bin" ``` +**For the design with the NoC Scalp :** + +``` +$ cat project-spec/meta-user/recipes-apps/bitstream-conf/files/bitstream-conf | grep "export BITSTREAM_FILE_NAME" +> export BITSTREAM_FILE_NAME="scalp_router_firmware.bit.bin" +``` + The name of the bitstream file before the .bit.bin extension must be the same as the firmware name defined in the export environment variable SCALP\_USER\_FIRMWARE="\<SCALP\_USER\_FIRMWARE>" described in the section [Importing hardware configuration](#importing-hardware-configuration). In my case, the environment variable **BITSTREAM\_FILE\_NAME** corresponds to **scalp\_user\_firmware.bit.bin**. Otherwise, the bitstream configuration file will not be automatically taken into account. +**For the design with the NoC Scalp :** + +The environment variable **BITSTREAM\_FILE\_NAME** corresponds to **scalp\_router\_firmware.bit.bin**. + ### Build the PetaLinux project ``` @@ -863,6 +937,14 @@ $ lsblk <----- Without the SD card inserted. $ sudo dd if=./images/linux/virtualfs-ext4.img of=/dev/\<MMC_DEV_NODE\> status=progress <----- Beware of danger, be sure. ``` +or + +``` +$ cp ../tools/virtfs.sh images/linux/ && cd images/linux/ && chmod +x virtfs.sh && sudo ./virtfs.sh && cd ../.. && lsblk +$ lsblk +$ sudo dd if=./images/linux/virtualfs-ext4.img of=/dev/\<MMC_DEV_NODE\> status=progress +``` + **P.S. We cannot be held responsible if your computer does not start and you have lost all your data that you did not backup. Too bad for you ;D** **This is the end of the short but dangerous way to your user firmware.**