Skip to content
Permalink
Browse files

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

- Adjust u-boot recipe, machine configuration and scripts for SPL

- u-boot: Update to latest revision - include the following commits:

59f3d5d096c mx7dvar_som: Adjust the nand mtd partitions for spl
c833f2da173 autoboot: SDP: Stop setting the environment to default when booting from USB
0e651b54103 mx7dvar_som: Enable SDP support
75480ef4959 mx7dvar_som: Remove CONFIG_MFG_ENV_SETTINGS
58f5288482d imx7: spl: Check for Serial Downloader in spl_boot_device
02ba107f00d imx7: Add src_base structure define macro
8cf3fe84753 mx7dvar_som: Read DDR values and production info from EEPROM
7bcb3a68ac1 mx7dvar_som: Make SPL DDR configuration match the DCD table
78f60df5cfa mx7dvar_som: Add SPL support
96704bf257f mx7dvar_som: Add comments to imximage.cfg
a401f9eb46e Makefile: Build firmware-ivt image type for HAB verification also for mx7
b1410e08cb2 mx7_common: Fix SPL compilation with secure boot support enabled
e3b88a73007 arm: imx: Rework i.MX specific commands to be excluded from SPL
fcf913561f3 imx7: spl: Add support for MMC3, SD3 and NAND boot devices
2e10f07c440 imx7: spl: Use SPL boot device MMC1 for all of the SOC's MMC/SD boot devices
57acd6cb14a imx7: Add include guards for include/asm/arch-mx7/sys_proto.h file
89edf7a87d6 imx: mx7: spl: remove redundant SATA definitionas
d0fa5d8a52f imx: mx7: SPL support for i.MX7
0f3e33092a0 imx: mx7: DDR controller configuration for the i.MX7 architecture
669ddd9bbd7 mx7dvar_som: Fix compilation when CONFIG_VIDEO is disabled

Signed-off-by: Eran Matityahu <eran.m@variscite.com>
  • Loading branch information...
eranmati committed Mar 7, 2018
1 parent 2f7f649 commit 973c9377159e97a323af0973eb1608c98eeb2f5e
@@ -33,11 +33,12 @@ KERNEL_DEVICETREE = " \
KERNEL_IMAGETYPE = "zImage"

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,u-boot-dtb.imx"
UBOOT_CONFIG[nand] = "mx7dvar_som_nand_defconfig,ubifs,u-boot-dtb.imx"
UBOOT_CONFIG[sd] = "mx7dvar_som_defconfig,sdcard"
UBOOT_CONFIG[nand] = "mx7dvar_som_nand_defconfig,ubifs"

MACHINE_EXTRA_RDEPENDS += " \
bcm43xx-wl \
@@ -6,6 +6,6 @@ LIC_FILES_CHKSUM = "file://Licenses/gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a
SRCBRANCH = "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 = "4275213afc5c9b10cc5ee05a0950a332d7364bf2"
SRCREV = "59f3d5d096c269e0e68da72ad94044403f6db805"

S = "${WORKDIR}/git"
@@ -8,8 +8,6 @@ LOCALVERSION_var-som-mx6 = "-mx6"
LOCALVERSION_imx6ul-var-dart = "-mx6ul"
LOCALVERSION_imx7-var-som = "-mx7"

DEPENDS_append_imx7-var-som = " dtc-native"

PROVIDES += "u-boot"

PACKAGE_ARCH = "${MACHINE_ARCH}"
@@ -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
@@ -339,19 +331,14 @@ STR=""
if [[ $BOARD == "mx6ul" ]] ; then
STR="DART-6UL (i.MX6UL)"
IS_SPL=true
elif [[ $BOARD == "mx6ull" ]] ; then
STR="DART-6UL (i.MX6ULL)"
IS_SPL=true
elif [[ $BOARD == "mx6ul5g" ]] ; then
STR="DART-6UL-5G (i.MX6UL)"
IS_SPL=true
elif [[ $BOARD == "mx6ull5g" ]] ; then
STR="DART-6UL-5G (i.MX6ULL)"
IS_SPL=true
elif [[ $BOARD == "mx7" ]] ; then
STR="VAR-SOM-MX7"
IS_SPL=false
else
usage
exit 1
@@ -390,9 +377,10 @@ if [[ $BOARD == mx6ul* ]] ; then
fi
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
@@ -419,7 +407,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
@@ -441,10 +428,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
@@ -458,7 +446,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 973c937

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