spl_fit.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright (C) 2016 Google, Inc
  4. * Written by Simon Glass <sjg@chromium.org>
  5. */
  6. #include <common.h>
  7. #include <errno.h>
  8. #include <board.h>
  9. #include <fpga.h>
  10. #include <gzip.h>
  11. #include <image.h>
  12. #include <malloc.h>
  13. #include <spl.h>
  14. #include <linux/libfdt.h>
  15. DECLARE_GLOBAL_DATA_PTR;
  16. #ifndef CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ
  17. #define CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ (64 * 1024)
  18. #endif
  19. #ifndef CONFIG_SYS_BOOTM_LEN
  20. #define CONFIG_SYS_BOOTM_LEN (64 << 20)
  21. #endif
  22. __weak void board_spl_fit_post_load(ulong load_addr, size_t length)
  23. {
  24. }
  25. __weak ulong board_spl_fit_size_align(ulong size)
  26. {
  27. return size;
  28. }
  29. static int find_node_from_desc(const void *fit, int node, const char *str)
  30. {
  31. int child;
  32. if (node < 0)
  33. return -EINVAL;
  34. /* iterate the FIT nodes and find a matching description */
  35. for (child = fdt_first_subnode(fit, node); child >= 0;
  36. child = fdt_next_subnode(fit, child)) {
  37. int len;
  38. const char *desc = fdt_getprop(fit, child, "description", &len);
  39. if (!desc)
  40. continue;
  41. if (!strcmp(desc, str))
  42. return child;
  43. }
  44. return -ENOENT;
  45. }
  46. /**
  47. * spl_fit_get_image_name(): By using the matching configuration subnode,
  48. * retrieve the name of an image, specified by a property name and an index
  49. * into that.
  50. * @fit: Pointer to the FDT blob.
  51. * @images: Offset of the /images subnode.
  52. * @type: Name of the property within the configuration subnode.
  53. * @index: Index into the list of strings in this property.
  54. * @outname: Name of the image
  55. *
  56. * Return: 0 on success, or a negative error number
  57. */
  58. static int spl_fit_get_image_name(const void *fit, int images,
  59. const char *type, int index,
  60. const char **outname)
  61. {
  62. struct udevice *board;
  63. const char *name, *str;
  64. __maybe_unused int node;
  65. int conf_node;
  66. int len, i;
  67. bool found = true;
  68. conf_node = fit_find_config_node(fit);
  69. if (conf_node < 0) {
  70. #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
  71. printf("No matching DT out of these options:\n");
  72. for (node = fdt_first_subnode(fit, conf_node);
  73. node >= 0;
  74. node = fdt_next_subnode(fit, node)) {
  75. name = fdt_getprop(fit, node, "description", &len);
  76. printf(" %s\n", name);
  77. }
  78. #endif
  79. return conf_node;
  80. }
  81. name = fdt_getprop(fit, conf_node, type, &len);
  82. if (!name) {
  83. debug("cannot find property '%s': %d\n", type, len);
  84. return -EINVAL;
  85. }
  86. str = name;
  87. for (i = 0; i < index; i++) {
  88. str = strchr(str, '\0') + 1;
  89. if (!str || (str - name >= len)) {
  90. found = false;
  91. break;
  92. }
  93. }
  94. if (!found && !board_get(&board)) {
  95. int rc;
  96. /*
  97. * no string in the property for this index. Check if the board
  98. * level code can supply one.
  99. */
  100. rc = board_get_fit_loadable(board, index - i - 1, type, &str);
  101. if (rc && rc != -ENOENT)
  102. return rc;
  103. if (!rc) {
  104. /*
  105. * The board provided a name for a loadable.
  106. * Try to match it against the description properties
  107. * first. If no matching node is found, use it as a
  108. * node name.
  109. */
  110. int node;
  111. int images = fdt_path_offset(fit, FIT_IMAGES_PATH);
  112. node = find_node_from_desc(fit, images, str);
  113. if (node > 0)
  114. str = fdt_get_name(fit, node, NULL);
  115. found = true;
  116. }
  117. }
  118. if (!found) {
  119. debug("no string for index %d\n", index);
  120. return -E2BIG;
  121. }
  122. *outname = str;
  123. return 0;
  124. }
  125. /**
  126. * spl_fit_get_image_node(): By using the matching configuration subnode,
  127. * retrieve the name of an image, specified by a property name and an index
  128. * into that.
  129. * @fit: Pointer to the FDT blob.
  130. * @images: Offset of the /images subnode.
  131. * @type: Name of the property within the configuration subnode.
  132. * @index: Index into the list of strings in this property.
  133. *
  134. * Return: the node offset of the respective image node or a negative
  135. * error number.
  136. */
  137. static int spl_fit_get_image_node(const void *fit, int images,
  138. const char *type, int index)
  139. {
  140. const char *str;
  141. int err;
  142. int node;
  143. err = spl_fit_get_image_name(fit, images, type, index, &str);
  144. if (err)
  145. return err;
  146. debug("%s: '%s'\n", type, str);
  147. node = fdt_subnode_offset(fit, images, str);
  148. if (node < 0) {
  149. pr_err("cannot find image node '%s': %d\n", str, node);
  150. return -EINVAL;
  151. }
  152. return node;
  153. }
  154. static int get_aligned_image_offset(struct spl_load_info *info, int offset)
  155. {
  156. /*
  157. * If it is a FS read, get the first address before offset which is
  158. * aligned to ARCH_DMA_MINALIGN. If it is raw read return the
  159. * block number to which offset belongs.
  160. */
  161. if (info->filename)
  162. return offset & ~(ARCH_DMA_MINALIGN - 1);
  163. return offset / info->bl_len;
  164. }
  165. static int get_aligned_image_overhead(struct spl_load_info *info, int offset)
  166. {
  167. /*
  168. * If it is a FS read, get the difference between the offset and
  169. * the first address before offset which is aligned to
  170. * ARCH_DMA_MINALIGN. If it is raw read return the offset within the
  171. * block.
  172. */
  173. if (info->filename)
  174. return offset & (ARCH_DMA_MINALIGN - 1);
  175. return offset % info->bl_len;
  176. }
  177. static int get_aligned_image_size(struct spl_load_info *info, int data_size,
  178. int offset)
  179. {
  180. data_size = data_size + get_aligned_image_overhead(info, offset);
  181. if (info->filename)
  182. return data_size;
  183. return (data_size + info->bl_len - 1) / info->bl_len;
  184. }
  185. /**
  186. * spl_load_fit_image(): load the image described in a certain FIT node
  187. * @info: points to information about the device to load data from
  188. * @sector: the start sector of the FIT image on the device
  189. * @fit: points to the flattened device tree blob describing the FIT
  190. * image
  191. * @base_offset: the beginning of the data area containing the actual
  192. * image data, relative to the beginning of the FIT
  193. * @node: offset of the DT node describing the image to load (relative
  194. * to @fit)
  195. * @image_info: will be filled with information about the loaded image
  196. * If the FIT node does not contain a "load" (address) property,
  197. * the image gets loaded to the address pointed to by the
  198. * load_addr member in this struct.
  199. *
  200. * Return: 0 on success or a negative error number.
  201. */
  202. static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
  203. void *fit, ulong base_offset, int node,
  204. struct spl_image_info *image_info)
  205. {
  206. int offset;
  207. size_t length;
  208. int len;
  209. ulong size;
  210. ulong load_addr, load_ptr;
  211. void *src;
  212. ulong overhead;
  213. int nr_sectors;
  214. int align_len = ARCH_DMA_MINALIGN - 1;
  215. uint8_t image_comp = -1, type = -1;
  216. const void *data;
  217. bool external_data = false;
  218. if (IS_ENABLED(CONFIG_SPL_FPGA_SUPPORT) ||
  219. (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP))) {
  220. if (fit_image_get_type(fit, node, &type))
  221. puts("Cannot get image type.\n");
  222. else
  223. debug("%s ", genimg_get_type_name(type));
  224. }
  225. if (IS_ENABLED(CONFIG_SPL_GZIP)) {
  226. fit_image_get_comp(fit, node, &image_comp);
  227. debug("%s ", genimg_get_comp_name(image_comp));
  228. }
  229. if (fit_image_get_load(fit, node, &load_addr))
  230. load_addr = image_info->load_addr;
  231. if (!fit_image_get_data_position(fit, node, &offset)) {
  232. external_data = true;
  233. } else if (!fit_image_get_data_offset(fit, node, &offset)) {
  234. offset += base_offset;
  235. external_data = true;
  236. }
  237. if (external_data) {
  238. /* External data */
  239. if (fit_image_get_data_size(fit, node, &len))
  240. return -ENOENT;
  241. load_ptr = (load_addr + align_len) & ~align_len;
  242. length = len;
  243. overhead = get_aligned_image_overhead(info, offset);
  244. nr_sectors = get_aligned_image_size(info, length, offset);
  245. if (info->read(info,
  246. sector + get_aligned_image_offset(info, offset),
  247. nr_sectors, (void *)load_ptr) != nr_sectors)
  248. return -EIO;
  249. debug("External data: dst=%lx, offset=%x, size=%lx\n",
  250. load_ptr, offset, (unsigned long)length);
  251. src = (void *)load_ptr + overhead;
  252. } else {
  253. /* Embedded data */
  254. if (fit_image_get_data(fit, node, &data, &length)) {
  255. puts("Cannot get image data/size\n");
  256. return -ENOENT;
  257. }
  258. debug("Embedded data: dst=%lx, size=%lx\n", load_addr,
  259. (unsigned long)length);
  260. src = (void *)data;
  261. }
  262. #ifdef CONFIG_SPL_FIT_SIGNATURE
  263. printf("## Checking hash(es) for Image %s ... ",
  264. fit_get_name(fit, node, NULL));
  265. if (!fit_image_verify_with_data(fit, node,
  266. src, length))
  267. return -EPERM;
  268. puts("OK\n");
  269. #endif
  270. #ifdef CONFIG_SPL_FIT_IMAGE_POST_PROCESS
  271. board_fit_image_post_process(&src, &length);
  272. #endif
  273. if (IS_ENABLED(CONFIG_SPL_GZIP) && image_comp == IH_COMP_GZIP) {
  274. size = length;
  275. if (gunzip((void *)load_addr, CONFIG_SYS_BOOTM_LEN,
  276. src, &size)) {
  277. puts("Uncompressing error\n");
  278. return -EIO;
  279. }
  280. length = size;
  281. } else {
  282. memcpy((void *)load_addr, src, length);
  283. }
  284. if (image_info) {
  285. image_info->load_addr = load_addr;
  286. image_info->size = length;
  287. image_info->entry_point = fdt_getprop_u32(fit, node, "entry");
  288. }
  289. return 0;
  290. }
  291. static int spl_fit_append_fdt(struct spl_image_info *spl_image,
  292. struct spl_load_info *info, ulong sector,
  293. void *fit, int images, ulong base_offset)
  294. {
  295. struct spl_image_info image_info;
  296. int node, ret = 0, index = 0;
  297. /*
  298. * Use the address following the image as target address for the
  299. * device tree.
  300. */
  301. image_info.load_addr = spl_image->load_addr + spl_image->size;
  302. /* Figure out which device tree the board wants to use */
  303. node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, index++);
  304. if (node < 0) {
  305. debug("%s: cannot find FDT node\n", __func__);
  306. /*
  307. * U-Boot did not find a device tree inside the FIT image. Use
  308. * the U-Boot device tree instead.
  309. */
  310. if (gd->fdt_blob)
  311. memcpy((void *)image_info.load_addr, gd->fdt_blob,
  312. fdt_totalsize(gd->fdt_blob));
  313. else
  314. return node;
  315. } else {
  316. ret = spl_load_fit_image(info, sector, fit, base_offset, node,
  317. &image_info);
  318. if (ret < 0)
  319. return ret;
  320. }
  321. /* Make the load-address of the FDT available for the SPL framework */
  322. spl_image->fdt_addr = (void *)image_info.load_addr;
  323. #if !CONFIG_IS_ENABLED(FIT_IMAGE_TINY)
  324. if (CONFIG_IS_ENABLED(LOAD_FIT_APPLY_OVERLAY)) {
  325. void *tmpbuffer = NULL;
  326. for (; ; index++) {
  327. node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP,
  328. index);
  329. if (node == -E2BIG) {
  330. debug("%s: No additional FDT node\n", __func__);
  331. break;
  332. } else if (node < 0) {
  333. debug("%s: unable to find FDT node %d\n",
  334. __func__, index);
  335. continue;
  336. }
  337. if (!tmpbuffer) {
  338. /*
  339. * allocate memory to store the DT overlay
  340. * before it is applied. It may not be used
  341. * depending on how the overlay is stored, so
  342. * don't fail yet if the allocation failed.
  343. */
  344. tmpbuffer = malloc(CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY_BUF_SZ);
  345. if (!tmpbuffer)
  346. debug("%s: unable to allocate space for overlays\n",
  347. __func__);
  348. }
  349. image_info.load_addr = (ulong)tmpbuffer;
  350. ret = spl_load_fit_image(info, sector, fit, base_offset,
  351. node, &image_info);
  352. if (ret < 0)
  353. break;
  354. /* Make room in FDT for changes from the overlay */
  355. ret = fdt_increase_size(spl_image->fdt_addr,
  356. image_info.size);
  357. if (ret < 0)
  358. break;
  359. ret = fdt_overlay_apply_verbose(spl_image->fdt_addr,
  360. (void *)image_info.load_addr);
  361. if (ret) {
  362. pr_err("failed to apply DT overlay %s\n",
  363. fit_get_name(fit, node, NULL));
  364. break;
  365. }
  366. debug("%s: DT overlay %s applied\n", __func__,
  367. fit_get_name(fit, node, NULL));
  368. }
  369. free(tmpbuffer);
  370. if (ret)
  371. return ret;
  372. }
  373. /* Try to make space, so we can inject details on the loadables */
  374. ret = fdt_shrink_to_minimum(spl_image->fdt_addr, 8192);
  375. if (ret < 0)
  376. return ret;
  377. #endif
  378. return ret;
  379. }
  380. static int spl_fit_record_loadable(const void *fit, int images, int index,
  381. void *blob, struct spl_image_info *image)
  382. {
  383. int ret = 0;
  384. #if !CONFIG_IS_ENABLED(FIT_IMAGE_TINY)
  385. const char *name;
  386. int node;
  387. ret = spl_fit_get_image_name(fit, images, "loadables",
  388. index, &name);
  389. if (ret < 0)
  390. return ret;
  391. node = spl_fit_get_image_node(fit, images, "loadables", index);
  392. ret = fdt_record_loadable(blob, index, name, image->load_addr,
  393. image->size, image->entry_point,
  394. fdt_getprop(fit, node, "type", NULL),
  395. fdt_getprop(fit, node, "os", NULL));
  396. #endif
  397. return ret;
  398. }
  399. static int spl_fit_image_get_os(const void *fit, int noffset, uint8_t *os)
  400. {
  401. #if CONFIG_IS_ENABLED(FIT_IMAGE_TINY) && !defined(CONFIG_SPL_OS_BOOT)
  402. return -ENOTSUPP;
  403. #else
  404. return fit_image_get_os(fit, noffset, os);
  405. #endif
  406. }
  407. /*
  408. * Weak default function to allow customizing SPL fit loading for load-only
  409. * use cases by allowing to skip the parsing/processing of the FIT contents
  410. * (so that this can be done separately in a more customized fashion)
  411. */
  412. __weak bool spl_load_simple_fit_skip_processing(void)
  413. {
  414. return false;
  415. }
  416. int spl_load_simple_fit(struct spl_image_info *spl_image,
  417. struct spl_load_info *info, ulong sector, void *fit)
  418. {
  419. int sectors;
  420. ulong size;
  421. unsigned long count;
  422. struct spl_image_info image_info;
  423. int node = -1;
  424. int images, ret;
  425. int base_offset, hsize, align_len = ARCH_DMA_MINALIGN - 1;
  426. int index = 0;
  427. int firmware_node;
  428. /*
  429. * For FIT with external data, figure out where the external images
  430. * start. This is the base for the data-offset properties in each
  431. * image.
  432. */
  433. size = fdt_totalsize(fit);
  434. size = (size + 3) & ~3;
  435. size = board_spl_fit_size_align(size);
  436. base_offset = (size + 3) & ~3;
  437. /*
  438. * So far we only have one block of data from the FIT. Read the entire
  439. * thing, including that first block, placing it so it finishes before
  440. * where we will load the image.
  441. *
  442. * Note that we will load the image such that its first byte will be
  443. * at the load address. Since that byte may be part-way through a
  444. * block, we may load the image up to one block before the load
  445. * address. So take account of that here by subtracting an addition
  446. * block length from the FIT start position.
  447. *
  448. * In fact the FIT has its own load address, but we assume it cannot
  449. * be before CONFIG_SYS_TEXT_BASE.
  450. *
  451. * For FIT with data embedded, data is loaded as part of FIT image.
  452. * For FIT with external data, data is not loaded in this step.
  453. */
  454. hsize = (size + info->bl_len + align_len) & ~align_len;
  455. fit = spl_get_load_buffer(-hsize, hsize);
  456. sectors = get_aligned_image_size(info, size, 0);
  457. count = info->read(info, sector, sectors, fit);
  458. debug("fit read sector %lx, sectors=%d, dst=%p, count=%lu, size=0x%lx\n",
  459. sector, sectors, fit, count, size);
  460. if (count == 0)
  461. return -EIO;
  462. /* skip further processing if requested to enable load-only use cases */
  463. if (spl_load_simple_fit_skip_processing())
  464. return 0;
  465. /* find the node holding the images information */
  466. images = fdt_path_offset(fit, FIT_IMAGES_PATH);
  467. if (images < 0) {
  468. debug("%s: Cannot find /images node: %d\n", __func__, images);
  469. return -1;
  470. }
  471. #ifdef CONFIG_SPL_FPGA_SUPPORT
  472. node = spl_fit_get_image_node(fit, images, "fpga", 0);
  473. if (node >= 0) {
  474. /* Load the image and set up the spl_image structure */
  475. ret = spl_load_fit_image(info, sector, fit, base_offset, node,
  476. spl_image);
  477. if (ret) {
  478. printf("%s: Cannot load the FPGA: %i\n", __func__, ret);
  479. return ret;
  480. }
  481. debug("FPGA bitstream at: %x, size: %x\n",
  482. (u32)spl_image->load_addr, spl_image->size);
  483. ret = fpga_load(0, (const void *)spl_image->load_addr,
  484. spl_image->size, BIT_FULL);
  485. if (ret) {
  486. printf("%s: Cannot load the image to the FPGA\n",
  487. __func__);
  488. return ret;
  489. }
  490. puts("FPGA image loaded from FIT\n");
  491. node = -1;
  492. }
  493. #endif
  494. /*
  495. * Find the U-Boot image using the following search order:
  496. * - start at 'firmware' (e.g. an ARM Trusted Firmware)
  497. * - fall back 'kernel' (e.g. a Falcon-mode OS boot
  498. * - fall back to using the first 'loadables' entry
  499. */
  500. if (node < 0)
  501. node = spl_fit_get_image_node(fit, images, FIT_FIRMWARE_PROP,
  502. 0);
  503. #ifdef CONFIG_SPL_OS_BOOT
  504. if (node < 0)
  505. node = spl_fit_get_image_node(fit, images, FIT_KERNEL_PROP, 0);
  506. #endif
  507. if (node < 0) {
  508. debug("could not find firmware image, trying loadables...\n");
  509. node = spl_fit_get_image_node(fit, images, "loadables", 0);
  510. /*
  511. * If we pick the U-Boot image from "loadables", start at
  512. * the second image when later loading additional images.
  513. */
  514. index = 1;
  515. }
  516. if (node < 0) {
  517. debug("%s: Cannot find u-boot image node: %d\n",
  518. __func__, node);
  519. return -1;
  520. }
  521. /* Load the image and set up the spl_image structure */
  522. ret = spl_load_fit_image(info, sector, fit, base_offset, node,
  523. spl_image);
  524. if (ret)
  525. return ret;
  526. /*
  527. * For backward compatibility, we treat the first node that is
  528. * as a U-Boot image, if no OS-type has been declared.
  529. */
  530. if (!spl_fit_image_get_os(fit, node, &spl_image->os))
  531. debug("Image OS is %s\n", genimg_get_os_name(spl_image->os));
  532. #if !defined(CONFIG_SPL_OS_BOOT)
  533. else
  534. spl_image->os = IH_OS_U_BOOT;
  535. #endif
  536. /*
  537. * Booting a next-stage U-Boot may require us to append the FDT.
  538. * We allow this to fail, as the U-Boot image might embed its FDT.
  539. */
  540. if (spl_image->os == IH_OS_U_BOOT)
  541. spl_fit_append_fdt(spl_image, info, sector, fit,
  542. images, base_offset);
  543. firmware_node = node;
  544. /* Now check if there are more images for us to load */
  545. for (; ; index++) {
  546. uint8_t os_type = IH_OS_INVALID;
  547. node = spl_fit_get_image_node(fit, images, "loadables", index);
  548. if (node < 0)
  549. break;
  550. /*
  551. * if the firmware is also a loadable, skip it because
  552. * it already has been loaded. This is typically the case with
  553. * u-boot.img generated by mkimage.
  554. */
  555. if (firmware_node == node)
  556. continue;
  557. ret = spl_load_fit_image(info, sector, fit, base_offset, node,
  558. &image_info);
  559. if (ret < 0)
  560. continue;
  561. if (!spl_fit_image_get_os(fit, node, &os_type))
  562. debug("Loadable is %s\n", genimg_get_os_name(os_type));
  563. if (os_type == IH_OS_U_BOOT) {
  564. spl_fit_append_fdt(&image_info, info, sector,
  565. fit, images, base_offset);
  566. spl_image->fdt_addr = image_info.fdt_addr;
  567. }
  568. /*
  569. * If the "firmware" image did not provide an entry point,
  570. * use the first valid entry point from the loadables.
  571. */
  572. if (spl_image->entry_point == FDT_ERROR &&
  573. image_info.entry_point != FDT_ERROR)
  574. spl_image->entry_point = image_info.entry_point;
  575. /* Record our loadables into the FDT */
  576. if (spl_image->fdt_addr)
  577. spl_fit_record_loadable(fit, images, index,
  578. spl_image->fdt_addr,
  579. &image_info);
  580. }
  581. /*
  582. * If a platform does not provide CONFIG_SYS_UBOOT_START, U-Boot's
  583. * Makefile will set it to 0 and it will end up as the entry point
  584. * here. What it actually means is: use the load address.
  585. */
  586. if (spl_image->entry_point == FDT_ERROR || spl_image->entry_point == 0)
  587. spl_image->entry_point = spl_image->load_addr;
  588. spl_image->flags |= SPL_FIT_FOUND;
  589. #ifdef CONFIG_IMX_HAB
  590. board_spl_fit_post_load((ulong)fit, size);
  591. #endif
  592. return 0;
  593. }