blob: 7cbad40ea0cde8d26b12fef50265114038fcf624 [file] [log] [blame]
Simon Glassee112092021-03-07 17:35:15 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
Sean Andersondcd91b12023-10-14 16:47:57 -04003 * Copyright (C) 2023 Sean Anderson <seanga2@gmail.com>
Simon Glassee112092021-03-07 17:35:15 -07004 */
5
Sean Andersonf65dcc02023-10-14 16:47:59 -04006#include <image.h>
7#include <imx_container.h>
Simon Glassee112092021-03-07 17:35:15 -07008#include <mapmem.h>
Sean Andersonf65dcc02023-10-14 16:47:59 -04009#include <memalign.h>
10#include <rand.h>
Sean Anderson8734d6f2023-10-14 16:48:05 -040011#include <spi_flash.h>
Sean Andersonf65dcc02023-10-14 16:47:59 -040012#include <spl.h>
13#include <test/spl.h>
14#include <test/ut.h>
15#include <u-boot/crc.h>
Simon Glassee112092021-03-07 17:35:15 -070016
17int board_fit_config_name_match(const char *name)
18{
19 return 0;
20}
21
Simon Glassbb7d3bb2022-09-06 20:26:52 -060022struct legacy_img_hdr *spl_get_load_buffer(ssize_t offset, size_t size)
Simon Glassee112092021-03-07 17:35:15 -070023{
24 return map_sysmem(0x100000, 0);
25}
Sean Andersonf65dcc02023-10-14 16:47:59 -040026
27/* Try to reuse the load buffer to conserve memory */
28void *board_spl_fit_buffer_addr(ulong fit_size, int sectors, int bl_len)
29{
30 static void *buf;
31 static size_t size;
32
33 if (size < sectors * bl_len) {
34 free(buf);
35 size = sectors * bl_len;
36 buf = malloc_cache_aligned(size);
37 }
38 return buf;
39}
40
41/* Local flags for spl_image; start from the "top" to avoid conflicts */
42#define SPL_IMX_CONTAINER 0x80000000
Sean Anderson430e4aa2023-10-14 16:48:04 -040043#define SPL_COMP_LZMA 0x40000000
Sean Andersonf65dcc02023-10-14 16:47:59 -040044
45void generate_data(char *data, size_t size, const char *test_name)
46{
47 int i;
48 unsigned int seed = 1;
49
50 while (*test_name) {
51 seed += *test_name++;
52 rand_r(&seed);
53 }
54
55 for (i = 0; i < size; i++)
56 data[i] = (i & 0xf) << 4 | (rand_r(&seed) & 0xf);
57}
58
59static size_t create_legacy(void *dst, struct spl_image_info *spl_image,
60 size_t *data_offset)
61{
62 struct legacy_img_hdr *hdr = dst;
63 void *data = dst + sizeof(*hdr);
64
65 if (data_offset)
66 *data_offset = data - dst;
67
68 if (!dst)
69 goto out;
70
71 image_set_magic(hdr, IH_MAGIC);
72 image_set_time(hdr, 0);
73 image_set_size(hdr, spl_image->size);
74 image_set_load(hdr, spl_image->load_addr);
75 image_set_ep(hdr, spl_image->entry_point);
76 image_set_dcrc(hdr, crc32(0, data, spl_image->size));
77 image_set_os(hdr, spl_image->os);
78 image_set_arch(hdr, IH_ARCH_DEFAULT);
79 image_set_type(hdr, IH_TYPE_FIRMWARE);
Sean Anderson430e4aa2023-10-14 16:48:04 -040080 image_set_comp(hdr, spl_image->flags & SPL_COMP_LZMA ? IH_COMP_LZMA :
81 IH_COMP_NONE);
Sean Andersonf65dcc02023-10-14 16:47:59 -040082 image_set_name(hdr, spl_image->name);
83 image_set_hcrc(hdr, crc32(0, (void *)hdr, sizeof(*hdr)));
84
85out:
86 return sizeof(*hdr) + spl_image->size;
87}
88
89static size_t create_imx8(void *dst, struct spl_image_info *spl_image,
90 size_t *data_offset)
91{
92 struct container_hdr *hdr = dst;
93 struct boot_img_t *img = dst + sizeof(*hdr);
94 size_t length = sizeof(*hdr) + sizeof(*img);
95 /* Align to MMC block size for now */
96 void *data = dst + 512;
97
98 if (data_offset)
99 *data_offset = data - dst;
100
101 if (!dst)
102 goto out;
103
104 hdr->version = CONTAINER_HDR_VERSION;
105 hdr->length_lsb = length & 0xff;
106 hdr->length_msb = length >> 8;
107 hdr->tag = CONTAINER_HDR_TAG;
108 hdr->num_images = 1;
109
110 /* spl_load_imx_container doesn't handle endianness; whoops! */
111 img->offset = data - dst;
112 img->size = spl_image->size;
113 img->dst = spl_image->load_addr;
114 img->entry = spl_image->entry_point;
115
116out:
117 return data - dst + spl_image->size;
118}
119
120#define ADDRESS_CELLS (sizeof(uintptr_t) / sizeof(u32))
121
122static inline int fdt_property_addr(void *fdt, const char *name, uintptr_t val)
123{
124 if (sizeof(uintptr_t) == sizeof(u32))
125 return fdt_property_u32(fdt, name, val);
126 return fdt_property_u64(fdt, name, val);
127}
128
129static size_t start_fit(void *dst, size_t fit_size, size_t data_size,
130 bool external)
131{
132 void *data;
133
134 if (fdt_create(dst, fit_size))
135 return 0;
136 if (fdt_finish_reservemap(dst))
137 return 0;
138 if (fdt_begin_node(dst, ""))
139 return 0;
140 if (fdt_property_u32(dst, FIT_TIMESTAMP_PROP, 0))
141 return 0;
142 if (fdt_property_u32(dst, "#address-cells", ADDRESS_CELLS))
143 return 0;
144 if (fdt_property_string(dst, FIT_DESC_PROP, ""))
145 return 0;
146
147 if (fdt_begin_node(dst, "images"))
148 return 0;
149 if (fdt_begin_node(dst, "u-boot"))
150 return 0;
151
152 if (external) {
153 if (fdt_property_u32(dst, FIT_DATA_OFFSET_PROP, 0))
154 return 0;
155 return fit_size;
156 }
157
158 if (fdt_property_placeholder(dst, FIT_DATA_PROP, data_size, &data))
159 return 0;
160 return data - dst;
161}
162
163static size_t create_fit(void *dst, struct spl_image_info *spl_image,
164 size_t *data_offset, bool external)
165{
166 size_t prop_size = 596, total_size = prop_size + spl_image->size;
167 size_t off, size;
168
169 if (external) {
170 size = prop_size;
171 off = size;
172 } else {
173 char tmp[256];
174
175 size = total_size;
176 off = start_fit(tmp, sizeof(tmp), 0, false);
177 if (!off)
178 return 0;
179 }
180
181 if (data_offset)
182 *data_offset = off;
183
184 if (!dst)
185 goto out;
186
187 if (start_fit(dst, size, spl_image->size, external) != off)
188 return 0;
189
190 if (fdt_property_string(dst, FIT_DESC_PROP, spl_image->name))
191 return 0;
192 if (fdt_property_string(dst, FIT_TYPE_PROP, "firmware"))
193 return 0;
194 if (fdt_property_string(dst, FIT_COMP_PROP, "none"))
195 return 0;
196 if (fdt_property_u32(dst, FIT_DATA_SIZE_PROP, spl_image->size))
197 return 0;
198 if (fdt_property_string(dst, FIT_OS_PROP,
199 genimg_get_os_short_name(spl_image->os)))
200 return 0;
201 if (fdt_property_string(dst, FIT_ARCH_PROP,
202 genimg_get_arch_short_name(IH_ARCH_DEFAULT)))
203 return 0;
204 if (fdt_property_addr(dst, FIT_ENTRY_PROP, spl_image->entry_point))
205 return 0;
206 if (fdt_property_addr(dst, FIT_LOAD_PROP, spl_image->load_addr))
207 return 0;
208 if (fdt_end_node(dst)) /* u-boot */
209 return 0;
210 if (fdt_end_node(dst)) /* images */
211 return 0;
212
213 if (fdt_begin_node(dst, "configurations"))
214 return 0;
215 if (fdt_property_string(dst, FIT_DEFAULT_PROP, "config-1"))
216 return 0;
217 if (fdt_begin_node(dst, "config-1"))
218 return 0;
219 if (fdt_property_string(dst, FIT_DESC_PROP, spl_image->name))
220 return 0;
221 if (fdt_property_string(dst, FIT_FIRMWARE_PROP, "u-boot"))
222 return 0;
223 if (fdt_end_node(dst)) /* configurations */
224 return 0;
225 if (fdt_end_node(dst)) /* config-1 */
226 return 0;
227
228 if (fdt_end_node(dst)) /* root */
229 return 0;
230 if (fdt_finish(dst))
231 return 0;
232
233 if (external) {
234 if (fdt_totalsize(dst) > size)
235 return 0;
236 fdt_set_totalsize(dst, size);
237 }
238
239out:
240 return total_size;
241}
242
243size_t create_image(void *dst, enum spl_test_image type,
244 struct spl_image_info *info, size_t *data_offset)
245{
246 bool external = false;
247
248 info->os = IH_OS_U_BOOT;
249 info->load_addr = CONFIG_TEXT_BASE;
250 info->entry_point = CONFIG_TEXT_BASE + 0x100;
251 info->flags = 0;
252
253 switch (type) {
Sean Anderson430e4aa2023-10-14 16:48:04 -0400254 case LEGACY_LZMA:
255 info->flags = SPL_COMP_LZMA;
Sean Andersonf65dcc02023-10-14 16:47:59 -0400256 case LEGACY:
257 return create_legacy(dst, info, data_offset);
258 case IMX8:
259 info->flags = SPL_IMX_CONTAINER;
260 return create_imx8(dst, info, data_offset);
261 case FIT_EXTERNAL:
262 /*
263 * spl_fit_append_fdt will clobber external images with U-Boot's
264 * FDT if the image doesn't have one. Just set the OS to
265 * something which doesn't take a devicetree.
266 */
267 if (!IS_ENABLED(CONFIG_LOAD_FIT_FULL))
268 info->os = IH_OS_TEE;
269 external = true;
270 case FIT_INTERNAL:
271 info->flags = SPL_FIT_FOUND;
272 return create_fit(dst, info, data_offset, external);
273 }
274
275 return 0;
276}
277
278int check_image_info(struct unit_test_state *uts, struct spl_image_info *info1,
279 struct spl_image_info *info2)
280{
281 if (info2->name) {
282 if (info1->flags & SPL_FIT_FOUND)
283 ut_asserteq_str(genimg_get_os_name(info1->os),
284 info2->name);
285 else
286 ut_asserteq_str(info1->name, info2->name);
287 }
288
289 if (info1->flags & SPL_IMX_CONTAINER)
290 ut_asserteq(IH_OS_INVALID, info2->os);
291 else
292 ut_asserteq(info1->os, info2->os);
293
294 ut_asserteq(info1->entry_point, info2->entry_point);
295 if (info1->flags & (SPL_FIT_FOUND | SPL_IMX_CONTAINER) ||
296 info2->flags & SPL_COPY_PAYLOAD_ONLY) {
297 ut_asserteq(info1->load_addr, info2->load_addr);
298 if (info1->flags & SPL_IMX_CONTAINER)
299 ut_asserteq(0, info2->size);
Sean Anderson430e4aa2023-10-14 16:48:04 -0400300 else if (!(info1->flags & SPL_COMP_LZMA))
Sean Andersonf65dcc02023-10-14 16:47:59 -0400301 ut_asserteq(info1->size, info2->size);
302 } else {
303 ut_asserteq(info1->load_addr - sizeof(struct legacy_img_hdr),
304 info2->load_addr);
305 ut_asserteq(info1->size + sizeof(struct legacy_img_hdr),
306 info2->size);
307 }
308
309 return 0;
310}
311
312static ulong spl_test_read(struct spl_load_info *load, ulong sector,
313 ulong count, void *buf)
314{
315 memcpy(buf, load->priv + sector, count);
316 return count;
317}
318
319static int spl_test_image(struct unit_test_state *uts, const char *test_name,
320 enum spl_test_image type)
321{
322 size_t img_size, img_data, data_size = SPL_TEST_DATA_SIZE;
323 struct spl_image_info info_write = {
324 .name = test_name,
325 .size = data_size,
326 }, info_read = { };
327 char *data;
328 void *img;
329
330 img_size = create_image(NULL, type, &info_write, &img_data);
331 ut_assert(img_size);
332 img = calloc(img_size, 1);
333 ut_assertnonnull(img);
334
335 data = img + img_data;
336 generate_data(data, data_size, test_name);
337 ut_asserteq(img_size, create_image(img, type, &info_write, NULL));
338
339 if (type == LEGACY) {
340 ut_assertok(spl_parse_image_header(&info_read, NULL, img));
341 if (check_image_info(uts, &info_write, &info_read))
342 return CMD_RET_FAILURE;
343 } else {
Sean Anderson35f15fe2023-11-08 11:48:43 -0500344 struct spl_load_info load;
Sean Andersonf65dcc02023-10-14 16:47:59 -0400345
Sean Anderson35f15fe2023-11-08 11:48:43 -0500346 spl_set_bl_len(&load, 1);
347 load.priv = img;
348 load.read = spl_test_read;
Sean Andersonf65dcc02023-10-14 16:47:59 -0400349 if (type == IMX8)
350 ut_assertok(spl_load_imx_container(&info_read, &load,
351 0));
352 else if (IS_ENABLED(CONFIG_SPL_FIT_FULL))
353 ut_assertok(spl_parse_image_header(&info_read, NULL,
354 img));
355 else
356 ut_assertok(spl_load_simple_fit(&info_read, &load, 0,
357 img));
358 if (check_image_info(uts, &info_write, &info_read))
359 return CMD_RET_FAILURE;
360 ut_asserteq_mem(data, phys_to_virt(info_write.load_addr),
361 data_size);
362 }
363
364 free(img);
365 return 0;
366}
367SPL_IMG_TEST(spl_test_image, LEGACY, 0);
368SPL_IMG_TEST(spl_test_image, IMX8, 0);
369SPL_IMG_TEST(spl_test_image, FIT_INTERNAL, 0);
370SPL_IMG_TEST(spl_test_image, FIT_EXTERNAL, 0);
Sean Anderson576295d2023-10-14 16:48:02 -0400371
Sean Anderson430e4aa2023-10-14 16:48:04 -0400372/*
373 * LZMA is too complex to generate on the fly, so let's use some data I put in
374 * the oven^H^H^H^H compressed earlier
375 */
Sean Anderson8cba9882023-11-08 11:48:46 -0500376const char lzma_compressed[] = {
Sean Anderson430e4aa2023-10-14 16:48:04 -0400377 0x5d, 0x00, 0x00, 0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
378 0xff, 0x00, 0x02, 0x05, 0x55, 0x4e, 0x82, 0xbc, 0xc2, 0x42, 0xf6, 0x88,
379 0x6c, 0x99, 0xd6, 0x82, 0x48, 0xa6, 0x06, 0x67, 0xf8, 0x46, 0x7c, 0xe9,
380 0x41, 0x79, 0xfe, 0x90, 0x0b, 0x31, 0x7b, 0x79, 0x91, 0xb8, 0x5f, 0x33,
381 0x11, 0x04, 0xc3, 0x4f, 0xf5, 0x71, 0xd1, 0xfb, 0x94, 0x6b, 0x5f, 0x78,
382 0xe2, 0xfa, 0x6a, 0x21, 0xb6, 0x1d, 0x11, 0x0e, 0x5b, 0x56, 0x6a, 0x5b,
383 0xe9, 0x56, 0x5f, 0x8b, 0x87, 0x61, 0x96, 0x6d, 0xce, 0x66, 0xbb, 0xb6,
384 0xe7, 0x13, 0x5a, 0xd8, 0x84, 0x29, 0x60, 0xa0, 0x80, 0x43, 0xdd, 0x0f,
385 0x4b, 0x85, 0xb0, 0x04, 0x9d, 0x9f, 0x28, 0x97, 0x0a, 0x1e, 0x16, 0xb0,
386 0x45, 0x33, 0x5e, 0x79, 0x4f, 0xaa, 0xee, 0x79, 0x6e, 0xc3, 0x4e, 0x3d,
387 0xe8, 0x67, 0x7c, 0xe0, 0xd0, 0xcc, 0x05, 0x40, 0xae, 0x6b, 0x97, 0x82,
388 0x97, 0x02, 0x01, 0xe2, 0xe3, 0xbc, 0xe4, 0x9b, 0xb3, 0x28, 0xed, 0x5e,
389 0x0d, 0x68, 0x6e, 0xe5, 0x17, 0x0a, 0x86, 0x5a, 0xcd, 0x8d, 0x46, 0x2d,
390 0x06, 0x10, 0xa6, 0x90, 0x44, 0xa1, 0xfc, 0x66, 0x6d, 0x7c, 0x57, 0x57,
391 0x07, 0xbc, 0x95, 0xb2, 0x8d, 0xf0, 0x9f, 0x4d, 0x90, 0x04, 0xaf, 0x0c,
392 0x23, 0x51, 0x1b, 0x34, 0xd5, 0x5c, 0x5d, 0x87, 0x5e, 0x10, 0x2b, 0x71,
393 0xc2, 0xcf, 0xc5, 0x9d, 0x4b, 0x89, 0x01, 0xc4, 0x97, 0xf2, 0xea, 0x83,
394 0x97, 0xfa, 0xe0, 0x51, 0x96, 0x78, 0x4f, 0x44, 0xb8, 0xa8, 0x9d, 0x03,
395 0x1c, 0x6e, 0xb7, 0xc6, 0xd7, 0xc5, 0x3e, 0x32, 0x65, 0xa7, 0x06, 0xab,
396 0x86, 0xfb, 0xd2, 0x9b, 0xd7, 0x86, 0xa8, 0xfe, 0x46, 0x41, 0x2e, 0xc2,
397 0x4e, 0xed, 0xa2, 0x9b, 0x79, 0x36, 0x37, 0x49, 0x90, 0xfc, 0xa6, 0x14,
398 0x93, 0x17, 0x82, 0x62, 0x3f, 0x79, 0x6b, 0x86, 0xc2, 0xeb, 0x82, 0xfe,
399 0x87, 0x49, 0xa5, 0x7e, 0x41, 0xe3, 0x59, 0x60, 0x15, 0x61, 0x4e, 0x3b,
400 0x16, 0xcf, 0xdb, 0x49, 0x2c, 0x84, 0x92, 0x26, 0x40, 0x04, 0x78, 0xd3,
401 0xd6, 0xa6, 0xed, 0x6e, 0x63, 0x49, 0xcb, 0xea, 0xfe, 0x43, 0x85, 0x21,
402 0x1a, 0x28, 0x36, 0x0a, 0x3e, 0x2a, 0xad, 0xba, 0xfc, 0x8a, 0x37, 0x18,
403 0xb4, 0x80, 0xbe, 0x6a, 0x36, 0x14, 0x03, 0xdd, 0xa3, 0x37, 0xbd, 0xc1,
404 0x8a, 0xbb, 0x2d, 0xd4, 0x08, 0xd7, 0x4b, 0xc4, 0xe9, 0xb8, 0xb4, 0x65,
405 0xdd, 0xf6, 0xe8, 0x17, 0x2c, 0x2c, 0x9b, 0x1e, 0x92, 0x0b, 0xcb, 0x22,
406 0x7c, 0x1b, 0x74, 0x8d, 0x65, 0x11, 0x5f, 0xfe, 0xf5, 0x2a, 0xc2, 0xbe,
407 0xea, 0xa2, 0xf1, 0x7b, 0xe8, 0xaf, 0x32, 0x5a, 0x0a, 0x5b, 0xd2, 0x5a,
408 0x11, 0x22, 0x79, 0xfa, 0xae, 0x2d, 0xe8, 0xc6, 0x17, 0xba, 0x17, 0x81,
409 0x6a, 0x63, 0xb5, 0x26, 0xd7, 0x8d, 0xd0, 0x66, 0x0c, 0x4a, 0x0c, 0x22,
410 0x1b, 0x20, 0x9f, 0x3d, 0x0b, 0x1b, 0x59, 0x53, 0x89, 0x9b, 0x5e, 0xbd,
411 0x3d, 0xd1, 0xdd, 0xff, 0xca, 0xb2, 0xb7, 0x12, 0x8d, 0x03, 0xaa, 0xc3,
412 0x1d, 0x56, 0x76, 0x14, 0xf8, 0xee, 0xb3, 0xeb, 0x80, 0x38, 0xc1, 0xc1,
413 0x1a, 0xef, 0x4a, 0xd5, 0x16, 0x1f, 0x5e, 0x21, 0x5d, 0x46, 0x01, 0xb3,
414 0xa4, 0xf7, 0x99, 0x94, 0x05, 0xc6, 0xc8, 0x06, 0xd8, 0x1c, 0xac, 0x47,
415 0x13, 0x54, 0x13, 0x1b, 0x1f, 0xb6, 0x23, 0x9c, 0x73, 0x2b, 0x57, 0x32,
416 0x94, 0x92, 0xf1, 0x71, 0x44, 0x40, 0x02, 0xc3, 0x21, 0x4a, 0x2f, 0x36,
417 0x5e, 0x8a, 0xd0, 0x4b, 0x02, 0xc7, 0x6e, 0xcf, 0xed, 0xa2, 0xdb, 0xce,
418 0x0a, 0x0f, 0x66, 0x4f, 0xb2, 0x3d, 0xb6, 0xcc, 0x75, 0x45, 0x80, 0x0a,
419 0x49, 0x4a, 0xe7, 0xe7, 0x24, 0x62, 0x65, 0xc7, 0x02, 0x22, 0x13, 0xbe,
420 0x6c, 0xa9, 0x9a, 0x8b, 0xa9, 0x1b, 0x2b, 0x3a, 0xde, 0x5e, 0x37, 0xbd,
421 0x7f, 0x85, 0xd1, 0x32, 0x1d, 0xbf, 0x03, 0x8a, 0x3b, 0xe5, 0xb3, 0xfd,
422 0x01, 0xca, 0xde, 0x0d, 0x7a, 0x5b, 0x01, 0x05, 0x1d, 0x3c, 0x23, 0x00,
423 0x60, 0xb7, 0x50, 0xfd, 0x0d, 0xd7, 0x63, 0x92, 0xd6, 0xb0, 0x48, 0x3a,
424 0x2d, 0xa3, 0xf8, 0xf6, 0x44, 0xe1, 0xda, 0x3b, 0xf4, 0x39, 0x47, 0xc4,
425 0x4d, 0x8f, 0x54, 0x78, 0xec, 0x27, 0x7b, 0xc6, 0xe4, 0x81, 0x3a, 0x3f,
426 0xa5, 0x61, 0x9d, 0xcb, 0x71, 0x0b, 0x0d, 0x55, 0xea, 0x5b, 0xeb, 0x58,
427 0xa5, 0x49, 0xb5, 0x44, 0x1b, 0xb0, 0x0d, 0x1f, 0x58, 0xfb, 0x7a, 0xd4,
428 0x09, 0x1e, 0x9a, 0x7e, 0x21, 0xba, 0xb3, 0x36, 0xa6, 0x04, 0x74, 0xe1,
429 0xd0, 0xca, 0x02, 0x11, 0x84, 0x93, 0x8f, 0x86, 0x3d, 0x79, 0xbf, 0xa8,
430 0xec, 0x0a, 0x23, 0x5e, 0xde, 0xc4, 0xc6, 0xda, 0x45, 0xbd, 0x95, 0x74,
431 0x7b, 0xbf, 0xc1, 0x80, 0x48, 0x3f, 0x10, 0xb6, 0xb9, 0x5c, 0x31, 0x52,
432 0x06, 0x5a, 0xac, 0xec, 0x94, 0x21, 0x80, 0x51, 0xba, 0x64, 0xed, 0x9d,
433 0x27, 0x72, 0x8d, 0x17, 0x43, 0x5f, 0xf1, 0x60, 0xfa, 0xb5, 0x65, 0xd4,
434 0xb9, 0xf8, 0xfc, 0x48, 0x7b, 0xe3, 0xfe, 0xae, 0xe4, 0x71, 0x4a, 0x3d,
435 0x8c, 0xf5, 0x72, 0x8b, 0xbf, 0x60, 0xd8, 0x6a, 0x8f, 0x51, 0x82, 0xae,
436 0x98, 0xd0, 0x56, 0xf9, 0xa8, 0x3a, 0xad, 0x86, 0x26, 0xa8, 0x5a, 0xf8,
437 0x63, 0x87, 0x2c, 0x74, 0xbf, 0xf9, 0x7d, 0x00, 0xa0, 0x2f, 0x17, 0x23,
438 0xb7, 0x62, 0x94, 0x19, 0x47, 0x57, 0xf9, 0xa8, 0xe7, 0x4b, 0xe9, 0x2b,
439 0xe8, 0xb4, 0x03, 0xbf, 0x23, 0x75, 0xfe, 0xc3, 0x94, 0xc0, 0xa9, 0x5b,
440 0x07, 0xb5, 0x75, 0x87, 0xcc, 0xa5, 0xb5, 0x9b, 0x35, 0x29, 0xe4, 0xb1,
441 0xaa, 0x04, 0x57, 0xe9, 0xa3, 0xd0, 0xa3, 0xe4, 0x11, 0xe1, 0xaa, 0x3b,
442 0x67, 0x09, 0x60, 0x83, 0x23, 0x72, 0xa6, 0x7b, 0x73, 0x22, 0x5b, 0x4a,
443 0xe0, 0xf0, 0xa3, 0xeb, 0x9c, 0x91, 0xda, 0xba, 0x8b, 0xc1, 0x32, 0xa9,
444 0x24, 0x13, 0x51, 0xe4, 0x67, 0x49, 0x4a, 0xd9, 0x3d, 0xae, 0x80, 0xfd,
445 0x0a, 0x0d, 0x56, 0x98, 0x66, 0xa2, 0x6d, 0x92, 0x54, 0x7f, 0x82, 0xe5,
446 0x17, 0x39, 0xd3, 0xaa, 0xc4, 0x4e, 0x6f, 0xe1, 0x2e, 0xfe, 0x03, 0x44,
447 0x8a, 0xdd, 0xeb, 0xc0, 0x74, 0x79, 0x63, 0x33, 0x2b, 0x4b, 0xb5, 0x62,
448 0xdd, 0x47, 0xba, 0x6e, 0xfc, 0x91, 0x08, 0xa9, 0x17, 0x8c, 0x47, 0x61,
449 0xd9, 0x32, 0xe9, 0xa0, 0xb3, 0xa2, 0x82, 0xc9, 0xa6, 0x32, 0xa1, 0xca,
450 0x7c, 0x41, 0xa6, 0x5a, 0xe2, 0x46, 0xb6, 0x45, 0x53, 0x72, 0x55, 0x9e,
451 0xdf, 0xac, 0x96, 0x68, 0xe5, 0xdc, 0x4e, 0x2d, 0xa8, 0x1e, 0x7a, 0x8e,
452 0xff, 0x54, 0xe4, 0x0a, 0x33, 0x5d, 0x97, 0xdf, 0x4e, 0x36, 0x96, 0xba,
453 0x52, 0xd9, 0xa9, 0xec, 0x52, 0xe5, 0x1d, 0x94, 0xfe, 0x1c, 0x46, 0x54,
454 0xa6, 0x8e, 0x85, 0x47, 0xba, 0xeb, 0x4b, 0x8d, 0x57, 0xe4, 0x34, 0x24,
455 0x9e, 0x80, 0xb5, 0xc9, 0xa9, 0x94, 0x1d, 0xe4, 0x18, 0xb6, 0x07, 0x1e,
456 0xfa, 0xe0, 0x1c, 0x88, 0x06, 0x84, 0xaa, 0xcb, 0x5e, 0xfa, 0x15, 0x5a,
457 0xdd, 0x10, 0x43, 0x81, 0xf2, 0x50, 0x3e, 0x93, 0x26, 0x77, 0x1c, 0x77,
458 0xe9, 0x0c, 0xfc, 0x5f, 0xdd, 0x67, 0x31, 0x02, 0xc6, 0xdd, 0xf4, 0x30,
459 0x76, 0x51, 0xce, 0x56, 0xba, 0x7f, 0x44, 0xbd, 0x42, 0x9f, 0x10, 0x8c,
460 0x56, 0x49, 0x48, 0xa2, 0xcb, 0xc4, 0xdd, 0x29, 0xae, 0xf0, 0x33, 0x35,
461 0x46, 0x69, 0x1d, 0xae, 0xde, 0xde, 0x98, 0x82, 0x79, 0xa6, 0x50, 0x28,
462 0xb3, 0x5f, 0x10, 0x24, 0x63, 0xee, 0x9a, 0x22, 0xbe, 0xf8, 0x3a, 0xf4,
463 0xab, 0x98, 0xfe, 0xdf, 0x30, 0x03, 0xe8, 0x45, 0x8c, 0xf4, 0x85, 0xc6,
464 0x98, 0x7b, 0x35, 0xb8, 0x30, 0x9c, 0x15, 0xa6, 0x45, 0xbd, 0x39, 0x84,
465 0xe7, 0x43, 0x4b, 0x05, 0xa4, 0x8f, 0x52, 0x8e, 0x4a, 0xe4, 0x87, 0xc1,
466 0xdc, 0xdf, 0x25, 0x9c, 0x5c, 0x37, 0xd0, 0x66, 0x12, 0x41, 0x66, 0x8c,
467 0x28, 0xd0, 0x3f, 0x5c, 0x7f, 0x15, 0x9b, 0xcf, 0xa0, 0xae, 0x29, 0x33,
468 0xb0, 0xe4, 0xb7, 0x36, 0x2a, 0x45, 0x83, 0xff, 0x86, 0x75, 0xcf, 0xa7,
469 0x4d, 0x5c, 0xa8, 0xcf, 0x3f, 0xf2, 0xc8, 0xde, 0xdd, 0xad, 0x42, 0x8f,
470 0x0e, 0xd0, 0x11, 0x24, 0x42, 0x86, 0x51, 0x52, 0x76, 0x21, 0x68, 0xf1,
471 0xa7, 0x8f, 0xdb, 0x5b, 0x78, 0xfa, 0x44, 0x5f, 0xee, 0x31, 0xda, 0x62,
472 0x5f, 0xfe, 0x69, 0xae, 0x97, 0xc9, 0xb5, 0x04, 0x76, 0x79, 0x2e, 0xb9,
473 0xd9, 0x1b, 0xdd, 0xb7, 0xc4, 0x12, 0x78, 0xb2, 0x4d, 0xab, 0xd2, 0x29,
474 0x25, 0x8c, 0xd5, 0x52, 0x4a, 0xd7, 0x2e, 0x18, 0x9d, 0xa2, 0xee, 0x7b,
475 0xa5, 0xe5, 0x35, 0x3c, 0xb5, 0x54, 0x1c, 0x7f, 0x87, 0x4b, 0xc0, 0xbb,
476 0x1a, 0x85, 0x19, 0xc0, 0xa9, 0x2b, 0x4d, 0xed, 0x71, 0xc0, 0x15, 0xb3,
477 0x49, 0x2c, 0x46, 0xfc, 0x37, 0x40, 0xc0, 0x60, 0xd0, 0x00, 0x96, 0xfa,
478 0x7f, 0xbb, 0x30, 0x94, 0x6b, 0x81, 0x61, 0xc5, 0x13, 0x93, 0x95, 0xaa,
479 0xf3, 0x8d, 0x1d, 0xac, 0xdb, 0xbd, 0xc3, 0x90, 0xf3, 0xd2, 0x5f, 0x3a,
480 0x08, 0xb1, 0xc9, 0x3a, 0xe8, 0x25, 0x4d, 0x20, 0x2a, 0xe9, 0x4c, 0xaf,
481 0x9b, 0x54, 0x7b, 0xaf, 0x89, 0x44, 0x3a, 0x60, 0x23, 0xd3, 0x02, 0xb1,
482 0xb3, 0x9a, 0x3a, 0xb0, 0xa0, 0xdb, 0x61, 0x0b, 0xac, 0x55, 0xa1, 0x36,
483 0x55, 0x5b, 0xc4, 0xc5, 0xbd, 0x2a, 0x16, 0xe9, 0xe7, 0x86, 0x7f, 0xdb,
484 0xee, 0x90, 0xfa, 0xfd, 0x08, 0x7f, 0x1a, 0x43, 0xe0, 0xb8, 0x21, 0xb3,
485 0xe3, 0xdf, 0x27, 0x56, 0x61, 0xc4, 0xe8, 0xd5, 0x60, 0xe9, 0x6d, 0x49,
486 0xd9, 0xa8, 0xf5, 0xd9, 0xfc, 0x66, 0x82, 0xe9, 0x80, 0x5b, 0x85, 0x16,
487 0x55, 0x2b, 0xef, 0x50, 0x90, 0x6c, 0x5d, 0x81, 0x00, 0x00, 0x88, 0x9b,
488 0xb4, 0x62, 0x49, 0x46, 0x2e, 0x5d, 0x71, 0x95, 0xff, 0x63, 0xfb, 0x93,
489 0x23, 0xf8, 0x9f, 0xa2, 0x55, 0x56, 0xd4, 0xd5, 0xf7, 0xae, 0xaf, 0xd3,
490 0xf6, 0x82, 0xc8, 0xdd, 0x89, 0x0f, 0x7e, 0x89, 0x0d, 0x0d, 0x7f, 0x4f,
491 0x84, 0xa7, 0x16, 0xe8, 0xaf, 0xf2, 0x95, 0xd7, 0xc3, 0x66, 0xd6, 0x85,
492 0x5b, 0xa1, 0xbb, 0xea, 0x31, 0x02, 0xac, 0xa2, 0x7b, 0x50, 0xf4, 0x78,
493 0x29, 0x49, 0x59, 0xf6, 0x41, 0x42, 0x52, 0xa8, 0x19, 0xfb, 0x3d, 0xda,
494 0xa9, 0x8d, 0xac, 0xe1, 0x25, 0xd4, 0x12, 0x1e, 0x2b, 0x48, 0x44, 0xb0,
495 0xf6, 0x29, 0xd0, 0x55, 0x22, 0xb4, 0xe7, 0xbc, 0x22, 0x97, 0x1f, 0xe2,
496 0xe1, 0x73, 0x16, 0x13, 0x7a, 0x00, 0x62, 0x14, 0xcb, 0x25, 0x9b, 0x21,
497 0x98, 0x9d, 0xb8, 0xd8, 0xf4, 0x65, 0xf6, 0x8f, 0x39, 0xe4, 0x76, 0xf7,
498 0x30, 0xaf, 0xbc, 0x3a, 0xfe, 0x0e, 0xf1, 0x81, 0xa7, 0xff, 0x4d, 0xa7,
499 0xff, 0xbf, 0x15, 0x60, 0x0b, 0xcd, 0x69, 0xd5, 0x77, 0xba, 0xcb, 0x7b,
500 0x5a, 0xfb, 0x34, 0xc7, 0x5d, 0x13, 0x33, 0xd7, 0x86, 0x02, 0x43, 0x57,
501 0x52, 0x2c, 0x74, 0x61, 0x21, 0xa3, 0x34, 0xf5, 0x89, 0x51, 0x44, 0x89,
502 0xfc, 0xbb, 0x57, 0x5c, 0x6d, 0xb0, 0x2e, 0x8c, 0xff, 0x73, 0xe5, 0x09,
503 0x13, 0x3b, 0x45, 0x5b, 0x27, 0x88, 0xee, 0x9b, 0xab, 0x57, 0x7c, 0x9b,
504 0xb9, 0x78, 0x73, 0xd2, 0x2d, 0x98, 0x6f, 0xd2, 0x78, 0xb3, 0xeb, 0xaa,
505 0x18, 0x44, 0x87, 0x6d, 0x51, 0x1e, 0x9b, 0x73, 0xaa, 0x91, 0x1a, 0x4f,
506 0x69, 0x78, 0xef, 0x3f, 0xb1, 0x2d, 0x39, 0x3e, 0xda, 0x31, 0xfc, 0x99,
507 0xf6, 0xa2, 0x8c, 0xe5, 0xfd, 0x97, 0x95, 0x77, 0x37, 0xef, 0xf5, 0xd1,
508 0xc8, 0x74, 0x2c, 0x9a, 0x1f, 0x23, 0x8f, 0x72, 0x96, 0x3d, 0xb5, 0xad,
509 0x28, 0xa0, 0x6c, 0x66, 0xe8, 0xee, 0xaa, 0x9d, 0xc2, 0x8a, 0x56, 0x54,
510 0x89, 0x74, 0x56, 0xdc, 0x57, 0x49, 0xc3, 0x8e, 0xb9, 0x3a, 0x91, 0x34,
511 0xc4, 0x5e, 0x0b, 0x13, 0x63, 0x5e, 0xeb, 0xc5, 0xef, 0xc7, 0xe9, 0x7f,
512 0x27, 0xe8, 0xe7, 0xe5, 0x0d, 0x83, 0x95, 0x5f, 0x8a, 0xf2, 0xb2, 0x22,
513 0x03, 0x8d, 0x71, 0x4f, 0x62, 0xb7, 0xf1, 0x87, 0xf5, 0x3f, 0xc4, 0x23,
514 0x21, 0x40, 0x35, 0xcf, 0x79, 0x7a, 0x5b, 0x9d, 0x76, 0xb2, 0xdc, 0x6a,
515 0xb5, 0x1d, 0x8b, 0xb6, 0x9a, 0x19, 0xe4, 0x87, 0xf5, 0xce, 0x38, 0xf3,
516 0x70, 0xbf, 0x9e, 0x86, 0xa6, 0x07, 0x53, 0xdd, 0x5d, 0xc7, 0x72, 0x84,
517 0x47, 0x38, 0xd0, 0xe2, 0xeb, 0x64, 0x4c, 0x3a, 0x1e, 0xf6, 0x56, 0x79,
518 0x75, 0x75, 0x14, 0x5d, 0xe4, 0x1d, 0x9d, 0xbb, 0xe1, 0x35, 0x03, 0x5e,
519 0x4f, 0x8f, 0xea, 0x95, 0xde, 0x19, 0x57, 0x98, 0xe9, 0x2c, 0x42, 0x22,
520 0xcb, 0x0f, 0x15, 0x7a, 0x6b, 0x53, 0xc3, 0xec, 0xdc, 0xa0, 0x66, 0x26,
521 0x91, 0x04, 0x83, 0x75, 0x09, 0x0c, 0x22, 0x05, 0xec, 0x3a, 0x2d, 0x39,
522 0xea, 0x19, 0xf2, 0x1d, 0xdb, 0xba, 0x5c, 0x46, 0x47, 0xd4, 0x94, 0x6d,
523 0x51, 0xdb, 0x68, 0xde, 0x0c, 0xa0, 0x36, 0x8f, 0xbc, 0xfd, 0x9b, 0x8f,
524 0xfe, 0x04, 0x1f, 0xde, 0x1e, 0x77, 0xb5, 0x80, 0xb9, 0x9c, 0x1b, 0x24,
525 0x61, 0xfc, 0x2b, 0xc0, 0x42, 0x2b, 0xc5, 0x90, 0x58, 0xa2, 0xb1, 0x38,
526 0x58, 0xf2, 0x8b, 0x65, 0xbf, 0xe8, 0xe6, 0x79, 0xcf, 0x65, 0x35, 0xa5,
527 0xe1, 0xb7, 0x8b, 0x95, 0x54, 0xd7, 0x1d, 0xf0, 0x91, 0x18, 0xc0, 0x5d,
528 0x2c, 0xb5, 0xca, 0x1a, 0x7f, 0x8d, 0xfb, 0x9e, 0x57, 0x1c, 0x5c, 0xf0,
529 0x94, 0x36, 0x51, 0x95, 0x27, 0x62, 0xca, 0x92, 0x96, 0xe5, 0x00, 0x2e,
530 0xa4, 0x41, 0x97, 0xbf, 0x28, 0x3c, 0x6d, 0xc1, 0xb7, 0xe9, 0x1c, 0x2e,
531 0x3e, 0xe0, 0x5e, 0x89, 0x0c, 0x78, 0x88, 0x80, 0xb8, 0x30, 0xd2, 0x22,
532 0xf9, 0x71, 0xb4, 0xc8, 0xee, 0xe6, 0x80, 0x04, 0x04, 0x9a, 0xfb, 0x0c,
533 0x36, 0xcb, 0xea, 0x66, 0xf9, 0x52, 0x8c, 0x66, 0xbf, 0x4c, 0x0f, 0xf4,
534 0xf8, 0x1e, 0x7e, 0x39, 0x80, 0xe8, 0x82, 0x4b, 0x0e, 0x66, 0x1d, 0x51,
535 0x16, 0xa9, 0x8d, 0xd6, 0xea, 0x33, 0xb0, 0x2c, 0x36, 0x25, 0xf5, 0x01,
536 0x30, 0x7e, 0x03, 0x7f, 0xae, 0x8e, 0xd6, 0x25, 0x62, 0x6d, 0x99, 0x8c,
537 0x1f, 0xc1, 0x22, 0xf0, 0x94, 0x80, 0xbf, 0x82, 0x51, 0xea, 0xc2, 0x5a,
538 0x3c, 0x85, 0x2a, 0x5d, 0xbe, 0xae, 0xe1, 0xe3, 0x07, 0x92, 0xd2, 0x40,
539 0x47, 0xe8, 0x0f, 0x1a, 0xa5, 0x73, 0x64, 0x26, 0xc4, 0xac, 0xca, 0xc2,
540 0x83, 0x5a, 0x56, 0xbc, 0x81, 0x21, 0xcb, 0x72, 0xf3, 0xe7, 0x82, 0x1e,
541 0xc8, 0x54, 0x18, 0x42, 0xfe, 0xd6, 0xfc, 0x96, 0x0e, 0x03, 0x29, 0x98,
542 0x4f, 0xd1, 0xd2, 0x98, 0x7c, 0x9e, 0x4e, 0x1a, 0x0f, 0xd6, 0x4e, 0xa4,
543 0x52, 0x1b, 0xd1, 0xd8, 0x36, 0xf7, 0x47, 0x5f, 0xce, 0xcb, 0x87, 0x36,
544 0xc8, 0x9b, 0x44, 0xc6, 0x7a, 0xf3, 0x45, 0x28, 0xae, 0x96, 0x5a, 0x85,
545 0x62, 0x8b, 0x10, 0xc2, 0x7b, 0x39, 0x51, 0xdf, 0xf4, 0x21, 0xc2, 0x6b,
546 0x6f, 0x93, 0x27, 0xed, 0xf6, 0xea, 0xff, 0x2a, 0x21, 0x70, 0x84, 0x4e,
547 0x21, 0xac, 0xbc, 0x06, 0x41, 0xd3, 0x59, 0xa0, 0xa1, 0x50, 0xa6, 0x87,
548 0xa2, 0x48, 0xad, 0x94, 0x44, 0x8d, 0x2f, 0xa8, 0xc6, 0x10, 0xb5, 0xeb,
549 0x66, 0x82, 0x94, 0x5f, 0xae, 0x6a, 0x56, 0xb4, 0x8d, 0xf4, 0x62, 0x80,
550 0xe4, 0x42, 0xc4, 0xbc, 0xe7, 0xee, 0xa6, 0x96, 0x3b, 0xfd, 0xc0, 0x92,
551 0x7d, 0xcd, 0xe7, 0x0c, 0x99, 0x9a, 0xb6, 0x83, 0xcf, 0x45, 0xe5, 0x74,
552 0xb3, 0xbc, 0xc0, 0x40, 0xad, 0x4d, 0xfc, 0xa7, 0x92, 0x35, 0x13, 0x81,
553 0x5c, 0x9c, 0x21, 0x00, 0xa4, 0x37, 0x07, 0x1d, 0x19, 0xfc, 0x88, 0x4d,
554 0x71, 0x43, 0x7d, 0x94, 0xf7, 0x32, 0xb8, 0x4b, 0x8a, 0x54, 0xd6, 0xe4,
555 0x37, 0x4f, 0x27, 0x1f, 0xfd, 0x45, 0x83, 0xb9, 0x14, 0x5a, 0xf7, 0x36,
556 0xdc, 0x98, 0xad, 0x99, 0xb9, 0x38, 0x69, 0xac, 0x18, 0x7e, 0x47, 0xd0,
557 0x63, 0x27, 0xba, 0xe7, 0xd5, 0x1d, 0x7b, 0x6e, 0xde, 0x28, 0x7b, 0xf1,
558 0x84, 0x4d, 0x2d, 0x7c, 0x16, 0x38, 0x4b, 0x16, 0xa9, 0x10, 0x83, 0xfb,
559 0xe0, 0xe0, 0x6f, 0xdd, 0x03, 0x0a, 0xb8, 0x81, 0xf5, 0x8c, 0x98, 0xc3,
560 0xf4, 0xc8, 0x31, 0x3a, 0xed, 0x14, 0x83, 0x89, 0xc3, 0x0e, 0xf7, 0xba,
561 0x84, 0xb0, 0x49, 0xdf, 0xc6, 0x6b, 0xed, 0xbe, 0xd4, 0xa3, 0x83, 0x3a,
562 0xe6, 0x6d, 0xa3, 0x83, 0x17, 0x43, 0x5e, 0x3a, 0x83, 0xda, 0x81, 0xe3,
563 0x26, 0x95, 0x6b, 0xe5, 0x30, 0x28, 0x6d, 0xec, 0xd7, 0xd7, 0x35, 0xfa,
564 0x1a, 0xad, 0x86, 0x04, 0x05, 0x2c, 0x76, 0x3f, 0xb2, 0x83, 0x92, 0x4e,
565 0xef, 0x05, 0xde, 0x13, 0x26, 0x68, 0x80, 0x57, 0xee, 0x92, 0x80, 0xa3,
566 0x99, 0xb4, 0xac, 0x98, 0x31, 0xd4, 0xf3, 0xe2, 0x60, 0xd9, 0xb9, 0x8d,
567 0x20, 0xf7, 0x97, 0x70, 0x10, 0xd6, 0xba, 0x86, 0xb8, 0x9c, 0xb8, 0xf8,
568 0x49, 0x71, 0x28, 0x9d, 0x05, 0x38, 0x1f, 0x63, 0xba, 0xf7, 0x15, 0x60,
569 0x96, 0x61, 0x84, 0x68, 0xeb, 0x5d, 0x28, 0x51, 0xe3, 0x51, 0xdd, 0x69,
570 0x8a, 0xdd, 0xba, 0xec, 0xbd, 0xd3, 0xa1, 0x42, 0x83, 0x59, 0x77, 0x11,
571 0x12, 0x86, 0x5b, 0x8d, 0x30, 0xcf, 0xdf, 0x6f, 0xea, 0x9d, 0x31, 0xa2,
572 0x65, 0xa5, 0x61, 0xc0, 0xde, 0x52, 0x6c, 0x72, 0x71, 0x0b, 0x4c, 0x7a,
573 0x4c, 0x9f, 0x75, 0x74, 0x38, 0xc8, 0xdd, 0x12, 0xba, 0x21, 0x57, 0x1b,
574 0x45, 0xb3, 0x02, 0x1d, 0x67, 0x22, 0x66, 0x53, 0x18, 0x48, 0xed, 0x60,
575 0x40, 0x55, 0xd1, 0x25, 0x3b, 0xbc, 0x08, 0x7b, 0x19, 0x8a, 0x30, 0x5b,
576 0x02, 0x4f, 0x65, 0x42, 0xff, 0xce, 0x87, 0xe8, 0x97, 0x2b, 0xbb, 0xfe,
577 0x52, 0x52, 0x72, 0xe8, 0xb5, 0x77, 0xb7, 0x8e, 0x94, 0x34, 0xbc, 0x46,
578 0xf1, 0xe1, 0x94, 0x98, 0x19, 0xbe, 0x7c, 0x3f, 0xf6, 0x0e, 0xe4, 0xbb,
579 0x88, 0x32, 0x07, 0x83, 0x64, 0xad, 0xd7, 0xd1, 0xe8, 0x35, 0x8d, 0x5d,
580 0x70, 0x16, 0xc8, 0x11, 0x94, 0x39, 0xc9, 0xac, 0xd6, 0xed, 0x6b, 0xdf,
581 0xc8, 0xf3, 0x1d, 0x5e, 0x37, 0xd8, 0xb5, 0x86, 0x9b, 0xc2, 0xdc, 0x3c,
582 0x5c, 0x04, 0x52, 0x5c, 0x11, 0x88, 0x0a, 0x2b, 0x78, 0x48, 0x9e, 0x5e,
583 0x98, 0x57, 0x5a, 0xd1, 0x77, 0x1c, 0x7d, 0x5f, 0x60, 0xbb, 0x61, 0x7e,
584 0x7e, 0x2a, 0xaf, 0x44, 0x14, 0x88, 0xfc, 0xa5, 0x31, 0xb7, 0xd4, 0x44,
585 0x48, 0xda, 0xb5, 0x71, 0xa8, 0xd8, 0x4f, 0x79, 0xcd, 0xe4, 0xbe, 0xb6,
586 0x1a, 0x61, 0x74, 0x4b, 0xd8, 0xec, 0xd7, 0xbf, 0xad, 0x57, 0x00, 0x42,
587 0x04, 0xe8, 0xb3, 0xec, 0x47, 0x1d, 0x2a, 0x0a, 0xde, 0x7c, 0x6e, 0x5e,
588 0xf8, 0xaa, 0x44, 0x05, 0x10, 0xab, 0xe9, 0x4e, 0xd7, 0x44, 0x0b, 0x97,
589 0x6f, 0x1a, 0xc1, 0x59, 0x2b, 0xe4, 0xe1, 0x8a, 0x13, 0x82, 0x65, 0xd8,
590 0xae, 0x5f, 0x2b, 0xbc, 0xa6, 0x14, 0x39, 0xaf, 0x38, 0x41, 0x26, 0x74,
591 0xdb, 0x55, 0x6b, 0xe2, 0x21, 0x80, 0x5d, 0x20, 0xc3, 0xf5, 0x82, 0xee,
592 0xcc, 0x3c, 0xc9, 0xb4, 0xeb, 0x52, 0xe9, 0x13, 0x8a, 0xea, 0xc6, 0x19,
593 0x70, 0x37, 0x1b, 0xb8, 0x2e, 0x86, 0xa2, 0xe9, 0x9d, 0xb6, 0xd5, 0xd6,
594 0xf3, 0xa8, 0x31, 0xf3, 0x02, 0xaa, 0x10, 0x33, 0x3f, 0xba, 0xf8, 0xf9,
595 0x46, 0x5b, 0xe1, 0xd7, 0x34, 0x9f, 0x94, 0xcb, 0xfb, 0xb1, 0x3d, 0x60,
596 0x77, 0x85, 0x14, 0xd4, 0xcf, 0x55, 0x60, 0x5d, 0x47, 0x6c, 0x07, 0xb4,
597 0xc7, 0x73, 0xbd, 0x49, 0xbd, 0xa5, 0x31, 0xa1, 0xfa, 0x34, 0x3a, 0x8b,
598 0x77, 0x1b, 0xaa, 0xaf, 0xa5, 0x87, 0x12, 0x4e, 0x36, 0x06, 0x14, 0xe7,
599 0xb3, 0xb8, 0x87, 0x6c, 0x4b, 0x50, 0xc9, 0x52, 0x1b, 0x19, 0x48, 0x69,
600 0x5b, 0x7f, 0xd8, 0xc9, 0x14, 0xb8, 0x11, 0xa0, 0x51, 0x09, 0xbd, 0x42,
601 0x5a, 0x50, 0x32, 0x57, 0x69, 0x39, 0x30, 0xdb, 0xbf, 0x8b, 0x93, 0x54,
602 0x43, 0x80, 0x4e, 0xd0, 0xc6, 0xf2, 0x81, 0x15, 0x6d, 0xef, 0x5a, 0xb6,
603 0x4d, 0x70, 0x93, 0x88, 0x8d, 0xce, 0x0d, 0xb8, 0xe9, 0xac, 0xa2, 0xcd,
604 0xc7, 0x18, 0xa5, 0x95, 0xb7, 0xf6, 0x0c, 0x6f, 0xe1, 0x10, 0x7b, 0x22,
605 0xf8, 0x81, 0x18, 0x42, 0x6a, 0x09, 0x75, 0x20, 0xb4, 0x2f, 0x67, 0x7a,
606 0xda, 0x55, 0x28, 0xc3, 0x81, 0xf7, 0xc1, 0xf0, 0xe6, 0x1b, 0x29, 0x9c,
607 0x72, 0x87, 0xe5, 0x4c, 0xa9, 0x5b, 0x5b, 0x62, 0xb5, 0xb7, 0x1e, 0x82,
608 0xc3, 0x7b, 0xaf, 0xe9, 0x6f, 0x37, 0x31, 0x9f, 0x79, 0xe7, 0x4f, 0x06,
609 0x1e, 0xff, 0xff, 0x80, 0x8e, 0x00, 0x00
610};
611
Sean Anderson8cba9882023-11-08 11:48:46 -0500612const size_t lzma_compressed_size = sizeof(lzma_compressed);
613
Sean Anderson576295d2023-10-14 16:48:02 -0400614int do_spl_test_load(struct unit_test_state *uts, const char *test_name,
615 enum spl_test_image type, struct spl_image_loader *loader,
616 int (*write_image)(struct unit_test_state *, void *, size_t))
617{
618 size_t img_size, img_data, plain_size = SPL_TEST_DATA_SIZE;
619 struct spl_image_info info_write = {
620 .name = test_name,
Sean Anderson430e4aa2023-10-14 16:48:04 -0400621 .size = type == LEGACY_LZMA ? sizeof(lzma_compressed) :
622 plain_size,
Sean Anderson576295d2023-10-14 16:48:02 -0400623 }, info_read = { };
624 struct spl_boot_device bootdev = {
625 .boot_device = loader->boot_device,
626 };
Sean Anderson430e4aa2023-10-14 16:48:04 -0400627 char *data, *plain;
Sean Anderson576295d2023-10-14 16:48:02 -0400628 void *img;
629
630 img_size = create_image(NULL, type, &info_write, &img_data);
631 ut_assert(img_size);
632 img = calloc(img_size, 1);
633 ut_assertnonnull(img);
634
Sean Anderson430e4aa2023-10-14 16:48:04 -0400635 data = img + img_data;
636 if (type == LEGACY_LZMA) {
637 plain = malloc(plain_size);
638 ut_assertnonnull(plain);
639 generate_data(plain, plain_size, "lzma");
640 memcpy(data, lzma_compressed, sizeof(lzma_compressed));
641 } else {
642 plain = data;
643 generate_data(plain, plain_size, test_name);
644 }
Sean Anderson576295d2023-10-14 16:48:02 -0400645 ut_asserteq(img_size, create_image(img, type, &info_write, NULL));
646
647 if (write_image(uts, img, img_size))
648 return CMD_RET_FAILURE;
649
650 ut_assertok(loader->load_image(&info_read, &bootdev));
651 if (check_image_info(uts, &info_write, &info_read))
652 return CMD_RET_FAILURE;
Sean Anderson430e4aa2023-10-14 16:48:04 -0400653 if (type == LEGACY_LZMA)
654 ut_asserteq(plain_size, info_read.size);
Sean Anderson576295d2023-10-14 16:48:02 -0400655 ut_asserteq_mem(plain, phys_to_virt(info_write.load_addr), plain_size);
656
Sean Anderson430e4aa2023-10-14 16:48:04 -0400657 if (type == LEGACY_LZMA)
658 free(plain);
Sean Anderson576295d2023-10-14 16:48:02 -0400659 free(img);
660 return 0;
661}