Skip to content
Permalink
Browse files

imx7-var-som: u-boot: Add SPL support

- u-boot: Update to the latest Variscite branch,
imx_v2017.03_4.9.11_1.0.0_ga_var01, which is originally based on
the official NXP release imx_v2017.03_4.9.11_1.0.0_ga (which is
based on U-Boot v2017.03), and has added SPL support for VAR-SOM-MX7.

- u-boot-fw-utils: Update mmc env. offset in config file

- Adjust the machine configuration and scripts for SPL

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
  • Loading branch information...
eranmati committed Mar 18, 2018
1 parent fa55000 commit a2eb62a77d106ad9adbfa580176349a6703b6474
@@ -56,7 +56,8 @@ PREFERRED_PROVIDER_u-boot_imx7-var-som = "u-boot-variscite"
PREFERRED_PROVIDER_virtual/bootloader_imx7-var-som = "u-boot-variscite"

UBOOT_MAKE_TARGET = ""
UBOOT_SUFFIX = "imx"
SPL_BINARY = "SPL"
UBOOT_SUFFIX = "img"
UBOOT_CONFIG ??= "nand sd "
# The above order matters. The last one will be also called u-boot-${MACHINE} and will be used to create the sdcard.
UBOOT_CONFIG[sd] = "mx7dvar_som_defconfig,sdcard"
@@ -4,8 +4,10 @@ LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRCBRANCH = "imx_v2015.04_4.1.15_1.1.0_ga_var03"
SRCBRANCH_imx7-var-som = "imx_v2017.03_4.9.11_1.0.0_ga_var01"
UBOOT_SRC = "git://github.com/varigit/uboot-imx.git;protocol=git"
SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}"
SRCREV = "535519be584801399ed4e86d732b81a053d06412"
SRCREV_imx7-var-som = "f7324fd25895bb9e3ea3b45d6a153626e58d9d99"

S = "${WORKDIR}/git"
@@ -9,7 +9,7 @@
/dev/mtd2 0x00000 0x20000 0x20000 1

# Block device example
#/dev/mmcblk0 0x80000 0x2000
#/dev/mmcblk0 0xE0000 0x2000

# VFAT example
#/boot/uboot.env 0x00000 0x4000
@@ -102,13 +102,10 @@ fi

if [[ $MACHINE == var-som-mx6 ]] ; then
FAT_VOLNAME=BOOT-VARMX6
IS_SPL=true
elif [[ $MACHINE == imx6ul-var-dart ]] ; then
FAT_VOLNAME=BOOT-VAR6UL
IS_SPL=true
elif [[ $MACHINE == imx7-var-som ]] ; then
FAT_VOLNAME=BOOT-VARMX7
IS_SPL=false
else
help
exit 1
@@ -240,12 +237,8 @@ function install_bootloader
{
echo
echo "Installing U-Boot"
if [[ $IS_SPL == true ]] ; then
dd if=${YOCTO_IMGS_PATH}/SPL-sd of=${node} bs=1K seek=1; sync
dd if=${YOCTO_IMGS_PATH}/u-boot.img-sd of=${node} bs=1K seek=69; sync
else
dd if=${YOCTO_IMGS_PATH}/u-boot.imx-sd of=${node} bs=1K seek=1; sync
fi
dd if=${YOCTO_IMGS_PATH}/SPL-sd of=${node} bs=1K seek=1; sync
dd if=${YOCTO_IMGS_PATH}/u-boot.img-sd of=${node} bs=1K seek=69; sync
}

function mount_parts
@@ -304,13 +297,10 @@ function copy_images
echo "rootfs.ubi file is not present. Installation on \"NAND flash\" will not be supported."
fi

cp ${YOCTO_RECOVERY_ROOTFS_PATH}/u-boot.im?-nand ${P2_MOUNT_DIR}/opt/images/Yocto/
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/u-boot.im?-sd ${P2_MOUNT_DIR}/opt/images/Yocto/

if [[ $IS_SPL == true ]] ; then
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/SPL-nand ${P2_MOUNT_DIR}/opt/images/Yocto/
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/SPL-sd ${P2_MOUNT_DIR}/opt/images/Yocto/
fi
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/SPL-nand ${P2_MOUNT_DIR}/opt/images/Yocto/
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/SPL-sd ${P2_MOUNT_DIR}/opt/images/Yocto/
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/u-boot.img-nand ${P2_MOUNT_DIR}/opt/images/Yocto/
cp ${YOCTO_RECOVERY_ROOTFS_PATH}/u-boot.img-sd ${P2_MOUNT_DIR}/opt/images/Yocto/
}

function copy_scripts
@@ -17,13 +17,13 @@ fi

