mirror of https://github.com/wolfSSL/wolfBoot.git
Moved FSP_M back to XIP
parent
5c3ace8176
commit
95c7b92762
1
arch.mk
1
arch.mk
|
@ -507,7 +507,6 @@ ifeq ("${FSP}", "1")
|
||||||
OBJS += src/libwolfboot.o
|
OBJS += src/libwolfboot.o
|
||||||
OBJS += src/image.o
|
OBJS += src/image.o
|
||||||
OBJS += src/keystore.o
|
OBJS += src/keystore.o
|
||||||
OBJS += src/sig_fsp_m.o
|
|
||||||
OBJS += src/sig_wolfboot_raw.o
|
OBJS += src/sig_wolfboot_raw.o
|
||||||
OBJS += src/sig_fsp_s.o
|
OBJS += src/sig_fsp_s.o
|
||||||
ifeq ($(TARGET), kontron_vx3060_s2)
|
ifeq ($(TARGET), kontron_vx3060_s2)
|
||||||
|
|
|
@ -59,6 +59,5 @@ MULTIBOOT2=1
|
||||||
64BIT=1
|
64BIT=1
|
||||||
|
|
||||||
STAGE1_AUTH=1
|
STAGE1_AUTH=1
|
||||||
FSP_M_LOAD_BASE=0x0FE2FF00
|
|
||||||
FSP_S_LOAD_BASE=0x0FED5F00
|
FSP_S_LOAD_BASE=0x0FED5F00
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,6 @@ WOLFBOOT_DATA_ADDRESS=0x1000000
|
||||||
FSP_M_BASE=0xffe30000
|
FSP_M_BASE=0xffe30000
|
||||||
FSP_S_BASE=0xffed6000
|
FSP_S_BASE=0xffed6000
|
||||||
FSP_T_BASE=0xfffe0000
|
FSP_T_BASE=0xfffe0000
|
||||||
FSP_M_LOAD_BASE=0x0FE2FF00
|
|
||||||
FSP_S_LOAD_BASE=0x0FED5F00
|
FSP_S_LOAD_BASE=0x0FED5F00
|
||||||
WOLFBOOT_ORIGIN=0xfffa0000
|
WOLFBOOT_ORIGIN=0xfffa0000
|
||||||
LINUX_PAYLOAD=1
|
LINUX_PAYLOAD=1
|
||||||
|
|
|
@ -62,8 +62,6 @@ SECTIONS
|
||||||
|
|
||||||
.fsp_m FSP_M_ORIGIN :
|
.fsp_m FSP_M_ORIGIN :
|
||||||
{
|
{
|
||||||
_fsp_m_hdr = .;
|
|
||||||
KEEP(*(.sig_fsp_m*))
|
|
||||||
_start_fsp_m = .;
|
_start_fsp_m = .;
|
||||||
*(.fsp_m)
|
*(.fsp_m)
|
||||||
_end_fsp_m = .;
|
_end_fsp_m = .;
|
||||||
|
|
|
@ -84,7 +84,6 @@ SECTIONS
|
||||||
.fsp_m FSP_M_ORIGIN :
|
.fsp_m FSP_M_ORIGIN :
|
||||||
{
|
{
|
||||||
_fsp_m_hdr = .;
|
_fsp_m_hdr = .;
|
||||||
KEEP(*(.sig_fsp_m*))
|
|
||||||
_start_fsp_m = .;
|
_start_fsp_m = .;
|
||||||
*(.fsp_m)
|
*(.fsp_m)
|
||||||
_end_fsp_m = .;
|
_end_fsp_m = .;
|
||||||
|
|
|
@ -46,8 +46,6 @@
|
||||||
* the space used by wolfBoot manifest headers to authenticate FSPs
|
* the space used by wolfBoot manifest headers to authenticate FSPs
|
||||||
*/
|
*/
|
||||||
#define HEADER_SIZE IMAGE_HEADER_SIZE
|
#define HEADER_SIZE IMAGE_HEADER_SIZE
|
||||||
const uint8_t __attribute__((section(".sig_fsp_m")))
|
|
||||||
empty_sig_fsp_m[HEADER_SIZE] = {};
|
|
||||||
const uint8_t __attribute__((section(".sig_fsp_s")))
|
const uint8_t __attribute__((section(".sig_fsp_s")))
|
||||||
empty_sig_fsp_s[HEADER_SIZE] = {};
|
empty_sig_fsp_s[HEADER_SIZE] = {};
|
||||||
const uint8_t __attribute__((section(".sig_wolfboot_raw")))
|
const uint8_t __attribute__((section(".sig_wolfboot_raw")))
|
||||||
|
@ -94,7 +92,7 @@ int fsp_machine_update_s_parameters(uint8_t *default_s_params);
|
||||||
int post_temp_ram_init_cb(void);
|
int post_temp_ram_init_cb(void);
|
||||||
|
|
||||||
/* from the linker */
|
/* from the linker */
|
||||||
extern uint8_t _fsp_m_hdr[];
|
extern uint8_t _start_fsp_m[];
|
||||||
extern uint8_t _fsp_s_hdr[];
|
extern uint8_t _fsp_s_hdr[];
|
||||||
extern uint8_t _end_fsp_m[];
|
extern uint8_t _end_fsp_m[];
|
||||||
extern uint8_t _end_fsp_s[];
|
extern uint8_t _end_fsp_s[];
|
||||||
|
@ -144,16 +142,6 @@ static void load_wolfboot(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_fsp_m_to_ram(void)
|
|
||||||
{
|
|
||||||
size_t fsp_m_size;
|
|
||||||
wolfBoot_printf("loading FSP_M at %x..." ENDLINE,
|
|
||||||
(uint32_t)(FSP_M_LOAD_BASE - IMAGE_HEADER_SIZE));
|
|
||||||
fsp_m_size = _end_fsp_m - _fsp_m_hdr;
|
|
||||||
memcpy((uint8_t*)FSP_M_LOAD_BASE - IMAGE_HEADER_SIZE,
|
|
||||||
_fsp_m_hdr, fsp_m_size);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void load_fsp_s_to_ram(void)
|
static void load_fsp_s_to_ram(void)
|
||||||
{
|
{
|
||||||
size_t fsp_s_size;
|
size_t fsp_s_size;
|
||||||
|
@ -238,8 +226,8 @@ static void memory_ready_entry(void *ptr)
|
||||||
uint8_t *fsp_s_base;
|
uint8_t *fsp_s_base;
|
||||||
uint8_t *fsp_m_base;
|
uint8_t *fsp_m_base;
|
||||||
|
|
||||||
|
fsp_m_base = _start_fsp_m;
|
||||||
fsp_s_base = (uint8_t *)(FSP_S_LOAD_BASE);
|
fsp_s_base = (uint8_t *)(FSP_S_LOAD_BASE);
|
||||||
fsp_m_base = (uint8_t *)(FSP_M_LOAD_BASE);
|
|
||||||
|
|
||||||
fsp_info_header =
|
fsp_info_header =
|
||||||
(struct fsp_info_header *)(fsp_m_base + FSP_INFO_HEADER_OFFSET);
|
(struct fsp_info_header *)(fsp_m_base + FSP_INFO_HEADER_OFFSET);
|
||||||
|
@ -356,7 +344,7 @@ void start(uint32_t stack_base, uint32_t stack_top, uint64_t timestamp,
|
||||||
(void)stack_top;
|
(void)stack_top;
|
||||||
(void)timestamp;
|
(void)timestamp;
|
||||||
(void)bist;
|
(void)bist;
|
||||||
fsp_m_base = (uint8_t *)(FSP_M_LOAD_BASE);
|
fsp_m_base = (uint8_t *)(_start_fsp_m);
|
||||||
|
|
||||||
|
|
||||||
status = post_temp_ram_init_cb();
|
status = post_temp_ram_init_cb();
|
||||||
|
@ -366,19 +354,6 @@ void start(uint32_t stack_base, uint32_t stack_top, uint64_t timestamp,
|
||||||
}
|
}
|
||||||
wolfBoot_printf("Cache-as-RAM initialized" ENDLINE);
|
wolfBoot_printf("Cache-as-RAM initialized" ENDLINE);
|
||||||
|
|
||||||
load_fsp_m_to_ram();
|
|
||||||
|
|
||||||
#ifdef STAGE1_AUTH
|
|
||||||
/* Verify FSP_M */
|
|
||||||
//wolfBoot_printf("Authenticating FSP_M at %x..." ENDLINE,
|
|
||||||
// FSP_M_LOAD_BASE - IMAGE_HEADER_SIZE);
|
|
||||||
if (verify_payload((uint8_t *)(FSP_M_LOAD_BASE - IMAGE_HEADER_SIZE)) == 0)
|
|
||||||
wolfBoot_printf("FSP_M: verified OK." ENDLINE);
|
|
||||||
else {
|
|
||||||
panic();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
fsp_m_info_header =
|
fsp_m_info_header =
|
||||||
(struct fsp_info_header *)(fsp_m_base + FSP_INFO_HEADER_OFFSET);
|
(struct fsp_info_header *)(fsp_m_base + FSP_INFO_HEADER_OFFSET);
|
||||||
udp_m_default = fsp_m_base + fsp_m_info_header->CfgRegionOffset;
|
udp_m_default = fsp_m_base + fsp_m_info_header->CfgRegionOffset;
|
||||||
|
|
|
@ -19,7 +19,7 @@ fi
|
||||||
if [ -f "${CONFIG_FILE}" ]
|
if [ -f "${CONFIG_FILE}" ]
|
||||||
then
|
then
|
||||||
FSP_T_BASE=$(grep -Eo '^FSP_T_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_T_BASE=$(grep -Eo '^FSP_T_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
FSP_M_LOAD_BASE=$(grep -Eo '^FSP_M_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_M_BASE=$(grep -Eo '^FSP_M_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
FSP_S_LOAD_BASE=$(grep -Eo '^FSP_S_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_S_LOAD_BASE=$(grep -Eo '^FSP_S_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
else
|
else
|
||||||
echo "Error: ${CONFIG_FILE} file not found in current directory"
|
echo "Error: ${CONFIG_FILE} file not found in current directory"
|
||||||
|
@ -87,9 +87,9 @@ download_edkii
|
||||||
download_sbl_patch_and_patch_edkii
|
download_sbl_patch_and_patch_edkii
|
||||||
build_qemu_fsp
|
build_qemu_fsp
|
||||||
rebase_fsp_component "T" ${FSP_T_BASE}
|
rebase_fsp_component "T" ${FSP_T_BASE}
|
||||||
rebase_fsp_component "M" ${FSP_M_LOAD_BASE}
|
rebase_fsp_component "M" ${FSP_M_BASE}
|
||||||
rebase_fsp_component "S" ${FSP_S_LOAD_BASE}
|
rebase_fsp_component "S" ${FSP_S_LOAD_BASE}
|
||||||
copy_fsp_component "T" ${FSP_T_BASE}
|
copy_fsp_component "T" ${FSP_T_BASE}
|
||||||
copy_fsp_component "M" ${FSP_M_LOAD_BASE}
|
copy_fsp_component "M" ${FSP_M_BASE}
|
||||||
copy_fsp_component "S" ${FSP_S_LOAD_BASE}
|
copy_fsp_component "S" ${FSP_S_LOAD_BASE}
|
||||||
copy_fsp_headers
|
copy_fsp_headers
|
||||||
|
|
|
@ -22,7 +22,7 @@ fi
|
||||||
if [ -f "${CONFIG_FILE}" ]
|
if [ -f "${CONFIG_FILE}" ]
|
||||||
then
|
then
|
||||||
FSP_T_BASE=$(grep -Eo '^FSP_T_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_T_BASE=$(grep -Eo '^FSP_T_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
FSP_M_LOAD_BASE=$(grep -Eo '^FSP_M_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_M_BASE=$(grep -Eo '^FSP_M_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
FSP_S_LOAD_BASE=$(grep -Eo '^FSP_S_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
FSP_S_LOAD_BASE=$(grep -Eo '^FSP_S_LOAD_BASE=.*' ${CONFIG_FILE} | cut -d "=" -f 2)
|
||||||
else
|
else
|
||||||
echo "Error: ${CONFIG_FILE} file not found in current directory"
|
echo "Error: ${CONFIG_FILE} file not found in current directory"
|
||||||
|
|
Loading…
Reference in New Issue