Implement bulding and packing all different boot firmware for Espressobin, bump u-boot and ATF sources to latest version 18.09

This commit is contained in:
Igor Pecovnik 2018-09-09 23:22:50 +02:00
parent 89c33218e5
commit fa88e5c2aa
7 changed files with 110 additions and 46 deletions

View File

@ -2,11 +2,11 @@ ARCH=arm64
KERNEL_IMAGE_TYPE=Image
BOOTSCRIPT="boot-espressobin.cmd:boot.cmd"
UBOOT_TARGET_MAP=";;u-boot.bin flash-image.bin"
UBOOT_TARGET_MAP=";;flash-image-*.bin"
BOOTSOURCE='https://github.com/MarvellEmbeddedProcessors/u-boot-marvell.git'
BOOTDIR=$MAINLINE_UBOOT_DIR
BOOTBRANCH='branch:u-boot-2017.03-armada-17.10'
BOOTBRANCH='branch:u-boot-2017.03-armada-18.09'
UBOOT_USE_GCC='< 7.0'
@ -14,9 +14,9 @@ BOOTENV_FILE='clearfog-default.txt'
ATFSOURCE='https://github.com/MarvellEmbeddedProcessors/atf-marvell'
ATFDIR='arm-trusted-firmware-espressobin'
ATFBRANCH='branch:atf-v1.3-armada-17.10'
ATF_USE_GCC='== 4.9'
ATF_COMPILER='arm-linux-gnueabi-'
ATFBRANCH='branch:atf-v1.5-armada-18.09'
ATF_USE_GCC='> 7.2'
ATF_COMPILER='aarch64-linux-gnu-'
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'
case $BRANCH in
default)
@ -54,8 +54,8 @@ NM_IGNORE_DEVICES="interface-name:eth*,interface-name:wan*,interface-name:lan*,i
write_uboot_platform()
{
# dd if=$1/u-boot.mmc of=$2 bs=512 seek=1 status=noxfer > /dev/null 2>&1
/bin/true
# flashing process via u-boot only for now https://www.armbian.com/espressobin/
/bin/true
}
family_tweaks()
@ -67,16 +67,36 @@ family_tweaks()
echo "ttyMV0" >> $SDCARD/etc/securetty
}
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-
export BL33=$ubootdir"/u-boot.bin"
# copy extra DDR topology
cp $SRC/packages/blobs/espressobin/DDR* $SRC/cache/sources/marvell-tools/tim/ddr/
}
uboot_custom_postprocess()
{
local ATF_COMPILER='arm-linux-gnueabi-'
local ATF_USE_GCC='< 6.0'
local atfdir="$SRC/cache/sources/$ATFDIR/${ATFBRANCH##*:}"
local ubootdir="$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}"
toolchain=$(find_toolchain "$ATF_COMPILER" "$ATF_USE_GCC")
cd $atfdir
display_alert "Building boot image" "" "info"
make 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 all fip BL33=$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}/u-boot.bin WTP=../../marvell-tools $CTHREADS CROSS_CM3=$toolchain/$ATF_COMPILER >> $DEST/debug/compilation.log
cp build/a3700/debug/flash-image.bin $ubootdir
clocks=( 600_600 800_800 1000_800 1200_750 )
topology=( 512m_1cs_0 512m_2cs_0 1g_2cs_2 1g_1cs_4 2g_2cs_2 )
for i in "${clocks[@]}"
do
for j in "${topology[@]}"
do
FILENAME="flash-image-$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 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
done
done
cd $ubootdir
}

View File

@ -657,6 +657,8 @@ prepare_host()
"https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu.tar.xz"
"https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabihf.tar.xz"
"https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi.tar.xz"
"https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi.tar.xz"
"https://${ARMBIANSERVER}/_toolchains/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz"
)
for toolchain in ${toolchains[@]}; do

View File

@ -240,7 +240,8 @@ if [[ $IGNORE_UPDATES != yes ]]; then
fi
fetch_from_repo "https://github.com/linux-sunxi/sunxi-tools" "sunxi-tools" "branch:master"
fetch_from_repo "https://github.com/armbian/rkbin" "rkbin-tools" "branch:master"
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:A3700_utils-armada-17.10"
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell" "marvell-tools" "branch:A3700_utils-armada-18.09"
fetch_from_repo "https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git" "marvell-ddr" "branch:mv_ddr-armada-18.09"
fetch_from_repo "https://github.com/armbian/odroidc2-blobs" "odroidc2-blobs" "branch:master"
fetch_from_repo "https://github.com/armbian/testings" "testing-reports" "branch:master"
fi

