mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
* add the image tree source for building FIT images for ebin * add FIT image generation to BSP files * Change to using FIT image to boot * make fit-image script executable * add the ability to choose board dtb in armbianEnv.txt
156 lines
5.2 KiB
Plaintext
156 lines
5.2 KiB
Plaintext
enable_extension "marvell-tools"
|
|
ARCH=arm64
|
|
BOOTBRANCH='branch:v2022.04'
|
|
BOOTENV_FILE='mvebu64.txt'
|
|
BOOTSCRIPT_OUTPUT='boot.scr.uimg'
|
|
ATFSOURCE='https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git'
|
|
ATFDIR='arm-trusted-firmware-espressobin'
|
|
ATFBRANCH='branch:master'
|
|
ATF_USE_GCC='> 7.2'
|
|
|
|
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="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="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"
|
|
SERIALCON='ttyMV0'
|
|
fi
|
|
|
|
case $BRANCH in
|
|
|
|
legacy)
|
|
|
|
KERNELSOURCE='https://github.com/MarvellEmbeddedProcessors/linux-marvell.git'
|
|
KERNELBRANCH='branch:linux-4.14.22-armada-18.06'
|
|
KERNELDIR='linux-marvell'
|
|
|
|
;;
|
|
|
|
current)
|
|
|
|
KERNELBRANCH='branch:linux-5.15.y'
|
|
KERNELBRANCH="tag:v5.15.35"
|
|
|
|
;;
|
|
|
|
edge)
|
|
|
|
KERNELBRANCH='branch:linux-5.17.y'
|
|
KERNELBRANCH="tag:v5.17.5"
|
|
;;
|
|
|
|
esac
|
|
|
|
CPUMIN=200000
|
|
CPUMAX=1300000
|
|
GOVERNOR=ondemand
|
|
|
|
NM_IGNORE_DEVICES="interface-name:eth*,interface-name:wan*,interface-name:lan*,interface-name:br*"
|
|
|
|
write_uboot_platform()
|
|
{
|
|
if [[ $BOARD = macchiatobin-doubleshot ]]; then
|
|
dd if=$1/flash-image.bin of=$2 bs=512 seek=1 status=noxfer > /dev/null 2>&1
|
|
else
|
|
# flashing process via u-boot only for now https://www.armbian.com/espressobin/
|
|
/bin/true
|
|
fi
|
|
}
|
|
|
|
family_tweaks()
|
|
{
|
|
chroot $SDCARD /bin/bash -c "apt-get -y -qq remove --auto-remove linux-sound-base alsa-base alsa-utils bluez>/dev/null 2>&1"
|
|
[[ -f $SDCARD/etc/netplan/armbian-default.yaml ]] && sed -i "s/^ renderer.*/ renderer: networkd/" $SDCARD/etc/netplan/armbian-default.yaml
|
|
cp $SRC/packages/bsp/mvebu64/networkd/10* $SDCARD/etc/systemd/network/
|
|
echo "#Marvell Espressobin Console" >> $SDCARD/etc/securetty
|
|
echo "ttyMV0" >> $SDCARD/etc/securetty
|
|
}
|
|
|
|
family_tweaks_bsp() {
|
|
cp "$SRC/packages/bsp/mvebu64/initramfs/99-uboot-fit" "$destination/etc/initramfs/post-update.d/"
|
|
}
|
|
|
|
atf_custom_postprocess()
|
|
{
|
|
# prepare compilers for postprocess
|
|
ubootdir="$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}"
|
|
export ATF1=$toolchain/$ATF_COMPILER
|
|
if [[ "${SKIP_EXTERNAL_TOOLCHAINS}" == "yes" ]]; then
|
|
export TOOLCHAIN_NAME="arm-linux-gnueabi-"
|
|
else
|
|
export TOOLCHAIN_NAME="arm-none-linux-gnueabihf-"
|
|
fi
|
|
export ATF2=$(find_toolchain "$TOOLCHAIN_NAME" "> 10.0")/$TOOLCHAIN_NAME
|
|
export BL33=$ubootdir"/u-boot.bin"
|
|
}
|
|
|
|
uboot_custom_postprocess()
|
|
{
|
|
# clean previous
|
|
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
|
|
make distclean >> $DEST/debug/compilation.log 2>&1
|
|
|
|
FILENAME="flash-image.bin"
|
|
display_alert "Building $FILENAME" "" "info"
|
|
# http://wiki.macchiatobin.net/tiki-index.php?page=Build+from+source+-+Bootloader#Building_ATF
|
|
make distclean >> $DEST/debug/compilation.log 2>&1
|
|
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 clean
|
|
make CROSS_CM3=$ATF2 wtmi_app.bin
|
|
cd $atfdir
|
|
|
|
clocks=( 600_600 800_800 1000_800 1200_750 )
|
|
topology=( 512m_1cs_0 1g_2cs_2 1g_1cs_4 2g_2cs_7 1g_1cs_5 2g_2cs_6 )
|
|
for i in "${clocks[@]}"
|
|
do
|
|
for j in "${topology[@]}"
|
|
do
|
|
if [[ $j = *cs_5 || $j = *cs_6 ]]; then local ddrname="DDR4"; else ddrname="DDR3"; fi
|
|
FILENAME="flash-image-$ddrname-$j-$i.bin"
|
|
DDR_TOPOLOGY="${j##*_}"
|
|
CLOCKSPRESET="CPU_${i%_*}_DDR_${i##*_}"
|
|
display_alert "Building $FILENAME" "" "info"
|
|
make distclean >> $DEST/debug/compilation.log 2>&1
|
|
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
|
|
|
|
cd $ubootdir
|
|
}
|