1891 echo "Starting the procedure for Cyclone V Arrow SoCkit dev board 5CSXFC6C6" 1892 wget https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz 1893 tar xf gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz 1894 rm gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz 1895 export PATH=`pwd`/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/bin:$PATH 1896 echo "Preparing Binaries for Linux" 1897 sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm libncurses-dev gawk flex bison openssl libssl-dev 1898 rm -rf linux-bin && mkdir linux-bin 1899 export set LINUX_BIN=`pwd`/linux-bin 1900 mkdir -p $LINUX_BIN/a9 1901 rm -rf linux && mkdir linux 1902 export set LINUX_TOP=`pwd`/linux 1903 cd $LINUX_TOP 1904 export ARCH=arm 1905 export CROSS_COMPILE=arm-none-linux-gnueabihf- 1906 cd $LINUX_TOP 1907 git clone https://github.com/altera-opensource/linux-socfpga linux-socfpga.a9 1908 cd linux-socfpga.a9/ 1909 git checkout -b test-kernel -t origin/socfpga-5.15.50-lts 1910 sed -i 's/120MB for jffs2 data/56MB for jffs2 data/g' arch/arm/boot/dts/socfpga_cyclone5_socdk.dts 1911 sed -i 's/<0x800000 0x7800000>;/<0x800000 0x3800000>;/g' arch/arm/boot/dts/socfpga_cyclone5_socdk.dts 1912 make socfpga_defconfig 1913 make -j 48 zImage Image dtbs modules 1914 make -j 48 modules_install INSTALL_MOD_PATH=modules_install 1915 rm -rf modules_install/lib/modules/*/build 1916 rm -rf modules_install/lib/modules/*/source 1917 ln -s $LINUX_TOP/linux-socfpga.a9/arch/arm/boot/zImage $LINUX_BIN/a9/ 1918 ln -s $LINUX_TOP/linux-socfpga.a9/arch/arm/boot/Image $LINUX_BIN/a9/ 1919 ln -s $LINUX_TOP/linux-socfpga.a9/arch/arm/boot/dts/socfpga_cyclone5_socdk.dtb $LINUX_BIN/a9/ 1920 ln -s $LINUX_TOP/linux-socfpga.a9/modules_install/lib/modules $LINUX_BIN/a9/ 1921 ls -al | grep image 1922 cd arch/arm/boot/ 1923 ls -al | grep image 1924 ls -al | grep Image 1925 cd dts/ 1926 ls -al |grep cyclone 1927 cd $LINUX_ 1928 cd $LINUX_TOP 1929 sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool 1930 mkdir rootfs && cd rootfs 1931 export set ROOTFS_TOP=`pwd` 1932 cd $ROOTFS_TOP 1933 rm -rf cv && mkdir cv && cd cv 1934 git clone -b kirkstone https://git.yoctoproject.org/poky 1935 git clone -b kirkstone https://git.yoctoproject.org/meta-intel-fpga 1936 source poky/oe-init-build-env ./build 1937 echo 'MACHINE = "cyclone5"' >> conf/local.conf 1938 echo 'BBLAYERS += " ${TOPDIR}/../meta-intel-fpga "' >> conf/bblayers.conf 1939 bitbake core-image-minimal 1940 ln -s $ROOTFS_TOP/cv/build/tmp/deploy/images/cyclone5/core-image-minimal-cyclone5.tar.gz $LINUX_BIN/a9/ 1941 echo "Cyclone V SoC - Boot from SD Card" 1942 cd .. 1943 mkdir cv_example.sdmmc 1944 cd cv_example.sdmmc 1945 export TOP_FOLDER=`pwd` 1946 cd $TOP_FOLDER 1947 rm -rf ghrd-socfpga-QPDS22.1STD_REL_GSRD_PR QPDS22.1STD_REL_GSRD_PR.zip cv_soc_devkit_ghrd 1948 wget https://github.com/altera-opensource/ghrd-socfpga/archive/refs/tags/QPDS22.1STD_REL_GSRD_PR.zip 1949 unzip QPDS22.1STD_REL_GSRD_PR.zip 1950 mv ghrd-socfpga-QPDS22.1STD_REL_GSRD_PR/cv_soc_devkit_ghrd . 1951 rm -rf ghrd-socfpga-QPDS22.1STD_REL_GSRD_PR QPDS22.1STD_REL_GSRD_PR.zip 1952 cd cv_soc_devkit_ghrd 1953 rm -rf software 1954 ~/intelFPGA/22.1std/nios2eds/nios2_command_shell.sh make generate_from_tcl 1955 ~/intelFPGA/22.1std/nios2eds/nios2_command_shell.sh make sof 1956 mkdir software/bootloader && cd software/bootloader 1957 mkdir software 1958 cd software/ 1959 mkdir bootloader 1960 cd bootloader/ 1961 git clone --depth 1 -b socfpga_v2022.04 https://github.com/altera-opensource/u-boot-socfpga.git 1962 cd u-boot-socfpga/ 1963 git checkout -b test-bootloader -t origin/socfpga_v2022.04 1964 cd $TOP_FOLDER/cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/arch/arm/mach-socfpga/cv_bsp_generator 1965 echo "Manual says to use Python2 for script" 1966 python2 cv_bsp_generator.py -i $TOP_FOLDER/cv_soc_devkit_ghrd/hps_isw_handoff/soc_system_hps_0 -o ../../../../board/altera/cyclone5-socdk/qts 1967 cd $TOP_FOLDER/cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga 1968 export CROSS_COMPILE=arm-none-linux-gnueabihf- 1969 make socfpga_cyclone5_defconfig 1970 make -j 48 1971 cd $TOP_FOLDER/ 1972 sudo rm -rf sd_card && mkdir sd_card && cd sd_card 1973 wget https://releases.rocketboards.org/2021.04/gsrd/tools/make_sdimage_p3.py 1974 chmod +x make_sdimage_p3.py 1975 cd $TOP_FOLDER/sd_card 1976 mkdir sdfs && cd sdfs 1977 cp $LINUX_BIN/a9/zImage . 1978 cp $LINUX_BIN/a9/socfpga_cyclone5_socdk.dtb . 1979 mkdir extlinux 1980 echo "LABEL Linux Default" > extlinux/extlinux.conf 1981 echo " KERNEL ../zImage" >> extlinux/extlinux.conf 1982 echo " FDT ../socfpga_cyclone5_socdk.dtb" >> extlinux/extlinux.conf 1983 echo " APPEND root=/dev/mmcblk0p2 rw rootwait earlyprintk console=ttyS0,115200n8" >> extlinux/extlinux.conf 1984 cd $TOP_FOLDER/sd_card 1985 sudo rm -rf rootfs 1986 mkdir rootfs && cd rootfs 1987 sudo tar xf $LINUX_BIN/a9/core-image-minimal-cyclone5.tar.gz 1988 sudo rm -rf lib/modules/* 1989 sudo cp -r $LINUX_BIN/a9/modules/* lib/modules 1990 cd $TOP_FOLDER/sd_card 1991 cp ../cv_soc_devkit_ghrd/software/bootloader/u-boot-socfpga/u-boot-with-spl.sfp . 1992 cd $TOP_FOLDER/sd_card 1993 sudo python3 ./make_sdimage_p3.py -f -P u-boot-with-spl.sfp,num=3,format=raw,size=10M,type=A2 -P sdfs/*,num=1,format=fat32,size=100M -P rootfs/*,num=2,format=ext3,size=300M -s 512M -n sdcard_cv.img 1994 exit 1995 sudo putty 1996 exit