From e2e0959b78039a40667ed2946f57434d5da7e5c1 Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Mon, 2 Oct 2017 15:23:06 +0200 Subject: [PATCH] Espressobin. Building atf'+u-boot for SPI nor flash (800/800/1M) working, auto booting from SD/USB should work (tested for SD at the moment), armbianEnv.txt loading, UUID support --- config/bootscripts/boot-espressobin.cmd | 35 ++++++++++++++----- config/sources/mvebu64.conf | 4 +-- .../u-boot-mvebu64/loading-uboot-script.patch | 24 ++++++++----- 3 files changed, 45 insertions(+), 18 deletions(-) diff --git a/config/bootscripts/boot-espressobin.cmd b/config/bootscripts/boot-espressobin.cmd index 605efe0dd4..8c96ce567f 100644 --- a/config/bootscripts/boot-espressobin.cmd +++ b/config/bootscripts/boot-espressobin.cmd @@ -1,13 +1,32 @@ -setenv boot_interface mmc -setenv image_name boot/Image -setenv fdt_name_a boot/dtb/marvell/armada-3720-community.dtb -setenv fdt_name_b boot/dtb/marvell/armada-3720-espressobin.dtb -setenv fdt_high "0xffffffffffffffff" +# DO NOT EDIT THIS FILE +# +# Please edit /boot/armbianEnv.txt to set supported parameters +# + +# default values setenv rootdev "/dev/mmcblk0p1" -setenv rootfstype "ext4" setenv verbosity "1" -setenv initrd_addr "0x1100000" +setenv rootfstype "ext4" + +# additional values setenv initrd_image "boot/uInitrd" setenv ethaddr "F0:AD:4E:03:64:7F" -setenv bootcmd 'mmc dev 0; ext4load mmc 0:1 $kernel_addr $image_name;ext4load mmc 0:1 $initrd_addr $initrd_image; ext4load mmc 0:1 $fdt_addr $fdt_name_a;ext4load mmc 0:1 $fdt_addr $fdt_name_b;setenv bootargs $console root=$rootdev rw rootwait; booti $kernel_addr $initrd_addr $fdt_addr' + +if test -e ${boot_interface} 0 /boot/armbianEnv.txt; then + load ${boot_interface} 0 ${loadaddr} /boot/armbianEnv.txt + env import -t ${loadaddr} ${filesize} +fi + +setenv bootargs "$console root=${rootdev} rootfstype=${rootfstype} rootwait loglevel=${verbosity} usb-storage.quirks=${usbstoragequirks} ${extraargs}" + +setenv fdt_name_a boot/dtb/marvell/armada-3720-community.dtb +setenv fdt_name_b boot/dtb/marvell/armada-3720-espressobin.dtb + +ext4load $boot_interface 0:1 $kernel_addr $image_name +ext4load $boot_interface 0:1 $initrd_addr $initrd_image +ext4load $boot_interface 0:1 $fdt_addr $fdt_name_a +ext4load $boot_interface 0:1 $fdt_addr $fdt_name_b + +booti $kernel_addr $initrd_addr $fdt_addr +# mkimage -C none -A arm -T script -d /boot/boot.cmd /boot/boot.scr diff --git a/config/sources/mvebu64.conf b/config/sources/mvebu64.conf index f83d8fe03f..e81a7e197e 100644 --- a/config/sources/mvebu64.conf +++ b/config/sources/mvebu64.conf @@ -20,7 +20,7 @@ ATFDIR='arm-trusted-firmware-espressobin' ATFBRANCH='branch:atf-v1.3-armada-17.10' ATF_USE_GCC='== 4.9' ATF_COMPILER='arm-linux-gnueabi-' -ATF_TARGET_MAP='DEBUG=1 USE_COHERENT_MEM=0 LOG_LEVEL=20 SECURE=0 CLOCKSPRESET=CPU_800_DDR_800 DDR_TOPOLOGY=2 BOOTDEV=EMMCNORM PARTNUM=0 PLAT=a3700;;build/a3700/debug/bl31.bin' +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) KERNELSOURCE='https://github.com/MarvellEmbeddedProcessors/linux-marvell.git' @@ -75,7 +75,7 @@ uboot_custom_postprocess() 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=EMMCNORM PARTNUM=0 PLAT=a3700 all fip BL33=$SRC/cache/sources/$BOOTDIR/${BOOTBRANCH##*:}/u-boot.bin WTP=../../marvell-tools $CTHREADS CROSS_COMPILE=$ATF_COMPILER > /dev/null 2>&1 + 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_COMPILE=$ATF_COMPILER > /dev/null 2>&1 cp build/a3700/debug/flash-image.bin $ubootdir cd $ubootdir } \ No newline at end of file diff --git a/patch/u-boot/u-boot-mvebu64/loading-uboot-script.patch b/patch/u-boot/u-boot-mvebu64/loading-uboot-script.patch index 03f16e9a6a..ef6ef64827 100644 --- a/patch/u-boot/u-boot-mvebu64/loading-uboot-script.patch +++ b/patch/u-boot/u-boot-mvebu64/loading-uboot-script.patch @@ -1,21 +1,29 @@ diff --git a/include/configs/mvebu_armada-common.h b/include/configs/mvebu_armada-common.h old mode 100644 new mode 100755 -index c406a7a..5677a0a +index c406a7a..ddd7f5e --- a/include/configs/mvebu_armada-common.h +++ b/include/configs/mvebu_armada-common.h -@@ -51,6 +51,10 @@ +@@ -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" \ -+ "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" \ +- "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 +73,7 @@ +@@ -69,7 +70,7 @@ ":$netdev:none nfsroot="\ "$serverip:$rootpath " \ "$extra_params"