Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | /* |
| 3 | * Copyright (C) 2019 Jagan Teki <jagan@amarulasolutions.com> |
| 4 | */ |
| 5 | |
| 6 | #include <config.h> |
| 7 | |
| 8 | / { |
Simon Glass | 88315f7 | 2020-07-19 13:55:57 -0600 | [diff] [blame] | 9 | binman: binman { |
| 10 | multiple-images; |
| 11 | }; |
| 12 | }; |
| 13 | |
Jagan Teki | ffce0ff | 2023-01-27 12:51:33 +0530 | [diff] [blame] | 14 | #ifdef CONFIG_SPL |
Simon Glass | 88315f7 | 2020-07-19 13:55:57 -0600 | [diff] [blame] | 15 | &binman { |
| 16 | simple-bin { |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 17 | filename = "u-boot-rockchip.bin"; |
| 18 | pad-byte = <0xff>; |
| 19 | |
Quentin Schulz | 8c9b9fe | 2022-09-02 15:10:51 +0200 | [diff] [blame] | 20 | mkimage { |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 21 | filename = "idbloader.img"; |
Quentin Schulz | 8c9b9fe | 2022-09-02 15:10:51 +0200 | [diff] [blame] | 22 | args = "-n", CONFIG_SYS_SOC, "-T", "rksd"; |
Quentin Schulz | 8c9b9fe | 2022-09-02 15:10:51 +0200 | [diff] [blame] | 23 | multiple-data-files; |
| 24 | |
Jonas Karlman | 38ad6c9 | 2023-02-25 19:01:34 +0000 | [diff] [blame] | 25 | #ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL |
| 26 | rockchip-tpl { |
| 27 | }; |
| 28 | #elif defined(CONFIG_TPL) |
Quentin Schulz | 8c9b9fe | 2022-09-02 15:10:51 +0200 | [diff] [blame] | 29 | u-boot-tpl { |
| 30 | }; |
| 31 | #endif |
| 32 | u-boot-spl { |
| 33 | }; |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 34 | }; |
| 35 | |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 36 | #if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)) |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 37 | fit: fit { |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 38 | #ifdef CONFIG_ARM64 |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 39 | description = "FIT image for U-Boot with bl31 (TF-A)"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 40 | #else |
| 41 | description = "FIT image with OP-TEE"; |
| 42 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 43 | #address-cells = <1>; |
| 44 | fit,fdt-list = "of-list"; |
Quentin Schulz | d9ffa5e | 2022-09-02 15:10:52 +0200 | [diff] [blame] | 45 | filename = "u-boot.itb"; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 46 | fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>; |
Jonas Karlman | 42d201a | 2023-01-21 19:01:39 +0000 | [diff] [blame] | 47 | fit,align = <512>; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 48 | offset = <CONFIG_SPL_PAD_TO>; |
| 49 | images { |
| 50 | u-boot { |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 51 | description = "U-Boot"; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 52 | type = "standalone"; |
| 53 | os = "U-Boot"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 54 | #ifdef CONFIG_ARM64 |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 55 | arch = "arm64"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 56 | #else |
| 57 | arch = "arm"; |
| 58 | #endif |
Manoj Sai | 0dc80e8 | 2023-09-18 00:56:27 +0530 | [diff] [blame] | 59 | #if defined(CONFIG_SPL_GZIP) |
| 60 | compression = "gzip"; |
Manoj Sai | f6c7c6b | 2023-09-18 00:56:28 +0530 | [diff] [blame] | 61 | #elif defined(CONFIG_SPL_LZMA) |
| 62 | compression = "lzma"; |
Manoj Sai | 0dc80e8 | 2023-09-18 00:56:27 +0530 | [diff] [blame] | 63 | #else |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 64 | compression = "none"; |
Manoj Sai | 0dc80e8 | 2023-09-18 00:56:27 +0530 | [diff] [blame] | 65 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 66 | load = <CONFIG_TEXT_BASE>; |
| 67 | entry = <CONFIG_TEXT_BASE>; |
| 68 | u-boot-nodtb { |
Manoj Sai | 0dc80e8 | 2023-09-18 00:56:27 +0530 | [diff] [blame] | 69 | #if defined(CONFIG_SPL_GZIP) |
| 70 | compress = "gzip"; |
Manoj Sai | f6c7c6b | 2023-09-18 00:56:28 +0530 | [diff] [blame] | 71 | #elif defined(CONFIG_SPL_LZMA) |
| 72 | compress = "lzma"; |
Manoj Sai | 0dc80e8 | 2023-09-18 00:56:27 +0530 | [diff] [blame] | 73 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 74 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 75 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 76 | hash { |
| 77 | algo = "sha256"; |
| 78 | }; |
| 79 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 80 | }; |
| 81 | |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 82 | #ifdef CONFIG_ARM64 |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 83 | @atf-SEQ { |
| 84 | fit,operation = "split-elf"; |
| 85 | description = "ARM Trusted Firmware"; |
| 86 | type = "firmware"; |
| 87 | arch = "arm64"; |
| 88 | os = "arm-trusted-firmware"; |
| 89 | compression = "none"; |
| 90 | fit,load; |
| 91 | fit,entry; |
| 92 | fit,data; |
| 93 | |
| 94 | atf-bl31 { |
| 95 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 96 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 97 | hash { |
| 98 | algo = "sha256"; |
| 99 | }; |
| 100 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 101 | }; |
| 102 | @tee-SEQ { |
| 103 | fit,operation = "split-elf"; |
| 104 | description = "TEE"; |
| 105 | type = "tee"; |
| 106 | arch = "arm64"; |
| 107 | os = "tee"; |
| 108 | compression = "none"; |
| 109 | fit,load; |
| 110 | fit,entry; |
| 111 | fit,data; |
| 112 | |
| 113 | tee-os { |
| 114 | optional; |
| 115 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 116 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 117 | hash { |
| 118 | algo = "sha256"; |
| 119 | }; |
| 120 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 121 | }; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 122 | #else |
| 123 | op-tee { |
| 124 | description = "OP-TEE"; |
| 125 | type = "tee"; |
| 126 | arch = "arm"; |
| 127 | os = "tee"; |
| 128 | compression = "none"; |
| 129 | load = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; |
| 130 | entry = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; |
| 131 | |
| 132 | tee-os { |
| 133 | }; |
| 134 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 135 | hash { |
| 136 | algo = "sha256"; |
| 137 | }; |
| 138 | #endif |
| 139 | }; |
| 140 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 141 | |
| 142 | @fdt-SEQ { |
| 143 | description = "fdt-NAME"; |
| 144 | compression = "none"; |
| 145 | type = "flat_dt"; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 146 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 147 | hash { |
| 148 | algo = "sha256"; |
| 149 | }; |
| 150 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 151 | }; |
| 152 | }; |
| 153 | |
| 154 | configurations { |
| 155 | default = "@config-DEFAULT-SEQ"; |
| 156 | @config-SEQ { |
| 157 | description = "NAME.dtb"; |
| 158 | fdt = "fdt-SEQ"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 159 | #ifdef CONFIG_ARM64 |
Jonas Karlman | 60ee192 | 2023-01-21 19:02:26 +0000 | [diff] [blame] | 160 | fit,firmware = "atf-1", "u-boot"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 161 | #else |
| 162 | fit,firmware = "op-tee", "u-boot"; |
| 163 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 164 | fit,loadables; |
| 165 | }; |
| 166 | }; |
| 167 | }; |
Quentin Schulz | d9ffa5e | 2022-09-02 15:10:52 +0200 | [diff] [blame] | 168 | #else |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 169 | u-boot-img { |
| 170 | offset = <CONFIG_SPL_PAD_TO>; |
| 171 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 172 | #endif |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 173 | }; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 174 | |
| 175 | #ifdef CONFIG_ROCKCHIP_SPI_IMAGE |
| 176 | simple-bin-spi { |
| 177 | filename = "u-boot-rockchip-spi.bin"; |
| 178 | pad-byte = <0xff>; |
| 179 | |
| 180 | mkimage { |
| 181 | filename = "idbloader-spi.img"; |
| 182 | args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 183 | multiple-data-files; |
| 184 | |
Jonas Karlman | 38ad6c9 | 2023-02-25 19:01:34 +0000 | [diff] [blame] | 185 | #ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL |
| 186 | rockchip-tpl { |
| 187 | }; |
| 188 | #elif defined(CONFIG_TPL) |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 189 | u-boot-tpl { |
| 190 | }; |
| 191 | #endif |
| 192 | u-boot-spl { |
| 193 | }; |
| 194 | }; |
| 195 | |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame] | 196 | #if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE) |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 197 | fit { |
| 198 | type = "blob"; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 199 | filename = "u-boot.itb"; |
| 200 | #else |
| 201 | u-boot-img { |
| 202 | #endif |
| 203 | /* Sync with u-boot,spl-payload-offset if present */ |
| 204 | offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>; |
| 205 | }; |
| 206 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 207 | #endif /* CONFIG_ROCKCHIP_SPI_IMAGE */ |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 208 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 209 | #endif /* CONFIG_SPL */ |