mirror of
https://xff.cz/git/u-boot/
synced 2025-09-02 17:22:22 +02:00
[new uImage] Add dual format uImage support framework
This patch adds framework for dual format images. Format detection is added and the bootm controll flow is updated to include cases for new FIT format uImages. When the legacy (image_header based) format is detected appropriate legacy specific handling is invoked. For the new (FIT based) format uImages dual boot framework has a minial support, that will only print out a corresponding debug messages. Implementation of the FIT specific handling will be added in following patches. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
This commit is contained in:
@@ -53,7 +53,7 @@ int
|
||||
autoscript (ulong addr)
|
||||
{
|
||||
ulong len;
|
||||
image_header_t *hdr = (image_header_t *)addr;
|
||||
image_header_t *hdr;
|
||||
ulong *data;
|
||||
char *cmd;
|
||||
int rcode = 0;
|
||||
@@ -61,33 +61,47 @@ autoscript (ulong addr)
|
||||
|
||||
verify = getenv_verify ();
|
||||
|
||||
if (!image_check_magic (hdr)) {
|
||||
puts ("Bad magic number\n");
|
||||
return 1;
|
||||
}
|
||||
switch (gen_image_get_format ((void *)addr)) {
|
||||
case IMAGE_FORMAT_LEGACY:
|
||||
hdr = (image_header_t *)addr;
|
||||
|
||||
if (!image_check_hcrc (hdr)) {
|
||||
puts ("Bad header crc\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
if (!image_check_dcrc (hdr)) {
|
||||
puts ("Bad data crc\n");
|
||||
if (!image_check_magic (hdr)) {
|
||||
puts ("Bad magic number\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!image_check_type (hdr, IH_TYPE_SCRIPT)) {
|
||||
puts ("Bad image type\n");
|
||||
if (!image_check_hcrc (hdr)) {
|
||||
puts ("Bad header crc\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (verify) {
|
||||
if (!image_check_dcrc (hdr)) {
|
||||
puts ("Bad data crc\n");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!image_check_type (hdr, IH_TYPE_SCRIPT)) {
|
||||
puts ("Bad image type\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* get length of script */
|
||||
data = (ulong *)image_get_data (hdr);
|
||||
|
||||
if ((len = image_to_cpu (*data)) == 0) {
|
||||
puts ("Empty Script\n");
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
#if defined(CONFIG_FIT)
|
||||
case IMAGE_FORMAT_FIT:
|
||||
fit_unsupported ("autoscript");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* get length of script */
|
||||
data = (ulong *)image_get_data (hdr);
|
||||
|
||||
if ((len = image_to_cpu (*data)) == 0) {
|
||||
puts ("Empty Script\n");
|
||||
#endif
|
||||
default:
|
||||
puts ("Wrong image format for autoscript\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user