summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2008-02-04 08:28:09 +0100
committerMarian Balakowicz <m8@semihalf.com>2008-02-25 15:53:49 +0100
commitd5934ad7756f038a393a9cfab76a4fe306d9d930 (patch)
tree0299a8fc06709c436f3e1715f80f3e5f9f00885d /board
parent5583cbf736474ef754e128a54fb78632f57b48fd (diff)
downloadblackbird-obmc-uboot-d5934ad7756f038a393a9cfab76a4fe306d9d930.tar.gz
blackbird-obmc-uboot-d5934ad7756f038a393a9cfab76a4fe306d9d930.zip
[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>
Diffstat (limited to 'board')
-rw-r--r--board/cray/L1/L1.c7
-rw-r--r--board/esd/common/auto_update.c19
-rw-r--r--board/mcc200/auto_update.c19
-rw-r--r--board/mpl/common/common_util.c7
-rw-r--r--board/siemens/common/fpga.c14
-rw-r--r--board/trab/auto_update.c26
6 files changed, 92 insertions, 0 deletions
diff --git a/board/cray/L1/L1.c b/board/cray/L1/L1.c
index 8e6d74eef5..c00acc87ae 100644
--- a/board/cray/L1/L1.c
+++ b/board/cray/L1/L1.c
@@ -140,6 +140,13 @@ int misc_init_r (void)
char bootcmd[32];
hdr = (image_header_t *) (CFG_MONITOR_BASE - image_get_header_size ());
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
timestamp = (time_t)image_get_time (hdr);
to_tm (timestamp, &tm);
printf ("Welcome to U-Boot on Cray L1. Compiled %4d-%02d-%02d %2d:%02d:%02d (UTC)\n", tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
diff --git a/board/esd/common/auto_update.c b/board/esd/common/auto_update.c
index cb8087bee8..976707dfe6 100644
--- a/board/esd/common/auto_update.c
+++ b/board/esd/common/auto_update.c
@@ -91,6 +91,12 @@ int au_check_cksum_valid(int i, long nbytes)
image_header_t *hdr;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
if ((au_image[i].type == AU_FIRMWARE) &&
(au_image[i].size != image_get_data_size (hdr))) {
@@ -118,6 +124,13 @@ int au_check_header_valid(int i, long nbytes)
unsigned long checksum;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* check the easy ones first */
#undef CHECK_VALID_DEBUG
#ifdef CHECK_VALID_DEBUG
@@ -183,6 +196,12 @@ int au_do_update(int i, long sz)
#endif
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
switch (au_image[i].type) {
case AU_SCRIPT:
diff --git a/board/mcc200/auto_update.c b/board/mcc200/auto_update.c
index 8b520c8599..fcae35aaf8 100644
--- a/board/mcc200/auto_update.c
+++ b/board/mcc200/auto_update.c
@@ -143,6 +143,12 @@ int au_check_cksum_valid(int idx, long nbytes)
image_header_t *hdr;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
if (nbytes != image_get_image_size (hdr)) {
printf ("Image %s bad total SIZE\n", aufile[idx]);
@@ -162,6 +168,13 @@ int au_check_header_valid(int idx, long nbytes)
unsigned long checksum, fsize;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* check the easy ones first */
#undef CHECK_VALID_DEBUG
#ifdef CHECK_VALID_DEBUG
@@ -233,6 +246,12 @@ int au_do_update(int idx, long sz)
uint nbytes;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
/* execute a script */
if (image_check_type (hdr, IH_TYPE_SCRIPT)) {
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index b171ca5173..fffd25c2be 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -181,6 +181,13 @@ mpl_prg_image(uchar *ld_addr)
image_header_t *hdr = (image_header_t *)ld_addr;
int rc;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
if (!image_check_magic (hdr)) {
puts("Bad Magic Number\n");
return 1;
diff --git a/board/siemens/common/fpga.c b/board/siemens/common/fpga.c
index 9d719460dc..a9a6dfed69 100644
--- a/board/siemens/common/fpga.c
+++ b/board/siemens/common/fpga.c
@@ -137,6 +137,13 @@ static int fpga_load (fpga_t* fpga, ulong addr, int checkall)
char msg[32];
int verify, i;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/*
* Check the image header and data of the net-list
*/
@@ -333,6 +340,13 @@ int fpga_init (void)
}
hdr = (image_header_t *)addr;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
if ((new_id = fpga_get_version(fpga, image_get_name (hdr))) == -1)
return 1;
diff --git a/board/trab/auto_update.c b/board/trab/auto_update.c
index bd9ee0c011..8f6753592b 100644
--- a/board/trab/auto_update.c
+++ b/board/trab/auto_update.c
@@ -211,6 +211,12 @@ au_check_cksum_valid(int idx, long nbytes)
image_header_t *hdr;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
if (nbytes != image_get_image_size (hdr))
{
@@ -234,6 +240,13 @@ au_check_header_valid(int idx, long nbytes)
unsigned char buf[4];
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* check the easy ones first */
#undef CHECK_VALID_DEBUG
#ifdef CHECK_VALID_DEBUG
@@ -327,6 +340,12 @@ au_do_update(int idx, long sz)
uint nbytes;
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
/* disable the power switch */
*CPLD_VFD_BK |= POWER_OFF;
@@ -417,6 +436,13 @@ au_update_eeprom(int idx)
}
hdr = (image_header_t *)LOAD_ADDR;
+#if defined(CONFIG_FIT)
+ if (gen_image_get_format ((void *)hdr) != IMAGE_FORMAT_LEGACY) {
+ puts ("Non legacy image format not supported\n");
+ return -1;
+ }
+#endif
+
/* write the time field into EEPROM */
off = auee_off[idx].time;
val = image_get_time (hdr);
OpenPOWER on IntegriCloud