blob: 943d7d87a068ce535dabbffa0a68f659bd83832d [file] [log] [blame]
Jagan Tekib22da752020-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
Simon Glass6667c0e2025-04-13 19:59:34 +00008#ifdef CONFIG_ARM64
9#define FIT_ARCH "arm64"
10#else
11#define FIT_ARCH "arm"
12#endif
13
14#if defined(CONFIG_SPL_GZIP)
15#define FIT_UBOOT_COMP "gzip"
16#elif defined(CONFIG_SPL_LZMA)
17#define FIT_UBOOT_COMP "lzma"
18#else
19#define FIT_UBOOT_COMP "none"
20#endif
21
Jagan Tekib22da752020-01-10 00:16:21 +053022/ {
Simon Glass88315f72020-07-19 13:55:57 -060023 binman: binman {
24 multiple-images;
25 };
26};
27
Jagan Tekiffce0ff2023-01-27 12:51:33 +053028#ifdef CONFIG_SPL
Simon Glass88315f72020-07-19 13:55:57 -060029&binman {
30 simple-bin {
Jagan Tekib22da752020-01-10 00:16:21 +053031 filename = "u-boot-rockchip.bin";
32 pad-byte = <0xff>;
33
Quentin Schulz8c9b9fe2022-09-02 15:10:51 +020034 mkimage {
Jagan Tekib22da752020-01-10 00:16:21 +053035 filename = "idbloader.img";
Quentin Schulz8c9b9fe2022-09-02 15:10:51 +020036 args = "-n", CONFIG_SYS_SOC, "-T", "rksd";
Quentin Schulz8c9b9fe2022-09-02 15:10:51 +020037 multiple-data-files;
38
Jonas Karlman38ad6c92023-02-25 19:01:34 +000039#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
40 rockchip-tpl {
41 };
42#elif defined(CONFIG_TPL)
Quentin Schulz8c9b9fe2022-09-02 15:10:51 +020043 u-boot-tpl {
44 };
45#endif
46 u-boot-spl {
47 };
Jagan Tekib22da752020-01-10 00:16:21 +053048 };
49
Alex Beec32c9dc2023-07-18 16:57:11 +020050#if defined(CONFIG_SPL_FIT) && (defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE))
Simon Glass4de36172023-01-07 14:07:18 -070051 fit: fit {
Alex Beec32c9dc2023-07-18 16:57:11 +020052#ifdef CONFIG_ARM64
Simon Glass4de36172023-01-07 14:07:18 -070053 description = "FIT image for U-Boot with bl31 (TF-A)";
Alex Beec32c9dc2023-07-18 16:57:11 +020054#else
55 description = "FIT image with OP-TEE";
56#endif
Simon Glass4de36172023-01-07 14:07:18 -070057 #address-cells = <1>;
58 fit,fdt-list = "of-list";
Quentin Schulzd9ffa5e2022-09-02 15:10:52 +020059 filename = "u-boot.itb";
Simon Glass4de36172023-01-07 14:07:18 -070060 fit,external-offset = <CONFIG_FIT_EXTERNAL_OFFSET>;
Jonas Karlman42d201a2023-01-21 19:01:39 +000061 fit,align = <512>;
Simon Glass4de36172023-01-07 14:07:18 -070062 offset = <CONFIG_SPL_PAD_TO>;
63 images {
64 u-boot {
Alex Beec32c9dc2023-07-18 16:57:11 +020065 description = "U-Boot";
Simon Glass4de36172023-01-07 14:07:18 -070066 type = "standalone";
Simon Glass031fa4f2025-04-13 19:59:33 +000067 os = "u-boot";
Simon Glass6667c0e2025-04-13 19:59:34 +000068 arch = FIT_ARCH;
69 compression = FIT_UBOOT_COMP;
Simon Glass4de36172023-01-07 14:07:18 -070070 load = <CONFIG_TEXT_BASE>;
71 entry = <CONFIG_TEXT_BASE>;
72 u-boot-nodtb {
Simon Glass6667c0e2025-04-13 19:59:34 +000073 compress = FIT_UBOOT_COMP;
Simon Glass4de36172023-01-07 14:07:18 -070074 };
Jonas Karlmand20ecb82023-01-21 19:01:59 +000075#ifdef CONFIG_SPL_FIT_SIGNATURE
76 hash {
77 algo = "sha256";
78 };
79#endif
Simon Glass4de36172023-01-07 14:07:18 -070080 };
81
Alex Beec32c9dc2023-07-18 16:57:11 +020082#ifdef CONFIG_ARM64
Simon Glass4de36172023-01-07 14:07:18 -070083 @atf-SEQ {
84 fit,operation = "split-elf";
85 description = "ARM Trusted Firmware";
86 type = "firmware";
Simon Glass6667c0e2025-04-13 19:59:34 +000087 arch = FIT_ARCH;
Simon Glass4de36172023-01-07 14:07:18 -070088 os = "arm-trusted-firmware";
89 compression = "none";
90 fit,load;
91 fit,entry;
92 fit,data;
93
94 atf-bl31 {
95 };
Jonas Karlmand20ecb82023-01-21 19:01:59 +000096#ifdef CONFIG_SPL_FIT_SIGNATURE
97 hash {
98 algo = "sha256";
99 };
100#endif
Simon Glass4de36172023-01-07 14:07:18 -0700101 };
102 @tee-SEQ {
103 fit,operation = "split-elf";
104 description = "TEE";
105 type = "tee";
Simon Glass6667c0e2025-04-13 19:59:34 +0000106 arch = FIT_ARCH;
Simon Glass4de36172023-01-07 14:07:18 -0700107 os = "tee";
108 compression = "none";
109 fit,load;
110 fit,entry;
111 fit,data;
112
113 tee-os {
114 optional;
115 };
Jonas Karlmand20ecb82023-01-21 19:01:59 +0000116#ifdef CONFIG_SPL_FIT_SIGNATURE
117 hash {
118 algo = "sha256";
119 };
120#endif
Simon Glass4de36172023-01-07 14:07:18 -0700121 };
Simon Glass6667c0e2025-04-13 19:59:34 +0000122#else /* !CONFIG_ARM64 */
Alex Beec32c9dc2023-07-18 16:57:11 +0200123 op-tee {
124 description = "OP-TEE";
125 type = "tee";
Simon Glass6667c0e2025-04-13 19:59:34 +0000126 arch = FIT_ARCH;
Alex Beec32c9dc2023-07-18 16:57:11 +0200127 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 };
Simon Glass6667c0e2025-04-13 19:59:34 +0000140#endif /* CONFIG_ARM64 */
Simon Glass4de36172023-01-07 14:07:18 -0700141
142 @fdt-SEQ {
143 description = "fdt-NAME";
144 compression = "none";
145 type = "flat_dt";
Jonas Karlmand20ecb82023-01-21 19:01:59 +0000146#ifdef CONFIG_SPL_FIT_SIGNATURE
147 hash {
148 algo = "sha256";
149 };
150#endif
Simon Glass4de36172023-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 Beec32c9dc2023-07-18 16:57:11 +0200159#ifdef CONFIG_ARM64
Jonas Karlman60ee1922023-01-21 19:02:26 +0000160 fit,firmware = "atf-1", "u-boot";
Alex Beec32c9dc2023-07-18 16:57:11 +0200161#else
162 fit,firmware = "op-tee", "u-boot";
163#endif
Simon Glass4de36172023-01-07 14:07:18 -0700164 fit,loadables;
165 };
166 };
167 };
Quentin Schulzd9ffa5e2022-09-02 15:10:52 +0200168#else
Jagan Tekib22da752020-01-10 00:16:21 +0530169 u-boot-img {
170 offset = <CONFIG_SPL_PAD_TO>;
171 };
Simon Glass4de36172023-01-07 14:07:18 -0700172#endif
Jagan Tekib22da752020-01-10 00:16:21 +0530173 };
Quentin Schulz9c5217d2022-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 Schulz9c5217d2022-09-02 15:10:55 +0200183 multiple-data-files;
184
Jonas Karlman38ad6c92023-02-25 19:01:34 +0000185#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
186 rockchip-tpl {
187 };
188#elif defined(CONFIG_TPL)
Quentin Schulz9c5217d2022-09-02 15:10:55 +0200189 u-boot-tpl {
190 };
191#endif
192 u-boot-spl {
193 };
194 };
195
Alex Beec32c9dc2023-07-18 16:57:11 +0200196#if defined(CONFIG_ARM64) || defined(CONFIG_SPL_OPTEE_IMAGE)
Simon Glass4de36172023-01-07 14:07:18 -0700197 fit {
198 type = "blob";
Quentin Schulz9c5217d2022-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 Glass4de36172023-01-07 14:07:18 -0700207#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
Jagan Tekib22da752020-01-10 00:16:21 +0530208};
Simon Glass4de36172023-01-07 14:07:18 -0700209#endif /* CONFIG_SPL */