mirror of
https://github.com/smaeul/u-boot.git
synced 2025-09-14 14:06:02 +01:00
The following diagram illustrates the boot flow for OP-TEE OS initialization on RISC-V. (1)-----------+ | U-Boot SPL | +------------+ | v (2)-------------------------------------------------------------+ | OpenSBI (fw_dynamic.bin) | | (4)------------------------+ | | | optee dispatcher driver | | +-----------------+-------^---------|-------+------------------+ M-mode | | | ---------+--[trusted domain]---+----.----+--[untrusted domain]------- S-mode | (coldboot domain) | | | v | | v (3)---------------------------+ |(5)----------------------------+ | OP-TEE OS (tee.bin) | | | U-Boot (u-boot-nodtb.bin) | +----------------------------+ | +-----------------------------+ | | | v |(6)----------------------------+ | | Linux | | +-----------------------------+ This patch enables the inclusion of the OP-TEE binary within the U-Boot ITB, allowing it to be loaded to a platform defined address by U-Boot SPL. Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
126 lines
2.3 KiB
Plaintext
126 lines
2.3 KiB
Plaintext
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
/ {
|
|
binman: binman {
|
|
multiple-images;
|
|
};
|
|
};
|
|
|
|
&binman {
|
|
itb {
|
|
|
|
#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
|
|
filename = "u-boot.itb";
|
|
#else
|
|
filename = "linux.itb";
|
|
#endif
|
|
|
|
fit {
|
|
description = "Configuration to load OpenSBI before U-Boot";
|
|
#address-cells = <2>;
|
|
fit,fdt-list = "of-list";
|
|
|
|
images {
|
|
#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
|
|
uboot {
|
|
description = "U-Boot";
|
|
type = "standalone";
|
|
os = "U-Boot";
|
|
arch = "riscv";
|
|
compression = "none";
|
|
load = /bits/ 64 <CONFIG_TEXT_BASE>;
|
|
|
|
uboot_blob: blob-ext {
|
|
filename = "u-boot-nodtb.bin";
|
|
};
|
|
};
|
|
#else
|
|
linux {
|
|
description = "Linux";
|
|
type = "standalone";
|
|
os = "Linux";
|
|
arch = "riscv";
|
|
compression = "none";
|
|
load = /bits/ 64 <CONFIG_TEXT_BASE>;
|
|
|
|
linux_blob: blob-ext {
|
|
filename = "Image";
|
|
};
|
|
};
|
|
#endif
|
|
#ifdef CONFIG_OPTEE
|
|
tee {
|
|
description = "OP-TEE";
|
|
type = "tee";
|
|
arch = "riscv";
|
|
compression = "none";
|
|
os = "tee";
|
|
load = /bits/ 64 <CONFIG_SPL_OPTEE_LOAD_ADDR>;
|
|
tee_blob: tee-os {
|
|
filename = "tee.bin";
|
|
};
|
|
};
|
|
#endif
|
|
|
|
opensbi {
|
|
description = "OpenSBI fw_dynamic Firmware";
|
|
type = "firmware";
|
|
os = "opensbi";
|
|
arch = "riscv";
|
|
compression = "none";
|
|
load = /bits/ 64 <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
|
|
entry = /bits/ 64 <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
|
|
|
|
opensbi_blob: opensbi {
|
|
filename = "fw_dynamic.bin";
|
|
missing-msg = "opensbi";
|
|
};
|
|
};
|
|
|
|
#ifndef CONFIG_OF_BOARD
|
|
@fdt-SEQ {
|
|
description = "NAME";
|
|
type = "flat_dt";
|
|
compression = "none";
|
|
};
|
|
#endif
|
|
};
|
|
|
|
configurations {
|
|
default = "conf-1";
|
|
|
|
#ifndef CONFIG_OF_BOARD
|
|
@conf-SEQ {
|
|
#else
|
|
conf-1 {
|
|
#endif
|
|
description = "NAME";
|
|
firmware = "opensbi";
|
|
#ifdef CONFIG_OPTEE
|
|
#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
|
|
loadables = "linux", "tee";
|
|
#else
|
|
loadables = "uboot", "tee";
|
|
#endif
|
|
#else /* !CONFIG_OPTEEE */
|
|
#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
|
|
loadables = "linux";
|
|
#else
|
|
loadables = "uboot";
|
|
#endif
|
|
#endif /* CONFIG_OPTEE */
|
|
|
|
#ifndef CONFIG_OF_BOARD
|
|
fdt = "fdt-SEQ";
|
|
#endif
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|