check_images()
{
if [[ ! -f $IMGS_PATH/$UBOOT_IMAGE ]] ; then
red_bold_echo "ERROR: \"$IMGS_PATH/$UBOOT_IMAGE\" does not exist"
if [[ ! -f $IMGS_PATH/$SPL_IMAGE ]] ; then
red_bold_echo "ERROR: \"$IMGS_PATH/$SPL_IMAGE\" does not exist"
exit 1
fi

if [[ $IS_SPL == "true" && ! -f $IMGS_PATH/$SPL_IMAGE ]] ; then
red_bold_echo "ERROR: \"$IMGS_PATH/$SPL_IMAGE\" does not exist"
if [[ ! -f $IMGS_PATH/$UBOOT_IMAGE ]] ; then
red_bold_echo "ERROR: \"$IMGS_PATH/$UBOOT_IMAGE\" does not exist"
exit 1
fi

@@ -69,14 +69,10 @@ install_bootloader_to_nand()
blue_underlined_bold_echo "Installing booloader"

flash_erase /dev/mtd0 0 0 2> /dev/null
if [[ $IS_SPL == "true" ]] ; then
kobs-ng init -x $IMGS_PATH/$SPL_IMAGE --search_exponent=1 -v > /dev/null
kobs-ng init -x $IMGS_PATH/$SPL_IMAGE --search_exponent=1 -v > /dev/null

flash_erase /dev/mtd1 0 0 2> /dev/null
nandwrite -p /dev/mtd1 $IMGS_PATH/$UBOOT_IMAGE
else
kobs-ng init -x $IMGS_PATH/$UBOOT_IMAGE --search_exponent=1 -v > /dev/null
fi
flash_erase /dev/mtd1 0 0 2> /dev/null
nandwrite -p /dev/mtd1 $IMGS_PATH/$UBOOT_IMAGE

flash_erase /dev/mtd2 0 0 2> /dev/null
sync
@@ -192,12 +188,8 @@ install_bootloader_to_emmc()
echo
blue_underlined_bold_echo "Installing booloader"
if [[ $IS_SPL == "true" ]] ; then
dd if=${IMGS_PATH}/${SPL_IMAGE} of=${node} bs=1K seek=1; sync
dd if=${IMGS_PATH}/${UBOOT_IMAGE} of=${node} bs=1K seek=69; sync
else
dd if=${IMGS_PATH}/${UBOOT_IMAGE} of=${node} bs=1K seek=1; sync
fi
dd if=${IMGS_PATH}/${SPL_IMAGE} of=${node} bs=1K seek=1; sync
dd if=${IMGS_PATH}/${UBOOT_IMAGE} of=${node} bs=1K seek=69; sync
if [[ $VARSOMMX7_VARIANT == "-m4" || $swupdate == 1 ]] ; then
echo
@@ -317,19 +309,14 @@ STR=""
if [[ $BOARD == "mx6ul" ]] ; then
STR="DART-6UL"
IS_SPL=true
elif [[ $BOARD == "mx6ull" ]] ; then
STR="DART-6ULL"
IS_SPL=true
elif [[ $BOARD == "mx6ul5g" ]] ; then
STR="DART-6UL-5G"
IS_SPL=true
elif [[ $BOARD == "mx6ull5g" ]] ; then
STR="DART-6ULL-5G"
IS_SPL=true
elif [[ $BOARD == "mx7" ]] ; then
STR="VAR-SOM-MX7"
IS_SPL=false
else
usage
exit 1
@@ -368,9 +355,10 @@ printf "Installing to internal storage device: "
blue_bold_echo $STR
if [[ $STORAGE_DEV == "nand" ]] ; then
SPL_IMAGE=SPL-nand
UBOOT_IMAGE=u-boot.img-nand
if [[ $BOARD == mx6ul* ]] ; then
SPL_IMAGE=SPL-nand
UBOOT_IMAGE=u-boot.img-nand
if [[ $BOARD == "mx6ul" ]] ; then
if [[ $DART6UL_VARIANT == "wifi" ]] ; then
KERNEL_DTB=imx6ul-var-dart-nand_wifi.dtb
@@ -397,7 +385,6 @@ if [[ $STORAGE_DEV == "nand" ]] ; then
fi
fi
elif [[ $BOARD == "mx7" ]] ; then
UBOOT_IMAGE=u-boot.imx-nand
KERNEL_DTB=imx7d-var-som-nand${VARSOMMX7_VARIANT}.dtb
fi
@@ -419,10 +406,11 @@ elif [[ $STORAGE_DEV == "emmc" ]] ; then
blue_bold_echo "Creating two rootfs partitions"
fi
SPL_IMAGE=SPL-sd
UBOOT_IMAGE=u-boot.img-sd
if [[ $BOARD == mx6ul* ]] ; then
block=mmcblk1
SPL_IMAGE=SPL-sd
UBOOT_IMAGE=u-boot.img-sd
if [[ $BOARD == "mx6ul" || $BOARD == "mx6ul5g" ]] ; then
KERNEL_DTBS="imx6ul-var-dart-emmc_wifi.dtb
imx6ul-var-dart-5g-emmc_wifi.dtb
@@ -436,7 +424,6 @@ elif [[ $STORAGE_DEV == "emmc" ]] ; then
fi
elif [[ $BOARD == "mx7" ]] ; then
block=mmcblk2
UBOOT_IMAGE=u-boot.imx-sd
KERNEL_DTBS=imx7d-var-som-emmc*.dtb
FAT_VOLNAME=BOOT-VARMX7
fi

0 comments on commit a2eb62a

Please sign in to comment.
You can’t perform that action at this time.