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 |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 59 | compression = "none"; |
| 60 | load = <CONFIG_TEXT_BASE>; |
| 61 | entry = <CONFIG_TEXT_BASE>; |
| 62 | u-boot-nodtb { |
| 63 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 64 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 65 | hash { |
| 66 | algo = "sha256"; |
| 67 | }; |
| 68 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 69 | }; |
| 70 | |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame^] | 71 | #ifdef CONFIG_ARM64 |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 72 | @atf-SEQ { |
| 73 | fit,operation = "split-elf"; |
| 74 | description = "ARM Trusted Firmware"; |
| 75 | type = "firmware"; |
| 76 | arch = "arm64"; |
| 77 | os = "arm-trusted-firmware"; |
| 78 | compression = "none"; |
| 79 | fit,load; |
| 80 | fit,entry; |
| 81 | fit,data; |
| 82 | |
| 83 | atf-bl31 { |
| 84 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 85 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 86 | hash { |
| 87 | algo = "sha256"; |
| 88 | }; |
| 89 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 90 | }; |
| 91 | @tee-SEQ { |
| 92 | fit,operation = "split-elf"; |
| 93 | description = "TEE"; |
| 94 | type = "tee"; |
| 95 | arch = "arm64"; |
| 96 | os = "tee"; |
| 97 | compression = "none"; |
| 98 | fit,load; |
| 99 | fit,entry; |
| 100 | fit,data; |
| 101 | |
| 102 | tee-os { |
| 103 | optional; |
| 104 | }; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 105 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 106 | hash { |
| 107 | algo = "sha256"; |
| 108 | }; |
| 109 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 110 | }; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame^] | 111 | #else |
| 112 | op-tee { |
| 113 | description = "OP-TEE"; |
| 114 | type = "tee"; |
| 115 | arch = "arm"; |
| 116 | os = "tee"; |
| 117 | compression = "none"; |
| 118 | load = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; |
| 119 | entry = <(CFG_SYS_SDRAM_BASE + 0x8400000)>; |
| 120 | |
| 121 | tee-os { |
| 122 | }; |
| 123 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 124 | hash { |
| 125 | algo = "sha256"; |
| 126 | }; |
| 127 | #endif |
| 128 | }; |
| 129 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 130 | |
| 131 | @fdt-SEQ { |
| 132 | description = "fdt-NAME"; |
| 133 | compression = "none"; |
| 134 | type = "flat_dt"; |
Jonas Karlman | d20ecb8 | 2023-01-21 19:01:59 +0000 | [diff] [blame] | 135 | #ifdef CONFIG_SPL_FIT_SIGNATURE |
| 136 | hash { |
| 137 | algo = "sha256"; |
| 138 | }; |
| 139 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 140 | }; |
| 141 | }; |
| 142 | |
| 143 | configurations { |
| 144 | default = "@config-DEFAULT-SEQ"; |
| 145 | @config-SEQ { |
| 146 | description = "NAME.dtb"; |
| 147 | fdt = "fdt-SEQ"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame^] | 148 | #ifdef CONFIG_ARM64 |
Jonas Karlman | 60ee192 | 2023-01-21 19:02:26 +0000 | [diff] [blame] | 149 | fit,firmware = "atf-1", "u-boot"; |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame^] | 150 | #else |
| 151 | fit,firmware = "op-tee", "u-boot"; |
| 152 | #endif |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 153 | fit,loadables; |
| 154 | }; |
| 155 | }; |
| 156 | }; |
Quentin Schulz | d9ffa5e | 2022-09-02 15:10:52 +0200 | [diff] [blame] | 157 | #else |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 158 | u-boot-img { |
| 159 | offset = <CONFIG_SPL_PAD_TO>; |
| 160 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 161 | #endif |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 162 | }; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 163 | |
| 164 | #ifdef CONFIG_ROCKCHIP_SPI_IMAGE |
| 165 | simple-bin-spi { |
| 166 | filename = "u-boot-rockchip-spi.bin"; |
| 167 | pad-byte = <0xff>; |
| 168 | |
| 169 | mkimage { |
| 170 | filename = "idbloader-spi.img"; |
| 171 | args = "-n", CONFIG_SYS_SOC, "-T", "rkspi"; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 172 | multiple-data-files; |
| 173 | |
Jonas Karlman | 38ad6c9 | 2023-02-25 19:01:34 +0000 | [diff] [blame] | 174 | #ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL |
| 175 | rockchip-tpl { |
| 176 | }; |
| 177 | #elif defined(CONFIG_TPL) |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 178 | u-boot-tpl { |
| 179 | }; |
| 180 | #endif |
| 181 | u-boot-spl { |
| 182 | }; |
| 183 | }; |
| 184 | |
Alex Bee | c32c9dc | 2023-07-18 16:57:11 +0200 | [diff] [blame^] | 185 | #if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE) |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 186 | fit { |
| 187 | type = "blob"; |
Quentin Schulz | 9c5217d | 2022-09-02 15:10:55 +0200 | [diff] [blame] | 188 | filename = "u-boot.itb"; |
| 189 | #else |
| 190 | u-boot-img { |
| 191 | #endif |
| 192 | /* Sync with u-boot,spl-payload-offset if present */ |
| 193 | offset = <CONFIG_SYS_SPI_U_BOOT_OFFS>; |
| 194 | }; |
| 195 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 196 | #endif /* CONFIG_ROCKCHIP_SPI_IMAGE */ |
Jagan Teki | b22da75 | 2020-01-10 00:16:21 +0530 | [diff] [blame] | 197 | }; |
Simon Glass | 4de3617 | 2023-01-07 14:07:18 -0700 | [diff] [blame] | 198 | #endif /* CONFIG_SPL */ |