Commit 8c80eb3b533c73a4b4a505fbaf925cdaafe0b5d2

Authored by Albert ARIBAUD \(3ADEV\)
Committed by Albert ARIBAUD
1 parent 39f520bb62

Introduce CONFIG_SPL_PANIC_ON_RAW_IMAGE

introduce CONFIG_SPL_PANIC_ON_RAW_IMAGE.
An SPL which define this will panic() if the
image it has loaded does not have a mkimage
signature.

Signed-off-by: Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>

Showing 2 changed files with 22 additions and 0 deletions Side-by-side Diff

... ... @@ -3607,6 +3607,16 @@
3607 3607 CONFIG_SPL_STACK
3608 3608 Adress of the start of the stack SPL will use
3609 3609  
  3610 + CONFIG_SPL_PANIC_ON_RAW_IMAGE
  3611 + When defined, SPL will panic() if the image it has
  3612 + loaded does not have a signature.
  3613 + Defining this is useful when code which loads images
  3614 + in SPL cannot guarantee that absolutely all read errors
  3615 + will be caught.
  3616 + An example is the LPC32XX MLC NAND driver, which will
  3617 + consider that a completely unreadable NAND block is bad,
  3618 + and thus should be skipped silently.
  3619 +
3610 3620 CONFIG_SPL_RELOC_STACK
3611 3621 Adress of the start of the stack SPL will use after
3612 3622 relocation. If unspecified, this is equal to
... ... @@ -101,10 +101,22 @@
101 101 (int)sizeof(spl_image.name), spl_image.name,
102 102 spl_image.load_addr, spl_image.size);
103 103 } else {
  104 +#ifdef CONFIG_SPL_PANIC_ON_RAW_IMAGE
  105 + /*
  106 + * CONFIG_SPL_PANIC_ON_RAW_IMAGE is defined when the
  107 + * code which loads images in SPL cannot guarantee that
  108 + * absolutely all read errors will be reported.
  109 + * An example is the LPC32XX MLC NAND driver, which
  110 + * will consider that a completely unreadable NAND block
  111 + * is bad, and thus should be skipped silently.
  112 + */
  113 + panic("** no mkimage signature but raw image not supported");
  114 +#else
104 115 /* Signature not found - assume u-boot.bin */
105 116 debug("mkimage signature not found - ih_magic = %x\n",
106 117 header->ih_magic);
107 118 spl_set_header_raw_uboot();
  119 +#endif
108 120 }
109 121 }
110 122