projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix crash on sequoia in ppc_4xx_eth_init
[oweals/u-boot.git]
/
common
/
image.c
diff --git
a/common/image.c
b/common/image.c
index bb57d6dba63939d0a8f5b376fa4b79dd95366eb0..d218f2f88ba77397fd69b24e8e6f17cd9dde1954 100644
(file)
--- a/
common/image.c
+++ b/
common/image.c
@@
-23,7
+23,6
@@
* MA 02111-1307 USA
*/
* MA 02111-1307 USA
*/
-#define DEBUG
#ifndef USE_HOSTCC
#include <common.h>
#ifndef USE_HOSTCC
#include <common.h>
@@
-54,6
+53,7
@@
#endif
#if defined(CONFIG_FIT)
#endif
#if defined(CONFIG_FIT)
+#include <u-boot/md5.h>
#include <sha1.h>
static int fit_check_ramdisk (const void *fit, int os_noffset,
#include <sha1.h>
static int fit_check_ramdisk (const void *fit, int os_noffset,
@@
-70,6
+70,7
@@
static image_header_t* image_get_ramdisk (ulong rd_addr, uint8_t arch,
int verify);
#else
#include "mkimage.h"
int verify);
#else
#include "mkimage.h"
+#include <u-boot/md5.h>
#include <time.h>
#include <image.h>
#endif /* !USE_HOSTCC*/
#include <time.h>
#include <image.h>
#endif /* !USE_HOSTCC*/
@@
-463,8
+464,10
@@
ulong getenv_bootm_low(void)
return tmp;
}
return tmp;
}
-#if
def CFG_SDRAM_BASE
+#if
defined(CFG_SDRAM_BASE)
return CFG_SDRAM_BASE;
return CFG_SDRAM_BASE;
+#elif defined(CONFIG_ARM)
+ return gd->bd->bi_dram[0].start;
#else
return 0;
#endif
#else
return 0;
#endif
@@
-478,7
+481,11
@@
ulong getenv_bootm_size(void)
return tmp;
}
return tmp;
}
+#if defined(CONFIG_ARM)
+ return gd->bd->bi_dram[0].size;
+#else
return gd->bd->bi_memsize;
return gd->bd->bi_memsize;
+#endif
}
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
}
void memmove_wd (void *to, void *from, size_t len, ulong chunksz)
@@
-976,7
+983,7
@@
int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
#endif /* CONFIG_B2 || CONFIG_EVB4510 || CONFIG_ARMADILLO */
} else if (images->legacy_hdr_valid &&
#endif /* CONFIG_B2 || CONFIG_EVB4510 || CONFIG_ARMADILLO */
} else if (images->legacy_hdr_valid &&
- image_check_type (
images->legacy_hdr_os
, IH_TYPE_MULTI)) {
+ image_check_type (
&images->legacy_hdr_os_copy
, IH_TYPE_MULTI)) {
/*
* Now check if we have a legacy mult-component image,
* get second entry data start address and len.
/*
* Now check if we have a legacy mult-component image,
* get second entry data start address and len.
@@
-1007,7
+1014,7
@@
int boot_get_ramdisk (int argc, char *argv[], bootm_headers_t *images,
return 0;
}
return 0;
}
-#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
+#if defined(CONFIG_PPC) || defined(CONFIG_M68K)
|| defined(CONFIG_SPARC)
/**
* boot_ramdisk_high - relocate init ramdisk
* @lmb: pointer to lmb handle, will be used for memory mgmt
/**
* boot_ramdisk_high - relocate init ramdisk
* @lmb: pointer to lmb handle, will be used for memory mgmt
@@
-1934,8
+1941,8
@@
static int calculate_hash (const void *data, int data_len, const char *algo,
(unsigned char *) value);
*value_len = 20;
} else if (strcmp (algo, "md5") == 0 ) {
(unsigned char *) value);
*value_len = 20;
} else if (strcmp (algo, "md5") == 0 ) {
-
printf ("MD5 not supported\n"
);
- *value_len =
0
;
+
md5 ((unsigned char *)data, data_len, value
);
+ *value_len =
16
;
} else {
debug ("Unsupported hash alogrithm\n");
return -1;
} else {
debug ("Unsupported hash alogrithm\n");
return -1;