These files are for convinience for secure boot testers

File Description
------------------------------------
"gen_fuse" :
	This script should be copied to "BLN_CST_MAIN_01.00.00/crts" and
        run to generate SRK footprint file "SRK_1_2_3_4_fuse.bin"
	The footprint value is also dumped out, they should be written to
	SRK fuse later

"u-boot/mk_secure_uboot"
"zImage/mk_secure_zimage"
"bootimg/mk_secure_bootimg"
"templates/"
	Automatic secure uboot, zImage and android's boot.img generation scripts. These files
	are used for dynamic authentication. It is more convinient and
	adaptive comparing to the original static way.

	Copy "u-boot/mk_secure_uboot" to "BLN_CST_MAIN_01.00.00/u-boot"
	Copy "zImage/mk_secure_zimage" to "BLN_CST_MAIN_01.00.00/zImage"
	Copy "bootimg/mk_secure_bootimg" to "BLN_CST_MAIN_01.00.00/bootimg"
	Copy "templates/" to "BLN_CST_MAIN_01.00.00"

Secure Boot Genreation
------------------------------------
For generating secure uboot
    . copy "u-boot.imx" to "BLN_CST_MAIN_01.00.00/u-boot"
    . "./mk_secure_uboot"
	- the script will auto read the DDR load address from u-boot.imx
    . u-boot-signed-pad.imx will be generated. It is the u-boot image
      with signature
    . it is slightly differrent the script for V2009, where we should
      explicityly specify U-Boot DDR load address as a parameter

For generating secure zImage
    . copy "zImage" to "BLN_CST_MAIN_01.00.00/zImage"
    . "./mk_secure_zimage 0x10800000"
	- where 0x10800000 is the DDR location where zImage is
	  copied to by UBoot, different from platform to platform
    . zimage-signed-pad.bin will be generated. It is the zImage
      with signature

For generating secure boot.img
    . copy "boot.img" to "BLN_CST_MAIN_01.00.00/boot.img"
    . "./mk_secure_bootimg 0x14007800"
	- where 0x14007800 is the DDR location where boot.img is
	  copied to by UBoot, different from platform to platform
    . boot-signed-pad.img will be generated. It is the boot.img
      with signature


Image Layout
------------------------------------
U-Boot
    +-------------------+      DDR_START
    |                   |
    |    U-Boot Image   |
    |                   |
    +-------------------+      DDR_START + UBOOT_SIZE
    |    PADDING        |
    +-------------------+      align to 0x1000
    |    CSF Data       | \
    +-------------------+  +-- CSF + Pad,  Size : 0x2000
    |    PADDING        | /
    +-------------------+

zImage

    +-------------------+      DDR_START
    |                   |
    |     zImage        |
    |                   |
    +-------------------+      DDR_START + UIMAGE_SIZE
    |     PADDING       |
    +-------------------+      align to 0x1000
    |     IVT           | ---- Size : 0x20
    +-------------------+
    |     CSF Data      | \
    +-------------------+  +-- CSF + Pad,  Size : 0x2000
    |     PADDING       | /
    +-------------------+

boot.img

    +-------------------+      DDR_START
    |                   |
    |     boot.img      |
    |                   |
    +-------------------+      DDR_START + BOOTIMG_SIZE
    |     PADDING       |
    +-------------------+      align to 0x1000
    |     IVT           | ---- Size : 0x20
    +-------------------+
    |     CSF Data      | \
    +-------------------+  +-- CSF + Pad,  Size : 0x2000
    |     PADDING       | /
    +-------------------+


DDR Location Parameters
------------------------------------
The DDR location parameter provided to "mk_secure_zimage" script is the
"CONFIG_LOADADDR" defined in include/configs/<plat_name>.h (default). And
can be changed in u-boot command line by "setenv loadaddr=..." with valid
physical address. The following are the default values

	MX6Q/DL ARM2 Socket Board		MX6SL/SX ARM2 Socket Board
	-------------------------		-------------------------
	0x10800000				0x80800000

The DDR location parameter provided to "mk_secure_bootimg" script is the
kernel_addr from boot.img's header minus 0x800. The kernel_addr can be get from
'$od --skip-bytes=12 --read-bytes=4  --format=x4 boot.img |head -1 | awk '{print $2}')'
The following are the default values

	MX6Q/DL SabreSD Board
    ------------------------
	0x14007800

Please refer to "MX6 Linux High Assurance Boot (HAB) User Guide" for
detailed test steps.
