blob: 6b4eb8dc7b9c9f21654c6cd7c0acb1c2c0875945 [file] [log] [blame]
Bin Meng07845102021-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
Mayuresh Chitale5a348cc2023-10-11 21:00:20 +05308#define U64_TO_U32_H(addr) (((addr) >> 32) & 0xffffffff)
9#define U64_TO_U32_L(addr) ((addr) & 0xffffffff)
10
Bin Meng07845102021-05-10 20:23:35 +080011/ {
12 binman: binman {
13 multiple-images;
14 };
15};
16
17&binman {
18 itb {
Randolphd311df82023-10-12 14:35:05 +080019
20#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Bin Meng07845102021-05-10 20:23:35 +080021 filename = "u-boot.itb";
Randolphd311df82023-10-12 14:35:05 +080022#else
23 filename = "linux.itb";
24#endif
Bin Meng07845102021-05-10 20:23:35 +080025
26 fit {
27 description = "Configuration to load OpenSBI before U-Boot";
Mayuresh Chitale5a348cc2023-10-11 21:00:20 +053028 #address-cells = <2>;
Bin Meng07845102021-05-10 20:23:35 +080029 fit,fdt-list = "of-list";
30
31 images {
Randolphd311df82023-10-12 14:35:05 +080032#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Bin Meng07845102021-05-10 20:23:35 +080033 uboot {
34 description = "U-Boot";
35 type = "standalone";
36 os = "U-Boot";
37 arch = "riscv";
38 compression = "none";
Mayuresh Chitale5a348cc2023-10-11 21:00:20 +053039 load = <U64_TO_U32_H(CONFIG_TEXT_BASE)
40 U64_TO_U32_L(CONFIG_TEXT_BASE)>;
Bin Meng07845102021-05-10 20:23:35 +080041
42 uboot_blob: blob-ext {
43 filename = "u-boot-nodtb.bin";
44 };
45 };
Randolphd311df82023-10-12 14:35:05 +080046#else
47 linux {
48 description = "Linux";
49 type = "standalone";
50 os = "Linux";
51 arch = "riscv";
52 compression = "none";
53 load = <CONFIG_TEXT_BASE>;
54
55 linux_blob: blob-ext {
56 filename = "Image";
57 };
58 };
59#endif
Bin Meng07845102021-05-10 20:23:35 +080060
61 opensbi {
62 description = "OpenSBI fw_dynamic Firmware";
63 type = "firmware";
64 os = "opensbi";
65 arch = "riscv";
66 compression = "none";
Mayuresh Chitale5a348cc2023-10-11 21:00:20 +053067 load = <U64_TO_U32_H(CONFIG_SPL_OPENSBI_LOAD_ADDR)
68 U64_TO_U32_L(CONFIG_SPL_OPENSBI_LOAD_ADDR)>;
69 entry = <U64_TO_U32_H(CONFIG_SPL_OPENSBI_LOAD_ADDR)
70 U64_TO_U32_L(CONFIG_SPL_OPENSBI_LOAD_ADDR)>;
Bin Meng07845102021-05-10 20:23:35 +080071
72 opensbi_blob: opensbi {
73 filename = "fw_dynamic.bin";
Rick Chen7574b642023-02-17 16:57:01 +080074 missing-msg = "opensbi";
Bin Meng07845102021-05-10 20:23:35 +080075 };
76 };
77
Ilias Apalodimas2e8d2f82021-10-12 00:00:13 +030078#ifndef CONFIG_OF_BOARD
Bin Meng07845102021-05-10 20:23:35 +080079 @fdt-SEQ {
80 description = "NAME";
81 type = "flat_dt";
82 compression = "none";
83 };
Bin Meng756eeba2021-05-10 20:23:39 +080084#endif
Bin Meng07845102021-05-10 20:23:35 +080085 };
86
87 configurations {
88 default = "conf-1";
89
Ilias Apalodimas2e8d2f82021-10-12 00:00:13 +030090#ifndef CONFIG_OF_BOARD
Bin Meng07845102021-05-10 20:23:35 +080091 @conf-SEQ {
Bin Meng756eeba2021-05-10 20:23:39 +080092#else
93 conf-1 {
94#endif
Bin Meng07845102021-05-10 20:23:35 +080095 description = "NAME";
96 firmware = "opensbi";
Randolphd311df82023-10-12 14:35:05 +080097#ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT
Bin Meng07845102021-05-10 20:23:35 +080098 loadables = "uboot";
Randolphd311df82023-10-12 14:35:05 +080099#else
100 loadables = "linux";
101#endif
Ilias Apalodimas2e8d2f82021-10-12 00:00:13 +0300102#ifndef CONFIG_OF_BOARD
Bin Meng07845102021-05-10 20:23:35 +0800103 fdt = "fdt-SEQ";
Bin Meng756eeba2021-05-10 20:23:39 +0800104#endif
Bin Meng07845102021-05-10 20:23:35 +0800105 };
106 };
107 };
108 };
109};