在线时间3 小时
UID3107453
注册时间2015-3-16
NXP金币0
该用户从未签到
新手上路

- 积分
- 33
- 最后登录
- 2018-8-13
|

楼主 |
发表于 2016-8-13 13:29:16
|
显示全部楼层
请问请问在freescale的patch中 ,在power_prep.c 加上:
/*
* HAB authentication related structures
*/
extern int __hab_data; /* defined in link.lds */
extern int __hab_data_end;
struct _hab_aut {
hab_ivt_t ivt;
uint32_t img_len;
};
struct _hab_aut input_ivt __attribute__((section(".ivt"),aligned(4))) = {
{
/** @ref hdr word with tag #HAB_TAG_IVT, length and HAB version fields
* (see @ref data)
*/
IVT_HDR(sizeof(struct hab_ivt), HAB_VER(4, 0)),
/** Absolute address of the first instruction to execute from the
* image
*/
(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,
/** Absolute address of the Boot Data: may be NULL, but not interpreted
* any further by HAB
*/
NULL,
/** Absolute address of the IVT.*/
(const void*) (&input_ivt),
/** Absolute address of the image CSF (HAB data generated by cst).*/
(const void*) (&__hab_data),
/** Reserved in this version of HAB: should be zero. */
0
},
/** Total image length including HAB csf data */
(const void*) (&__hab_data_end) - BASE_ADDR
};
然后 link.lds中改成:
OUTPUT_ARCH(arm)
ENTRY(_start)
SECTIONS
{
. = 0x00000010;
. = ALIGN(4);
BASE_ADDR = .;
.text : { *(.text) }
. = ALIGN(4);
.ivt : { *(.ivt) }
. = ALIGN(4);
.data : { *(.data) }
/* reserve this area to store HAB related data such as
* CSF commands, certificates and signatures
*/
. = BASE_ADDR + 0x4000;
__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 boot_prep binary as small as possible
*/
. = ALIGN(4);
.bss : { *(.bss) }
}
这样 最终 IVT的地址 &input_ivt 值是多少? 看不懂 linux 这部分链接的脚步啊 |
|