User`s guide

Secure Boot with i.MX28 HAB Version 4, Rev. 1
16 Freescale Semiconductor
Designing for code signing
/* reserve this area to store HAB related data such as
* CSF commands, certificates and signatures
*/
__hab_data = .;
. = . + 0x2000;
__hab_data_end = .;
/* place the __hab_data memory region before the .bss
* region to avoid being over written at runtime and to
* keep the u-boot binary as small as possible
*/
. = ALIGN(4);
.bss : { *(.bss) }
}
2. The next step is to add the IVT data structure, image length and symbol name input_ivt to
locate the IVT data structure in memory. Following is a typical implementation of input_ivt
that includes IVT data structure and followed by the “Image Length” field containing the length
of the entire image including HAB data. Note the use of symbol __hab_data in initialization of
*csf pointer in IVT and the use of __hab_data_end and BASE_ADDR in calculating the
length of the image.
#include <hab.h> /* hab_ivt_t is defined in hab.h */
struct _hab_aut {
hab_ivt_t ivt;
uint32_t img_len;
};
const struct _hab_aut input_ivt __attribute__((section(".data"),aligned(4))) = {
{
// hdr word with tag #HAB_TAG_IVT, length and HAB version fields
IVT_HDR(sizeof(struct hab_ivt), HAB_VER(4, 0)),
// Absolute address of the first instruction to execute
(hab_image_entry_f) (&_start),
// Reserved in this version of HAB: should be NULL
NULL,
// Absolute address of the image DCD: may be NULL
NULL,