blob: c8c928c7e5089db3a2239f2564e6dee1d82aad95 [file] [log] [blame]
Jagan Teki79030a42020-01-10 00:16:21 +05301// 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 Glass9b312e22020-07-19 13:55:57 -06009 binman: binman {
10 multiple-images;
11 };
12};
13
Jagan Teki1a45a032023-01-27 12:51:33 +053014#ifdef CONFIG_SPL
Simon Glass9b312e22020-07-19 13:55:57 -060015&binman {
16 simple-bin {
Jagan Teki79030a42020-01-10 00:16:21 +053017 filename = "u-boot-rockchip.bin";
18 pad-byte = <0xff>;
19
Quentin Schulz001f7882022-09-02 15:10:51 +020020 mkimage {
Jagan Teki79030a42020-01-10 00:16:21 +053021 filename = "idbloader.img";
Quentin Schulz001f7882022-09-02 15:10:51 +020022 args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
Quentin Schulz001f7882022-09-02 15:10:51 +020023 multiple-data-files;
24
Jonas Karlman4773e9d2023-02-25 19:01:34 +000025#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
26 rockchip-tpl {
27 };
28#elif defined(CONFIG_TPL)
Quentin Schulz001f7882022-09-02 15:10:51 +020029 u-boot-tpl {
30 };
31#endif
32 u-boot-spl {
33 };
Jagan Teki79030a42020-01-10 00:16:21 +053034 };
35
Alex Beefff7f5e2023-07-18 16:57:11 +020036#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
Simon Glasse0c0eff2023-01-07 14:07:18 -070037 fit: fit {
Alex Beefff7f5e2023-07-18 16:57:11 +020038#ifdef CONFIG_ARM64
Simon Glasse0c0eff2023-01-07 14:07:18 -070039 description = "FIT image for U-Boot with bl31 (TF-A)";
Alex Beefff7f5e2023-07-18 16:57:11 +020040#else
41 description = "FIT image with OP-TEE";
42#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -070043 #address-cells = <1>;
44 fit,fdt-list = "of-list";
Quentin Schulz05713d52022-09-02 15:10:52 +020045 filename = "u-boot.itb";
Simon Glasse0c0eff2023-01-07 14:07:18 -070046 fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
Jonas Karlman5ad03fc2023-01-21 19:01:39 +000047 fit,align = <512>;
Simon Glasse0c0eff2023-01-07 14:07:18 -070048 offset = <CONFIG_SPL_PAD_TO>;
49 images {
50 u-boot {
Alex Beefff7f5e2023-07-18 16:57:11 +020051 description = "U-Boot";
Simon Glasse0c0eff2023-01-07 14:07:18 -070052 type = "standalone";
53 os = "U-Boot";
Alex Beefff7f5e2023-07-18 16:57:11 +020054#ifdef CONFIG_ARM64
Simon Glasse0c0eff2023-01-07 14:07:18 -070055 arch = "arm64";
Alex Beefff7f5e2023-07-18 16:57:11 +020056#else
57 arch = "arm";
58#endif
Manoj Sai439bd732023-09-18 00:56:27 +053059#if defined(CONFIG_SPL_GZIP)
60 compression = "gzip";
Manoj Sai42a956e2023-09-18 00:56:28 +053061#elif defined(CONFIG_SPL_LZMA)
62 compression = "lzma";
Manoj Sai439bd732023-09-18 00:56:27 +053063#else
Simon Glasse0c0eff2023-01-07 14:07:18 -070064 compression = "none";
Manoj Sai439bd732023-09-18 00:56:27 +053065#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -070066 load = <CONFIG_TEXT_BASE>;
67 entry = <CONFIG_TEXT_BASE>;
68 u-boot-nodtb {
Manoj Sai439bd732023-09-18 00:56:27 +053069#if defined(CONFIG_SPL_GZIP)
70 compress = "gzip";
Manoj Sai42a956e2023-09-18 00:56:28 +053071#elif defined(CONFIG_SPL_LZMA)
72 compress = "lzma";
Manoj Sai439bd732023-09-18 00:56:27 +053073#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -070074 };
Jonas Karlman99e3a2c2023-01-21 19:01:59 +000075#ifdef CONFIG_SPL_FIT_SIGNATURE
76 hash {
77 algo = "sha256";
78 };
79#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -070080 };
81
Alex Beefff7f5e2023-07-18 16:57:11 +020082#ifdef CONFIG_ARM64
Simon Glasse0c0eff2023-01-07 14:07:18 -070083 @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 Karlman99e3a2c2023-01-21 19:01:59 +000096#ifdef CONFIG_SPL_FIT_SIGNATURE
97 hash {
98 algo = "sha256";
99 };
100#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -0700101 };
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 Karlman99e3a2c2023-01-21 19:01:59 +0000116#ifdef CONFIG_SPL_FIT_SIGNATURE
117 hash {
118 algo = "sha256";
119 };
120#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -0700121 };
Alex Beefff7f5e2023-07-18 16:57:11 +0200122#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 Glasse0c0eff2023-01-07 14:07:18 -0700141
142 @fdt-SEQ {
143 description = "fdt-NAME";
144 compression = "none";
145 type = "flat_dt";
Jonas Karlman99e3a2c2023-01-21 19:01:59 +0000146#ifdef CONFIG_SPL_FIT_SIGNATURE
147 hash {
148 algo = "sha256";
149 };
150#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -0700151 };
152 };
153
154 configurations {
155 default = "@config-DEFAULT-SEQ";
156 @config-SEQ {
157 description = "NAME.dtb";
158 fdt = "fdt-SEQ";
Alex Beefff7f5e2023-07-18 16:57:11 +0200159#ifdef CONFIG_ARM64
Jonas Karlman7e215ad2023-01-21 19:02:26 +0000160 fit,firmware = "atf-1", "u-boot";
Alex Beefff7f5e2023-07-18 16:57:11 +0200161#else
162 fit,firmware = "op-tee", "u-boot";
163#endif
Simon Glasse0c0eff2023-01-07 14:07:18 -0700164 fit,loadables;
165 };
166 };
167 };
Quentin Schulz05713d52022-09-02 15:10:52 +0200168#else
Jagan Teki79030a42020-01-10 00:16:21 +0530169 u-boot-img {
170 offset = <CONFIG_SPL_PAD_TO>;
171 };
Simon Glasse0c0eff2023-01-07 14:07:18 -0700172#endif
Jagan Teki79030a42020-01-10 00:16:21 +0530173 };
Quentin Schulze1faa532022-09-02 15:10:55 +0200174
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 Schulze1faa532022-09-02 15:10:55 +0200183 multiple-data-files;
184
Jonas Karlman4773e9d2023-02-25 19:01:34 +0000185#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
186 rockchip-tpl {
187 };
188#elif defined(CONFIG_TPL)
Quentin Schulze1faa532022-09-02 15:10:55 +0200189 u-boot-tpl {
190 };
191#endif
192 u-boot-spl {
193 };
194 };
195
Alex Beefff7f5e2023-07-18 16:57:11 +0200196#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)
Simon Glasse0c0eff2023-01-07 14:07:18 -0700197 fit {
198 type = "blob";
Quentin Schulze1faa532022-09-02 15:10:55 +0200199 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 Glasse0c0eff2023-01-07 14:07:18 -0700207#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
Jagan Teki79030a42020-01-10 00:16:21 +0530208};
Simon Glasse0c0eff2023-01-07 14:07:18 -0700209#endif /* CONFIG_SPL */