blob: 5aeeeddb59f69dae46f242f018aac087ef3ed462 [file] [log] [blame]
Bin Mengced20972021-05-10 20:23:35 +08001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2021, Bin Meng <bmeng.cn@gmail.com>
4 */
5
6#include <config.h>
7
8/ {
9 binman: binman {
10 multiple-images;
11 };
12};
13
14&binman {
15 itb {
Randolph9d17cdb2023-10-12 14:35:05 +080016
17#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Bin Mengced20972021-05-10 20:23:35 +080018 filename = "u-boot.itb";
Randolph9d17cdb2023-10-12 14:35:05 +080019#else
20 filename = "linux.itb";
21#endif
Bin Mengced20972021-05-10 20:23:35 +080022
23 fit {
24 description = "Configuration to load OpenSBI before U-Boot";
Mayuresh Chitale5a3b0182023-10-11 21:00:20 +053025 #address-cells = <2>;
Bin Mengced20972021-05-10 20:23:35 +080026 fit,fdt-list = "of-list";
27
28 images {
Randolph9d17cdb2023-10-12 14:35:05 +080029#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Bin Mengced20972021-05-10 20:23:35 +080030 uboot {
31 description = "U-Boot";
32 type = "standalone";
33 os = "U-Boot";
34 arch = "riscv";
35 compression = "none";
Randolph1a5a8fc2023-11-17 18:39:50 +080036 load = /bits/ 64 <CONFIG_TEXT_BASE>;
Bin Mengced20972021-05-10 20:23:35 +080037
Yao Zi7d058af2025-04-16 16:25:31 +000038 uboot_blob: u-boot-nodtb {
Bin Mengced20972021-05-10 20:23:35 +080039 filename = "u-boot-nodtb.bin";
40 };
41 };
Randolph9d17cdb2023-10-12 14:35:05 +080042#else
43 linux {
44 description = "Linux";
45 type = "standalone";
46 os = "Linux";
47 arch = "riscv";
48 compression = "none";
Randolph1a5a8fc2023-11-17 18:39:50 +080049 load = /bits/ 64 <CONFIG_TEXT_BASE>;
Randolph9d17cdb2023-10-12 14:35:05 +080050
51 linux_blob: blob-ext {
52 filename = "Image";
53 };
54 };
55#endif
Yu-Chien Peter Lin1cf86c62025-01-11 09:55:27 +080056#ifdef CONFIG_OPTEE
57 tee {
58 description = "OP-TEE";
59 type = "tee";
60 arch = "riscv";
61 compression = "none";
62 os = "tee";
63 load = /bits/ 64 <CONFIG_SPL_OPTEE_LOAD_ADDR>;
64 tee_blob: tee-os {
65 filename = "tee.bin";
66 };
67 };
68#endif
Bin Mengced20972021-05-10 20:23:35 +080069
70 opensbi {
71 description = "OpenSBI fw_dynamic Firmware";
72 type = "firmware";
73 os = "opensbi";
74 arch = "riscv";
75 compression = "none";
Randolph1a5a8fc2023-11-17 18:39:50 +080076 load = /bits/ 64 <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
77 entry = /bits/ 64 <CONFIG_SPL_OPENSBI_LOAD_ADDR>;
Bin Mengced20972021-05-10 20:23:35 +080078
79 opensbi_blob: opensbi {
80 filename = "fw_dynamic.bin";
Rick Chenddcdd942023-02-17 16:57:01 +080081 missing-msg = "opensbi";
Bin Mengced20972021-05-10 20:23:35 +080082 };
83 };
84
Heinrich Schuchardt48a48102025-02-21 10:58:53 +010085#if !defined(CONFIG_OF_BOARD) || defined(CONFIG_MULTI_DTB_FIT)
Bin Mengced20972021-05-10 20:23:35 +080086 @fdt-SEQ {
Heinrich Schuchardt48a48102025-02-21 10:58:53 +010087 fit,operation = "gen-fdt-nodes";
Bin Mengced20972021-05-10 20:23:35 +080088 description = "NAME";
89 type = "flat_dt";
90 compression = "none";
91 };
Bin Meng1255ab82021-05-10 20:23:39 +080092#endif
Bin Mengced20972021-05-10 20:23:35 +080093 };
94
95 configurations {
Heinrich Schuchardtace94372025-02-21 10:58:54 +010096
97#ifndef CONFIG_MULTI_DTB_FIT
Bin Mengced20972021-05-10 20:23:35 +080098 default = "conf-1";
Heinrich Schuchardtace94372025-02-21 10:58:54 +010099#endif
Bin Mengced20972021-05-10 20:23:35 +0800100
Heinrich Schuchardt48a48102025-02-21 10:58:53 +0100101#if !defined(CONFIG_OF_BOARD) || defined(CONFIG_MULTI_DTB_FIT)
Bin Mengced20972021-05-10 20:23:35 +0800102 @conf-SEQ {
Bin Meng1255ab82021-05-10 20:23:39 +0800103#else
104 conf-1 {
105#endif
Bin Mengced20972021-05-10 20:23:35 +0800106 description = "NAME";
107 firmware = "opensbi";
Yu-Chien Peter Lin1cf86c62025-01-11 09:55:27 +0800108#ifdef CONFIG_OPTEE
109#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
110 loadables = "linux", "tee";
Randolph9d17cdb2023-10-12 14:35:05 +0800111#else
Yu-Chien Peter Lin1cf86c62025-01-11 09:55:27 +0800112 loadables = "uboot", "tee";
113#endif
114#else /* !CONFIG_OPTEEE */
115#ifdef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Randolph9d17cdb2023-10-12 14:35:05 +0800116 loadables = "linux";
Yu-Chien Peter Lin1cf86c62025-01-11 09:55:27 +0800117#else
118 loadables = "uboot";
Randolph9d17cdb2023-10-12 14:35:05 +0800119#endif
Yu-Chien Peter Lin1cf86c62025-01-11 09:55:27 +0800120#endif /* CONFIG_OPTEE */
121
Heinrich Schuchardt48a48102025-02-21 10:58:53 +0100122#if !defined(CONFIG_OF_BOARD) || defined(CONFIG_MULTI_DTB_FIT)
Bin Mengced20972021-05-10 20:23:35 +0800123 fdt = "fdt-SEQ";
Bin Meng1255ab82021-05-10 20:23:39 +0800124#endif
Bin Mengced20972021-05-10 20:23:35 +0800125 };
126 };
127 };
128 };
129};