Hi Yibeom,
i.MX6/7 are the same as that of i.MX8MM & I.MX8MQ. but i.MX6/7 should be u-boot.imx. so you should modify the script for yours.
(1) _flash.bin ---> u-boot.imx
# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f _flash.bin (Here _flash.bin should be replaced with u-boot.imx)
That is : SDP: boot -f u-boot.imx
Other lines including _flash.bin should be changed by u-boot.imx
(2) _Image ---- > zImage
change it please!
(3) _board.dtb --- > your dtb's name in linux kernel
change it , please!
(4) _initramfs.cpio.gz.uboot --- >Using the one provided in Demo Image.
In our demo image, the ramfs has been provided, you don't need to recompile it. Name should be changed to be
fsl-image-mfgtool-initramfs-imx_mfgtools.cpio.gz.u-boot
(5) optee
comment these 2 lines if there is no optee.
#FBK: ucp _uTee.tar t:/tmp/op.tar
#FBK: ucmd tar -xf /tmp/op.tar -C /mnt/fat
(6)_rootfs.tar.bz2 --- > your roofs's name
change it , please!
the working flow of uuu script is :
(1) Loading u-boot-imx / kernel dtb / zImage / ramfs to DDR , then run it.
(2) writing u-boot-imx / kernel dtb / zImage & rootfs to eMMC or other flash on board.
[comment]
In the script, u-boot can write itself to eMMC. the command is to do it.
FB: flash bootloader _flash.bin
If you don't want u-boot to do it, you can commment the line.
So if you understand how the script is working, you can seperate 3 script: flashing u-boot, flashing dtb & zImage, flashing rootfs. for example, u-boot-script.uuu, zImage-dtb.uuu & rootfs-script.uuu.
then using these commands to flash them to eMMC:
# uuu u-boot-script.uuu
# uuu zImage-dtb.uuu
# uuu rootfs-script.uuu
Pay attention to this: each script should have these commands at begining:
------------------------------------------
uuu_version 1.2.39
# Please Replace below items with actually file names
# @_flash.bin | boot loader
# @_Image | kernel image, arm64 is Image, arm32 it is zImage
# @_board.dtb | board dtb file
# @_initramfs.cpio.gz.uboot | mfgtool init ramfs
# @_rootfs.tar.bz2 | rootfs
# @_uTee.tar | optee image, put dummy _uTee.tar file here if platform is not MX6/MX7*
# This command will be run when i.MX6/7 i.MX8MM, i.MX8MQ
SDP: boot -f u-boot.imx
# This command will be run when ROM support stream mode
# i.MX8QXP, i.MX8QM
#SDPS: boot -f _flash.bin
# These commands will be run when use SPL and will be skipped if no spl
# SDPU will be deprecated. please use SDPV instead of SDPU
#
SDPU: delay 1000
SDPU: write -f u-boot.imx -offset 0x57c00
SDPU: jump
# }
# These commands will be run when use SPL and will be skipped if no spl
# if (SPL support SDPV)
# {
SDPV: delay 1000
SDPV: write -f u-boot.imx -skipspl
SDPV: jump
# }
# use uboot burn bootloader to eMMC
# becaue difference chip, offset is difference
# you can use kernel to do that for specific boards
FB: ucmd setenv fastboot_dev mmc
FB: ucmd setenv mmcdev ${emmc_dev}
# if you don't want to write u-boot.imx to eMMC here, comment below line, please!
FB: flash bootloader u-boot.imx
FB: ucmd if env exists emmc_ack; then ; else setenv emmc_ack 0; fi;
FB: ucmd setenv emmc_cmd mmc partconf ${emmc_dev} ${emmc_ack} 1 0
FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi
FB: ucmd setenv emmc_cmd mmc bootbus ${emmc_dev} 2 2 1;
FB: ucmd if test "${emmc_skip_fb}" != "yes"; then run emmc_cmd; fi
FB: ucmd setenv fastboot_buffer ${loadaddr}
FB: download -f _Image
FB: ucmd setenv fastboot_buffer ${fdt_addr}
FB: download -f _board.dtb
FB: ucmd setenv fastboot_buffer ${initrd_addr}
FB: download -f _initramfs.cpio.gz.uboot
#FB: ucmd setenv bootargs console=${console},${baudrate} earlycon=${earlycon},${baudrate}
FB: acmd ${kboot} ${loadaddr} ${initrd_addr} ${fdt_addr}
-----------------------------------------------------
Above commands can ensure OS Firmware to run in DDR, then begin to write kernel dtb / zImage and rootfs to eMMC.
if you like, you can seperate it to 3 scripts for your purpose.
In addition, it is very simple to flash u-boot, only one command you need:
# uuu -b emmc u-boot.imx
Hope above description is helpful to you.
Have a nice day!
B.R,
Weidong