Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 1 | // 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 Chitale | 5a348cc | 2023-10-11 21:00:20 +0530 | [diff] [blame] | 8 | #define U64_TO_U32_H(addr) (((addr) >> 32) & 0xffffffff) |
| 9 | #define U64_TO_U32_L(addr) ((addr) & 0xffffffff) |
| 10 | |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 11 | / { |
| 12 | binman: binman { |
| 13 | multiple-images; |
| 14 | }; |
| 15 | }; |
| 16 | |
| 17 | &binman { |
| 18 | itb { |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 19 | |
| 20 | #ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 21 | filename = "u-boot.itb"; |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 22 | #else |
| 23 | filename = "linux.itb"; |
| 24 | #endif |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 25 | |
| 26 | fit { |
| 27 | description = "Configuration to load OpenSBI before U-Boot"; |
Mayuresh Chitale | 5a348cc | 2023-10-11 21:00:20 +0530 | [diff] [blame] | 28 | #address-cells = <2>; |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 29 | fit,fdt-list = "of-list"; |
| 30 | |
| 31 | images { |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 32 | #ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 33 | uboot { |
| 34 | description = "U-Boot"; |
| 35 | type = "standalone"; |
| 36 | os = "U-Boot"; |
| 37 | arch = "riscv"; |
| 38 | compression = "none"; |
Mayuresh Chitale | 5a348cc | 2023-10-11 21:00:20 +0530 | [diff] [blame] | 39 | load = <U64_TO_U32_H(CONFIG_TEXT_BASE) |
| 40 | U64_TO_U32_L(CONFIG_TEXT_BASE)>; |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 41 | |
| 42 | uboot_blob: blob-ext { |
| 43 | filename = "u-boot-nodtb.bin"; |
| 44 | }; |
| 45 | }; |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 46 | #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 Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 60 | |
| 61 | opensbi { |
| 62 | description = "OpenSBI fw_dynamic Firmware"; |
| 63 | type = "firmware"; |
| 64 | os = "opensbi"; |
| 65 | arch = "riscv"; |
| 66 | compression = "none"; |
Mayuresh Chitale | 5a348cc | 2023-10-11 21:00:20 +0530 | [diff] [blame] | 67 | 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 Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 71 | |
| 72 | opensbi_blob: opensbi { |
| 73 | filename = "fw_dynamic.bin"; |
Rick Chen | 7574b64 | 2023-02-17 16:57:01 +0800 | [diff] [blame] | 74 | missing-msg = "opensbi"; |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 75 | }; |
| 76 | }; |
| 77 | |
Ilias Apalodimas | 2e8d2f8 | 2021-10-12 00:00:13 +0300 | [diff] [blame] | 78 | #ifndef CONFIG_OF_BOARD |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 79 | @fdt-SEQ { |
| 80 | description = "NAME"; |
| 81 | type = "flat_dt"; |
| 82 | compression = "none"; |
| 83 | }; |
Bin Meng | 756eeba | 2021-05-10 20:23:39 +0800 | [diff] [blame] | 84 | #endif |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 85 | }; |
| 86 | |
| 87 | configurations { |
| 88 | default = "conf-1"; |
| 89 | |
Ilias Apalodimas | 2e8d2f8 | 2021-10-12 00:00:13 +0300 | [diff] [blame] | 90 | #ifndef CONFIG_OF_BOARD |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 91 | @conf-SEQ { |
Bin Meng | 756eeba | 2021-05-10 20:23:39 +0800 | [diff] [blame] | 92 | #else |
| 93 | conf-1 { |
| 94 | #endif |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 95 | description = "NAME"; |
| 96 | firmware = "opensbi"; |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 97 | #ifndef CONFIG_SPL_LOAD_FIT_OPENSBI_OS_BOOT |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 98 | loadables = "uboot"; |
Randolph | d311df8 | 2023-10-12 14:35:05 +0800 | [diff] [blame] | 99 | #else |
| 100 | loadables = "linux"; |
| 101 | #endif |
Ilias Apalodimas | 2e8d2f8 | 2021-10-12 00:00:13 +0300 | [diff] [blame] | 102 | #ifndef CONFIG_OF_BOARD |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 103 | fdt = "fdt-SEQ"; |
Bin Meng | 756eeba | 2021-05-10 20:23:39 +0800 | [diff] [blame] | 104 | #endif |
Bin Meng | 0784510 | 2021-05-10 20:23:35 +0800 | [diff] [blame] | 105 | }; |
| 106 | }; |
| 107 | }; |
| 108 | }; |
| 109 | }; |