View File

@ -0,0 +1,22 @@
#
# 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

View File

@ -0,0 +1,22 @@
#
# 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

View File

@ -0,0 +1,29 @@
From 7b0e72b4904b825d6f96d3a2a7c29a08c8b3968a Mon Sep 17 00:00:00 2001
From: Konstantin Porotchkin <kostap@marvell.com>
Date: Wed, 5 Sep 2018 16:56:02 +0300
Subject: [PATCH] drivers: spi: Add support for Macronix mx25u3235f device
Add support for Macronix SPI flash shipped on latest
Espressobin boards
Change-Id: Ia0798dfd4177c407c126e4f823d64d821b755433
Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
---
drivers/mtd/spi/spi_flash_ids.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mtd/spi/spi_flash_ids.c b/drivers/mtd/spi/spi_flash_ids.c
index edca94e..1c50e0d 100644
--- a/drivers/mtd/spi/spi_flash_ids.c
+++ b/drivers/mtd/spi/spi_flash_ids.c
@@ -82,6 +82,7 @@ const struct spi_flash_info spi_flash_ids[] = {
{"mx25l25635f", INFO(0xc22019, 0x0, 64 * 1024, 512, RD_FULL | WR_QPP) },
{"mx25l51235f", INFO(0xc2201a, 0x0, 64 * 1024, 1024, RD_FULL | WR_QPP) },
{"mx25l12855e", INFO(0xc22618, 0x0, 64 * 1024, 256, RD_FULL | WR_QPP) },
+ {"mx25u3235f", INFO(0xc22536, 0x0, 64 * 1024, 64, RD_FULL | WR_QPP) },
{"mx66u51235f", INFO(0xc2253a, 0x0, 64 * 1024, 1024, RD_FULL | WR_QPP) },
{"mx66l1g45g", INFO(0xc2201b, 0x0, 64 * 1024, 2048, RD_FULL | WR_QPP) },
#endif
--
2.7.4

View File

@ -1,32 +0,0 @@
diff --git a/include/configs/mvebu_armada-common.h b/include/configs/mvebu_armada-common.h
index c406a7a..ddd7f5e
--- a/include/configs/mvebu_armada-common.h
+++ b/include/configs/mvebu_armada-common.h
@@ -36,7 +36,7 @@
#define CONFIG_ETHPRIME "eth0"
#define CONFIG_ROOTPATH "/srv/nfs/" /* Default Dir for NFS */
#define CONFIG_EXTRA_ENV_SETTINGS "kernel_addr=0x5000000\0" \
- "initrd_addr=0xa00000\0" \
+ "initrd_addr=0x1100000\0" \
"initrd_size=0x2000000\0" \
"fdt_addr=0x4f00000\0" \
"loadaddr=0x5000000\0" \
@@ -50,7 +50,8 @@
"eth1addr=00:51:82:11:22:01\0" \
"eth2addr=00:51:82:11:22:02\0" \
"eth3addr=00:51:82:11:22:03\0" \
- "image_name=Image\0" \
+ "image_name=boot/Image\0" \
+ "load_script=if test -e mmc 0:1 boot/boot.scr; then echo \"... booting from SD\";setenv boot_interface mmc;else echo \"... booting from USB/SATA\";usb start;setenv boot_interface usb;fi;if test -e $boot_interface 0:1 boot/boot.scr;then ext4load $boot_interface 0:1 0x00800000 boot/boot.scr; source; fi\0" \
"get_ramfs=if test \"${ramfs_name}\"" \
" != \"-\"; then setenv " \
"ramfs_addr 0x8000000; " \
@@ -69,7 +70,7 @@
":$netdev:none nfsroot="\
"$serverip:$rootpath " \
"$extra_params"
-#define CONFIG_BOOTCOMMAND "run get_images; run set_bootargs; " \
+#define CONFIG_BOOTCOMMAND "run get_images; run set_bootargs; run load_script;" \
"booti $kernel_addr $ramfs_addr $fdt_addr"
#define CONFIG_ENV_OVERWRITE /* ethaddr can be reprogrammed */
/*