summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMarian Balakowicz <m8@semihalf.com>2008-02-27 11:02:26 +0100
committerMarian Balakowicz <m8@semihalf.com>2008-02-27 11:02:26 +0100
commit4efbe9dbb129f857f27856936112c8c02f016be6 (patch)
tree436ba586908e214d9457c5093369629f7b8cb5f9 /common
parentff0734cff0fb5397ce2f4602f4f3e5ec9c8a36e8 (diff)
downloadu-boot-imx-4efbe9dbb129f857f27856936112c8c02f016be6.zip
u-boot-imx-4efbe9dbb129f857f27856936112c8c02f016be6.tar.gz
u-boot-imx-4efbe9dbb129f857f27856936112c8c02f016be6.tar.bz2
[new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled
Dual format image code must properly handle all three FDT passing methods: - raw FDT blob passed - FDT blob embedded in the legacy uImage - FDT blob embedded in the new uImage This patch enables proper raw FDT handling when no FIT imaeg support is compiled in. This is a bit tricky as we must dected FIT format even when FIT uImage handling is not enabled as both FIT uImages and raw FDT blobs use tha same low level format (libfdt). Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Diffstat (limited to 'common')
-rw-r--r--common/image.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/image.c b/common/image.c
index 5ca77b9..c689b0e 100644
--- a/common/image.c
+++ b/common/image.c
@@ -375,6 +375,10 @@ void image_print_contents (image_header_t *hdr)
* gen_image_get_format() checks whether provided address points to a valid
* legacy or FIT image.
*
+ * New uImage format and FDT blob are based on a libfdt. FDT blob
+ * may be passed directly or embedded in a FIT image. In both situations
+ * gen_image_get_format() must be able to dectect libfdt header.
+ *
* returns:
* image format type or IMAGE_FORMAT_INVALID if no image is present
*/
@@ -382,14 +386,14 @@ int gen_image_get_format (void *img_addr)
{
ulong format = IMAGE_FORMAT_INVALID;
image_header_t *hdr;
-#if defined(CONFIG_FIT)
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
char *fit_hdr;
#endif
hdr = (image_header_t *)img_addr;
if (image_check_magic(hdr))
format = IMAGE_FORMAT_LEGACY;
-#if defined(CONFIG_FIT)
+#if defined(CONFIG_FIT) || defined(CONFIG_OF_LIBFDT)
else {
fit_hdr = (char *)img_addr;
if (fdt_check_header (fit_hdr) == 0)