diff --git a/config/bootenv/mvebu64.txt b/config/bootenv/mvebu64.txt index 02c54e9b98..e928fb39e1 100644 --- a/config/bootenv/mvebu64.txt +++ b/config/bootenv/mvebu64.txt @@ -1,6 +1,6 @@ verbosity=1 emmc_fix=off spi_workaround=off -eth1addr=fa:ad:4e:25:fb:84 -eth2addr=fa:ad:4e:84:25:2f -eth3addr=00:50:43:0d:19:18 +#eth1addr=fa:ad:4e:25:fb:84 +#eth2addr=fa:ad:4e:84:25:2f +#eth3addr=00:50:43:0d:19:18 diff --git a/config/bootscripts/boot-espressobin.cmd b/config/bootscripts/boot-espressobin.cmd index 6e5bbe944b..0222dc0b19 100644 --- a/config/bootscripts/boot-espressobin.cmd +++ b/config/bootscripts/boot-espressobin.cmd @@ -5,7 +5,7 @@ # default values setenv rootdev "/dev/mmcblk0p1" -setenv verbosity "1" +setenv verbosity "7" setenv rootfstype "ext4" setenv fdt_name_a dtb/marvell/armada-3720-community.dtb setenv fdt_name_b dtb/marvell/armada-3720-espressobin.dtb @@ -13,7 +13,7 @@ setenv fdt_name_b dtb/marvell/armada-3720-espressobin.dtb load ${boot_interface} ${devnum}:1 ${scriptaddr} ${prefix}armbianEnv.txt env import -t ${scriptaddr} ${filesize} -setenv bootargs "$console root=${rootdev} rootfstype=${rootfstype} rootwait loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} mtdparts=spi0.0:1536k(uboot),64k(uboot-environment),-(reserved) ${extraargs}" +setenv bootargs "$console root=${rootdev} rootfstype=${rootfstype} rootwait loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}" ext4load $boot_interface 0:1 $kernel_addr ${prefix}$image_name ext4load $boot_interface 0:1 $initrd_addr ${prefix}$initrd_image diff --git a/config/sources/families/mvebu64.conf b/config/sources/families/mvebu64.conf index 51eb8ca27e..d0bbe3ed0e 100644 --- a/config/sources/families/mvebu64.conf +++ b/config/sources/families/mvebu64.conf @@ -2,22 +2,27 @@ enable_extension "marvell-tools" ARCH=arm64 BOOTBRANCH='branch:v2022.01' BOOTENV_FILE='mvebu64.txt' -ATFSOURCE='https://github.com/MarvellEmbeddedProcessors/atf-marvell' +ATFSOURCE='https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git' ATFDIR='arm-trusted-firmware-espressobin' -ATFBRANCH='branch:atf-v1.5-armada-18.12' +ATFBRANCH='branch:master' ATF_USE_GCC='> 7.2' -ATF_COMPILER='aarch64-linux-gnu-' + +if [[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]]; then + ATF_COMPILER='aarch64-linux-gnu-' +else + ATF_COMPILER='aarch64-none-linux-gnu-' +fi if [[ $BOARD = macchiatobin-doubleshot ]]; then export SCP_BL2=$SRC/cache/sources/marvell-binaries/mrvl_scp_bl2.img - ATF_TARGET_MAP="DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr SECURE=0 PLAT=a80x0_mcbin;;build/a80x0_mcbin/debug/bl31.bin" + ATF_TARGET_MAP="USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr SECURE=0 PLAT=a80x0_mcbin;;build/a80x0_mcbin/release/bl31.bin" UBOOT_TARGET_MAP="DEVICE_TREE=armada-8040-mcbin ;;flash-image.bin" BOOTSCRIPT="boot-macchiatobin-doubleshot.cmd:boot.cmd" SERIALCON='ttyS0' else - ATF_TARGET_MAP="DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 SECURE=0 CLOCKSPRESET=CPU_800_DDR_800 DDR_TOPOLOGY=2 BOOTDEV=SPINOR PARTNUM=0 PLAT=a3700;;build/a3700/debug/bl31.bin" + ATF_TARGET_MAP="USE_COHERENT_MEM=0 LOG_LEVEL=20 SECURE=0 CLOCKSPRESET=CPU_800_DDR_800 DDR_TOPOLOGY=2 BOOTDEV=SPINOR PARTNUM=0 PLAT=a3700;;build/a3700/release/bl31.bin" UBOOT_TARGET_MAP="DEVICE_TREE=armada-3720-espressobin ;;flash-image-*.bin" BOOTSCRIPT="boot-espressobin.cmd:boot.cmd" @@ -77,11 +82,13 @@ atf_custom_postprocess() # prepare compilers for postprocess ubootdir="$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}" export ATF1=$toolchain/$ATF_COMPILER - export ATF2=$(find_toolchain "arm-linux-gnueabi-" "> 7.0")/arm-linux-gnueabi- + if [[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]]; then + export TOOLCHAIN_NAME="arm-linux-gnueabi-" + else + export TOOLCHAIN_NAME="arm-none-eabi-" + fi + export ATF2=$(find_toolchain "$TOOLCHAIN_NAME" "> 10.0")/$TOOLCHAIN_NAME export BL33=$ubootdir"/u-boot.bin" - # copy extra DDR topology - sed -i "s@^CUST | \[0-6\])@CUST | [0-7])@" $SRC/cache/sources/marvell-tools/script/buildtim.sh || true - cp $SRC/packages/blobs/espressobin/DDR* $SRC/cache/sources/marvell-tools/tim/ddr/ } uboot_custom_postprocess() @@ -90,6 +97,7 @@ uboot_custom_postprocess() rm $ubootdir/flash-image* local atfdir="$SRC/cache/sources/$ATFDIR/${ATFBRANCH##*:}" local ubootdir="$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}" + local moxbootdir="$SRC/cache/sources/mox-boot" cd $atfdir if [[ $BOARD = macchiatobin-doubleshot ]]; then @@ -102,6 +110,10 @@ uboot_custom_postprocess() make USE_COHERENT_MEM=0 LOG_LEVEL=20 MV_DDR_PATH=$SRC/cache/sources/marvell-ddr PLAT=a80x0_mcbin CROSS_COMPILE=$ATF1 BL33=$BL33 all fip $CTHREADS >> $DEST/debug/compilation.log 2>&1 cp build/a80x0_mcbin/release/flash-image.bin $ubootdir/$FILENAME else + cd $moxbootdir + make CROSS_CM3=$ATF2 wtmi_app.bin + cd $atfdir + clocks=( 600_600 800_800 1000_800 1200_750 ) topology=( 512m_1cs_0 512m_2cs_0 1g_2cs_2 1g_1cs_4 2g_2cs_7 1g_1cs_5 2g_2cs_6 ) for i in "${clocks[@]}" @@ -114,8 +126,19 @@ uboot_custom_postprocess() CLOCKSPRESET="CPU_${i%_*}_DDR_${i##*_}" display_alert "Building $FILENAME" "" "info" make distclean >> $DEST/debug/compilation.log 2>&1 - make MV_DDR_PATH=$SRC/cache/sources/marvell-ddr CROSS_COMPILE=$ATF1 DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 SECURE=0 CLOCKSPRESET=$CLOCKSPRESET DDR_TOPOLOGY=$DDR_TOPOLOGY BOOTDEV=SPINOR PARTNUM=0 PLAT=a3700 all fip BL33=$BL33 WTP=$SRC/cache/sources/marvell-tools $CTHREADS CROSS_CM3=$ATF2 >> $DEST/debug/compilation.log 2>&1 - cp build/a3700/debug/flash-image.bin $ubootdir/$FILENAME + make CROSS_COMPILE=$ATF1 \ + CROSS_CM3=$ATF2 \ + USE_COHERENT_MEM=0 \ + PLAT=a3700 \ + CLOCKSPRESET=$CLOCKSPRESET DDR_TOPOLOGY=$DDR_TOPOLOGY \ + MV_DDR_PATH=$SRC/cache/sources/marvell-ddr \ + WTP=$SRC/cache/sources/marvell-tools \ + CRYPTOPP_PATH=$SRC/cache/sources/cryptopp \ + BL33=$BL33 \ + WTMI_IMG=$moxbootdir/wtmi_app.bin \ + BOOTDEV=SPINOR PARTNUM=0 \ + LOG_LEVEL=20 all fip mrvl_flash $CTHREADS >> $DEST/debug/compilation.log 2>&1 + cp build/a3700/release/flash-image.bin $ubootdir/$FILENAME done done fi diff --git a/extensions/marvell-tools.sh b/extensions/marvell-tools.sh index ef2a81981b..7989f48acb 100644 --- a/extensions/marvell-tools.sh +++ b/extensions/marvell-tools.sh @@ -1,5 +1,7 @@ function fetch_sources_tools__marvell_tools() { - fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:A3700_utils-armada-18.12" - fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git" "marvell-ddr" "branch:mv_ddr-armada-18.12" - fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/binaries-marvell" "marvell-binaries" "branch:binaries-marvell-armada-18.12" + fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:master" + fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git" "marvell-ddr" "branch:master" + fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/binaries-marvell" "marvell-binaries" "branch:binaries-marvell-armada-SDK10.0.1.0" + fetch_from_repo "https://github.com/weidai11/cryptopp.git" "cryptopp" "branch:master" + fetch_from_repo "https://gitlab.nic.cz/turris/mox-boot-builder.git" "mox-boot" "branch:master" } diff --git a/lib/general.sh b/lib/general.sh index bfc725bb0b..b0a0dbe7e1 100644 --- a/lib/general.sh +++ b/lib/general.sh @@ -1370,8 +1370,9 @@ prepare_host() build-essential ca-certificates ccache cpio cryptsetup curl \ debian-archive-keyring debian-keyring debootstrap device-tree-compiler \ dialog dirmngr dosfstools dwarves f2fs-tools fakeroot flex gawk \ - gcc-arm-linux-gnueabihf gdisk gnupg1 gpg imagemagick jq kmod libbison-dev \ - libc6-dev-armhf-cross libelf-dev libfdt-dev libfile-fcntllock-perl \ + gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu gdisk gnupg1 gpg \ + imagemagick jq kmod libbison-dev libc6-dev-armhf-cross libcrypto++-dev \ + libelf-dev libfdt-dev libfile-fcntllock-perl \ libfl-dev liblz4-tool libncurses-dev libpython2.7-dev libssl-dev \ libusb-1.0-0-dev linux-base locales lzop ncurses-base ncurses-term \ nfs-kernel-server ntpdate p7zip-full parted patchutils pigz pixz \ @@ -1386,7 +1387,7 @@ prepare_host() elif [[ $(dpkg --print-architecture) == arm64 ]]; then - hostdeps+=" gcc-arm-linux-gnueabi gcc-arm-none-eabi libc6 libc6-amd64-cross qemu" + hostdeps+="gcc-arm-none-eabi libc6 libc6-amd64-cross qemu" else @@ -1522,7 +1523,7 @@ prepare_host() "${ARMBIAN_MIRROR}/_toolchains/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz" "${ARMBIAN_MIRROR}/_toolchain/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf.tar.xz" "${ARMBIAN_MIRROR}/_toolchain/gcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz" - "${ARMBIAN_MIRROR}/_toolchain/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz" + "${ARMBIAN_MIRROR}/_toolchain/gcc-arm-11.2-2022.02-x86_64-arm-none-eabi.tar.xz" "${ARMBIAN_MIRROR}/_toolchain/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz" ) diff --git a/packages/blobs/espressobin/DDR_TOPOLOGY_2.txt b/packages/blobs/espressobin/DDR_TOPOLOGY_2.txt deleted file mode 100644 index 5a3455b849..0000000000 --- a/packages/blobs/espressobin/DDR_TOPOLOGY_2.txt +++ /dev/null @@ -1,22 +0,0 @@ -# -# This file is the input for A3700 DDR porting tool, -# each item is one parameter for DDR topology, which will be parsed by -# DDR tool and generate DDR register list accordingly. -# Supported Marvell boards: -# DDR3 2CS : EspressoBIN (1GB) -# - -#DDR3 -ddr_type=0 - -#2CS -ddr_cs_mask=3 - -#DDR3_1600K -ddr_speedbin_index=12 - -#16BIT -ddr_bus_width_index=2 - -#4Gbits (512MB) -ddr_mem_size_index=3 diff --git a/packages/blobs/espressobin/DDR_TOPOLOGY_6.txt b/packages/blobs/espressobin/DDR_TOPOLOGY_6.txt deleted file mode 100644 index e297f5e150..0000000000 --- a/packages/blobs/espressobin/DDR_TOPOLOGY_6.txt +++ /dev/null @@ -1,22 +0,0 @@ -# -# This file is the input for A3700 DDR porting tool, -# each item is one parameter for DDR topology, which will be parsed by -# DDR tool and generate DDR register list accordingly. -# Supported Marvell boards: -# DDR4 2CS : ESPERSSOBIN-DDR4 dual K4A8G165WB-BCRC (2GB) -# - -#DDR4 -ddr_type=1 - -#2CS -ddr_cs_mask=3 - -#DDR4_2400T -ddr_speedbin_index=11 - -#16BIT -ddr_bus_width_index=2 - -#16Gbits (2GB) -ddr_mem_size_index=4 diff --git a/packages/blobs/espressobin/DDR_TOPOLOGY_7.txt b/packages/blobs/espressobin/DDR_TOPOLOGY_7.txt deleted file mode 100644 index 63ef9088c5..0000000000 --- a/packages/blobs/espressobin/DDR_TOPOLOGY_7.txt +++ /dev/null @@ -1,22 +0,0 @@ -# -# This file is the input for A3700 DDR porting tool, -# each item is one parameter for DDR topology, which will be parsed by -# DDR tool and generate DDR register list accordingly. -# Supported Marvell boards: -# DDR3 2CS : EspressoBIN (2GB) -# - -#DDR3 -ddr_type=0 - -#2CS -ddr_cs_mask=3 - -#DDR3_1600K -ddr_speedbin_index=12 - -#16BIT -ddr_bus_width_index=2 - -#8Gbits (1024MB) -ddr_mem_size_index=4