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 19, 2018
1 parent 44a20e5 commit 41c2eaa1d0158994bfbebec59b4aa45d2ac7bd21
@@ -56,7 +56,8 @@ PREFERRED_PROVIDER_u-boot_imx7-var-som = "u-boot-variscite"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-variscite" PREFERRED_PROVIDER_virtual/bootloader = "u-boot-variscite"


UBOOT_MAKE_TARGET = "" UBOOT_MAKE_TARGET = ""
UBOOT_SUFFIX = "imx" SPL_BINARY = "SPL"
UBOOT_SUFFIX = "img"
UBOOT_CONFIG ??= "nand sd " UBOOT_CONFIG ??= "nand sd "
UBOOT_CONFIG[sd] = "mx7dvar_som_defconfig,sdcard" UBOOT_CONFIG[sd] = "mx7dvar_som_defconfig,sdcard"
UBOOT_CONFIG[nand] = "mx7dvar_som_nand_defconfig,ubifs" UBOOT_CONFIG[nand] = "mx7dvar_som_nand_defconfig,ubifs"
@@ -5,7 +5,7 @@ SECTION = "bootloader"
DEPENDS = "mtd-utils" DEPENDS = "mtd-utils"


SRCBRANCH_imx6ul-var-dart = "imx_v2015.10_dart_6ul_var1" SRCBRANCH_imx6ul-var-dart = "imx_v2015.10_dart_6ul_var1"
SRCBRANCH_imx7-var-som = "imx_v2015.04_4.1.15_1.1.0_ga_var02" 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" UBOOT_SRC = "git://github.com/varigit/uboot-imx.git;protocol=git"
SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}" SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}"
SRCREV = "${AUTOREV}" SRCREV = "${AUTOREV}"
@@ -9,7 +9,7 @@
/dev/mtd2 0x00000 0x20000 0x20000 1 /dev/mtd2 0x00000 0x20000 0x20000 1


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


# VFAT example # VFAT example
#/boot/uboot.env 0x00000 0x4000 #/boot/uboot.env 0x00000 0x4000
@@ -7,7 +7,7 @@ LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263" LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263"


SRCBRANCH_mx6ul = "imx_v2015.10_dart_6ul_var1" SRCBRANCH_mx6ul = "imx_v2015.10_dart_6ul_var1"
SRCBRANCH_mx7 = "imx_v2015.04_4.1.15_1.1.0_ga_var02" SRCBRANCH_mx7 = "imx_v2017.03_4.9.11_1.0.0_ga_var01"
UBOOT_SRC = "git://github.com/varigit/uboot-imx.git;protocol=git" UBOOT_SRC = "git://github.com/varigit/uboot-imx.git;protocol=git"
SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}" SRC_URI = "${UBOOT_SRC};branch=${SRCBRANCH}"
SRCREV = "${AUTOREV}" SRCREV = "${AUTOREV}"
@@ -38,10 +38,8 @@ fi


if [[ $MACHINE == imx6ul-var-dart ]] ; then if [[ $MACHINE == imx6ul-var-dart ]] ; then
FAT_VOLNAME=BOOT-VAR6UL FAT_VOLNAME=BOOT-VAR6UL
IS_SPL=true
elif [[ $MACHINE == imx7-var-som ]] ; then elif [[ $MACHINE == imx7-var-som ]] ; then
FAT_VOLNAME=BOOT-VARMX7 FAT_VOLNAME=BOOT-VARMX7
IS_SPL=false
else else
help help
exit 1 exit 1
@@ -168,12 +166,8 @@ function install_bootloader
echo echo
echo "Installing U-Boot" 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}/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
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
} }


function mount_parts function mount_parts
@@ -221,13 +215,10 @@ function copy_images
pv ${YOCTO_IMGS_PATH}/fsl-image-gui-${MACHINE}.tar.bz2 > ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.tar.bz2 pv ${YOCTO_IMGS_PATH}/fsl-image-gui-${MACHINE}.tar.bz2 > ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.tar.bz2
pv ${YOCTO_IMGS_PATH}/fsl-image-gui-${MACHINE}.ubi > ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.ubi pv ${YOCTO_IMGS_PATH}/fsl-image-gui-${MACHINE}.ubi > ${P2_MOUNT_DIR}/opt/images/Yocto/rootfs.ubi


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

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


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


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


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


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


