configs/socfpga_agilex5_vendor: new defconfig Build Linux, U-Boot, and TF-A for the Agilex 5 SoC Development Kit from the QPDS 26.1.1 GSRD sources. Signed-off-by: Dinh Nguyen <dinguyen@kernel.org> [Julien: - squash patch enabling hashes - rename defconfig to replace "altera" by "vendor" and update readme.txt - remove tag name in readme.txt for easier future maintenance - move link in readme.txt at the end - add DEVELOPERS entry for defconfig ] Signed-off-by: Julien Olivain <ju.o@free.fr>
diff --git a/DEVELOPERS b/DEVELOPERS index febf037..8844306 100644 --- a/DEVELOPERS +++ b/DEVELOPERS
@@ -904,6 +904,10 @@ F: package/bvi/ F: package/wireless-regdb/ +N: Dinh Nguyen <dinguyen@kernel.org> +F: board/altera/ +F: configs/socfpga_agilex5_vendor_defconfig + N: Dmitry Chestnykh <dm.chestnykh@gmail.com> F: board/qemu/sparc-ss10/ F: configs/qemu_sparc_ss10_defconfig
diff --git a/board/altera/agilex5/genimage.cfg b/board/altera/agilex5/genimage.cfg new file mode 100644 index 0000000..720d646 --- /dev/null +++ b/board/altera/agilex5/genimage.cfg
@@ -0,0 +1,27 @@ +image boot.vfat { + vfat { + files = { + "Image", + "socfpga_agilex5_socdk.dtb", + "u-boot.itb" + } + } + + size = 64M +} + +image sdcard.img { + hdimage { + } + + partition boot { + partition-type = 0xc + bootable = "true" + image = "boot.vfat" + } + + partition rootfs { + partition-type = 0x83 + image = "rootfs.ext2" + } +}
diff --git a/board/altera/agilex5/linux.fragment b/board/altera/agilex5/linux.fragment new file mode 100644 index 0000000..7c8f9de --- /dev/null +++ b/board/altera/agilex5/linux.fragment
@@ -0,0 +1,4 @@ +# QSPI access fails when 4K sectors are enabled (ES-14728). +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +# Marvell PHY on the SoC Development Kit Ethernet ports. +CONFIG_MARVELL_PHY=y
diff --git a/board/altera/agilex5/patches/arm-trusted-firmware/arm-trusted-firmware.hash b/board/altera/agilex5/patches/arm-trusted-firmware/arm-trusted-firmware.hash new file mode 100644 index 0000000..5a935a0 --- /dev/null +++ b/board/altera/agilex5/patches/arm-trusted-firmware/arm-trusted-firmware.hash
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 59bed1328131f1eb1ee10f16c94d8f0bbf5600d7573d42d0cf987b8edffe2f6a arm-trusted-firmware-QPDS26.1.1_REL_GSRD_PR-git4.tar.gz
diff --git a/board/altera/agilex5/patches/linux/linux.hash b/board/altera/agilex5/patches/linux/linux.hash new file mode 100644 index 0000000..d322ac2 --- /dev/null +++ b/board/altera/agilex5/patches/linux/linux.hash
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 d8328683db0a6b43a96c18d7149b98a11138909ea50f2fa411339f93eb492571 linux-QPDS26.1.1_REL_GSRD_PR-git4.tar.gz
diff --git a/board/altera/agilex5/patches/uboot/uboot.hash b/board/altera/agilex5/patches/uboot/uboot.hash new file mode 100644 index 0000000..51906e1 --- /dev/null +++ b/board/altera/agilex5/patches/uboot/uboot.hash
@@ -0,0 +1,2 @@ +# Locally calculated +sha256 a78bf187fde344297bea7d986f05996dfba94ea11d2d4dc706a78bcae543e175 uboot-QPDS26.1.1_REL_GSRD_PR-git4.tar.gz
diff --git a/board/altera/agilex5/readme.txt b/board/altera/agilex5/readme.txt new file mode 100644 index 0000000..5a9fe35 --- /dev/null +++ b/board/altera/agilex5/readme.txt
@@ -0,0 +1,64 @@ +Altera SoCFPGA Agilex 5 SoC Development Kit + + +Intro +===== + +This configuration builds a Linux system for the Agilex 5 SoC +Development Kit (socfpga_agilex5_socdk) from the QPDS Golden System +Reference Design component versions: + + https://github.com/altera-fpga/linux-socfpga + https://github.com/altera-fpga/u-boot-socfpga + https://github.com/altera-fpga/arm-trusted-firmware + +The HPS first-stage bootloader is packaged by Quartus into the FPGA +configuration file. This defconfig builds the software that the HPS loads +after that: U-Boot (u-boot.itb, with TF-A BL31), the kernel Image, the +socfpga_agilex5_socdk device tree, and a root filesystem. + +The socfpga_agilex5_vendor_defconfig supports the Agilex5 065B Premium +development kit [1]. + + +Build +===== + + make socfpga_agilex5_vendor_defconfig + make + +output/images will contain: + + Image + socfpga_agilex5_socdk.dtb + u-boot.itb + u-boot-spl-dtb.hex + bl31.bin + rootfs.ext2 + rootfs.tar.gz + sdcard.img + +sdcard.img has a FAT boot partition (Image, device tree, u-boot.itb) and +an ext4 root filesystem on the second partition. + + +Creating a bootable SD card +=========================== + +Prepare the SD card with this command: + + dd if=output/images/sdcard.img of=/dev/sdX + +Notes: + - replace 'sdX' with the actual device with your micro SDcard, + - you may need to be root to do that (use 'sudo') + +Program the HPS first-stage bootloader with Quartus, using +output/images/u-boot-spl-dtb.hex as the HPS handoff file. Boot the HPS +from the SD card. The serial console is ttyS0 at 115200 8n1. + +Copy a fabric configuration file named ghrd.core.rbf onto the FAT +partition if the design needs the FPGA loaded before Linux starts. U-Boot +skips that step when the file is absent. + +[1] https://www.altera.com/products/devkit/po-3284/agilex-5-fpga-e-series-065b-premium-development-kit
diff --git a/board/altera/agilex5/uboot.fragment b/board/altera/agilex5/uboot.fragment new file mode 100644 index 0000000..1e33275 --- /dev/null +++ b/board/altera/agilex5/uboot.fragment
@@ -0,0 +1,4 @@ +CONFIG_USE_BOOTARGS=y +CONFIG_BOOTARGS="console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait" +CONFIG_USE_BOOTCOMMAND=y +CONFIG_BOOTCOMMAND="if fatload mmc 0:1 ${loadaddr} ghrd.core.rbf; then fpga load 0 ${loadaddr} ${filesize}; bridge enable; fi; mmc rescan; fatload mmc 0:1 82000000 Image; fatload mmc 0:1 86000000 socfpga_agilex5_socdk.dtb; setenv bootargs console=ttyS0,115200 root=/dev/mmcblk0p2 rw rootwait; booti 0x82000000 - 0x86000000"
diff --git a/configs/socfpga_agilex5_vendor_defconfig b/configs/socfpga_agilex5_vendor_defconfig new file mode 100644 index 0000000..f989403 --- /dev/null +++ b/configs/socfpga_agilex5_vendor_defconfig
@@ -0,0 +1,48 @@ +BR2_cortex_a55=y +BR2_TOOLCHAIN_EXTERNAL=y +BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y +BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_AARCH64_GLIBC_STABLE=y +BR2_GLOBAL_PATCH_DIR="board/altera/agilex5/patches" +BR2_DOWNLOAD_FORCE_CHECK_HASHES=y +BR2_TARGET_GENERIC_HOSTNAME="agilex5" +BR2_TARGET_GENERIC_GETTY_PORT="ttyS0" +BR2_SYSTEM_DHCP="eth0" +BR2_ROOTFS_POST_IMAGE_SCRIPT="support/scripts/genimage.sh" +BR2_ROOTFS_POST_IMAGE_SCRIPT_ARGS="-c board/altera/agilex5/genimage.cfg" +BR2_LINUX_KERNEL=y +BR2_LINUX_KERNEL_CUSTOM_GIT=y +BR2_LINUX_KERNEL_CUSTOM_REPO_URL="https://github.com/altera-fpga/linux-socfpga.git" +BR2_LINUX_KERNEL_CUSTOM_REPO_VERSION="QPDS26.1.1_REL_GSRD_PR" +BR2_LINUX_KERNEL_USE_ARCH_DEFAULT_CONFIG=y +BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="board/altera/agilex5/linux.fragment" +BR2_LINUX_KERNEL_DTS_SUPPORT=y +BR2_LINUX_KERNEL_INTREE_DTS_NAME="intel/socfpga_agilex5_socdk" +BR2_LINUX_KERNEL_INSTALL_TARGET=y +BR2_LINUX_KERNEL_NEEDS_HOST_OPENSSL=y +BR2_TARGET_ROOTFS_EXT2=y +BR2_TARGET_ROOTFS_EXT2_4=y +BR2_TARGET_ROOTFS_EXT2_SIZE="256M" +# BR2_TARGET_ROOTFS_TAR is not set +BR2_TARGET_ARM_TRUSTED_FIRMWARE=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT=y +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL="https://github.com/altera-fpga/arm-trusted-firmware.git" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION="QPDS26.1.1_REL_GSRD_PR" +BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM="agilex5" +BR2_TARGET_UBOOT=y +BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG=y +BR2_TARGET_UBOOT_CUSTOM_GIT=y +BR2_TARGET_UBOOT_CUSTOM_REPO_URL="https://github.com/altera-fpga/u-boot-socfpga.git" +BR2_TARGET_UBOOT_CUSTOM_REPO_VERSION="QPDS26.1.1_REL_GSRD_PR" +BR2_TARGET_UBOOT_BOARD_DEFCONFIG="socfpga_agilex5" +BR2_TARGET_UBOOT_CONFIG_FRAGMENT_FILES="board/altera/agilex5/uboot.fragment" +BR2_TARGET_UBOOT_NEEDS_DTC=y +BR2_TARGET_UBOOT_NEEDS_OPENSSL=y +BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y +BR2_TARGET_UBOOT_USE_BINMAN=y +# BR2_TARGET_UBOOT_FORMAT_BIN is not set +BR2_TARGET_UBOOT_FORMAT_ITB=y +BR2_TARGET_UBOOT_SPL=y +BR2_TARGET_UBOOT_SPL_NAME="spl/u-boot-spl-dtb.hex" +BR2_PACKAGE_HOST_DOSFSTOOLS=y +BR2_PACKAGE_HOST_GENIMAGE=y +BR2_PACKAGE_HOST_MTOOLS=y