diff options
Diffstat (limited to 'common/spl')
-rw-r--r-- | common/spl/spl.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c index 3156401..95dd9d5 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -76,10 +76,23 @@ void spl_parse_image_header(const struct image_header *header) u32 header_size = sizeof(struct image_header); if (image_get_magic(header) == IH_MAGIC) { - spl_image.size = image_get_data_size(header) + header_size; - spl_image.entry_point = image_get_load(header); - /* Load including the header */ - spl_image.load_addr = spl_image.entry_point - header_size; + if (spl_image.flags & SPL_COPY_PAYLOAD_ONLY) { + /* + * On some system (e.g. powerpc), the load-address and + * entry-point is located at address 0. We can't load + * to 0-0x40. So skip header in this case. + */ + spl_image.load_addr = image_get_load(header); + spl_image.entry_point = image_get_ep(header); + spl_image.size = image_get_data_size(header); + } else { + spl_image.entry_point = image_get_load(header); + /* Load including the header */ + spl_image.load_addr = spl_image.entry_point - + header_size; + spl_image.size = image_get_data_size(header) + + header_size; + } spl_image.os = image_get_os(header); spl_image.name = image_get_name(header); debug("spl: payload image: %s load addr: 0x%x size: %d\n", |