flash_erase /dev/mtd0 0 0 2> /dev/null 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 flash_erase /dev/mtd1 0 0 2> /dev/null
nandwrite -p /dev/mtd1 $IMGS_PATH/$UBOOT_IMAGE 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/mtd2 0 0 2> /dev/null flash_erase /dev/mtd2 0 0 2> /dev/null
sync sync
@@ -134,12 +130,8 @@ install_bootloader_to_emmc()
echo echo
blue_underlined_bold_echo "Installing booloader" 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}/${SPL_IMAGE} of=${node} bs=1K seek=1; sync dd if=${IMGS_PATH}/${UBOOT_IMAGE} of=${node} bs=1K seek=69; 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
} }
install_kernel_to_emmc() install_kernel_to_emmc()
@@ -220,10 +212,8 @@ STR=""
if [[ $BOARD == "mx6ul" ]] ; then if [[ $BOARD == "mx6ul" ]] ; then
STR="DART-6UL" STR="DART-6UL"
IS_SPL=true
elif [[ $BOARD == "mx7" ]] ; then elif [[ $BOARD == "mx7" ]] ; then
STR="VAR-SOM-MX7" STR="VAR-SOM-MX7"
IS_SPL=false
else else
usage usage
exit 1 exit 1
@@ -262,16 +252,16 @@ blue_bold_echo $STR
if [[ $STORAGE_DEV == "nand" ]] ; then if [[ $STORAGE_DEV == "nand" ]] ; then
SPL_IMAGE=SPL-nand
UBOOT_IMAGE=u-boot.img-nand
if [[ $BOARD == "mx6ul" ]] ; then if [[ $BOARD == "mx6ul" ]] ; then
SPL_IMAGE=SPL-nand
UBOOT_IMAGE=u-boot.img-nand
if [[ $DART6UL_VARIANT == "wifi" ]] ; then if [[ $DART6UL_VARIANT == "wifi" ]] ; then
KERNEL_DTB=imx6ul-var-dart-nand_wifi.dtb KERNEL_DTB=imx6ul-var-dart-nand_wifi.dtb
elif [[ $DART6UL_VARIANT == "sd" ]] ; then elif [[ $DART6UL_VARIANT == "sd" ]] ; then
KERNEL_DTB=imx6ul-var-dart-sd_nand.dtb KERNEL_DTB=imx6ul-var-dart-sd_nand.dtb
fi fi
elif [[ $BOARD == "mx7" ]] ; then elif [[ $BOARD == "mx7" ]] ; then
UBOOT_IMAGE=u-boot.imx-nand
KERNEL_DTB=imx7d-var-som-nand.dtb KERNEL_DTB=imx7d-var-som-nand.dtb
fi fi
@@ -289,14 +279,14 @@ if [[ $STORAGE_DEV == "nand" ]] ; then
install_kernel_to_nand install_kernel_to_nand
install_rootfs_to_nand install_rootfs_to_nand
elif [[ $STORAGE_DEV == "emmc" ]] ; then elif [[ $STORAGE_DEV == "emmc" ]] ; then
SPL_IMAGE=SPL-sd
UBOOT_IMAGE=u-boot.img-sd
if [[ $BOARD == "mx6ul" ]] ; then if [[ $BOARD == "mx6ul" ]] ; then
block=mmcblk1 block=mmcblk1
SPL_IMAGE=SPL-sd
UBOOT_IMAGE=u-boot.img-sd
FAT_VOLNAME=BOOT-VAR6UL FAT_VOLNAME=BOOT-VAR6UL
elif [[ $BOARD == "mx7" ]] ; then elif [[ $BOARD == "mx7" ]] ; then
block=mmcblk2 block=mmcblk2
UBOOT_IMAGE=u-boot.imx-sd
FAT_VOLNAME=BOOT-VARMX7 FAT_VOLNAME=BOOT-VARMX7
fi fi
node=/dev/${block} node=/dev/${block}

0 comments on commit 41c2eaa

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