public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel}
@ 2011-11-01 16:28 Stephen Warren
  2011-11-01 16:28 ` [U-Boot] [PATCH v2 2/3] image: Support FDTs already loaded at their load address Stephen Warren
                   ` (3 more replies)
  0 siblings, 4 replies; 81+ messages in thread
From: Stephen Warren @ 2011-11-01 16:28 UTC (permalink / raw)
  To: u-boot

image_get_ram_disk() and image_get_kernel() perform operations in a
consistent order. Modify image_get_fdt() to do things the same way.
This allows a later change to insert some image header manipulations
into these three functions in a consistent fashion.

v2: New patch

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 common/image.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/image.c b/common/image.c
index 555d9d9..b773505 100644
--- a/common/image.c
+++ b/common/image.c
@@ -1131,14 +1131,19 @@ static const image_header_t *image_get_fdt(ulong fdt_addr)
 {
 	const image_header_t *fdt_hdr = (const image_header_t *)fdt_addr;
 
-	image_print_contents(fdt_hdr);
+	if (!image_check_magic(fdt_hdr)) {
+		fdt_error("fdt header bad magic number\n");
+		return NULL;
+	}
 
-	puts("   Verifying Checksum ... ");
 	if (!image_check_hcrc(fdt_hdr)) {
 		fdt_error("fdt header checksum invalid");
 		return NULL;
 	}
 
+	image_print_contents(fdt_hdr);
+
+	puts("   Verifying Checksum ... ");
 	if (!image_check_dcrc(fdt_hdr)) {
 		fdt_error("fdt checksum invalid");
 		return NULL;
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 81+ messages in thread

end of thread, other threads:[~2012-03-06 21:18 UTC | newest]

Thread overview: 81+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 16:28 [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel} Stephen Warren
2011-11-01 16:28 ` [U-Boot] [PATCH v2 2/3] image: Support FDTs already loaded at their load address Stephen Warren
2012-03-06 21:18   ` Wolfgang Denk
2011-11-01 16:28 ` [U-Boot] [PATCH v2 3/3] image: Allow images to indicate they're loadable at any address Stephen Warren
2011-11-05 22:20   ` Wolfgang Denk
2011-11-07 16:56     ` Stephen Warren
2011-11-07 17:09       ` Stephen Warren
2011-11-07 19:47         ` Simon Glass
2011-11-07 20:29           ` Wolfgang Denk
2011-11-07 21:17           ` Stephen Warren
2011-11-07 22:11             ` Wolfgang Denk
2011-11-07 22:30               ` Stephen Warren
2011-11-07 23:08                 ` Wolfgang Denk
2011-11-08  0:00                   ` Stephen Warren
2011-11-08  0:27                     ` Wolfgang Denk
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF173F9A5035@HQMAIL01.nvidia.com>
2011-11-07 20:26       ` Wolfgang Denk
2011-11-07 21:04         ` Marek Vasut
2011-11-07 21:38           ` Stephen Warren
2011-11-07 21:59             ` Marek Vasut
2011-11-07 22:08               ` Stephen Warren
2011-11-07 22:27           ` Wolfgang Denk
2011-11-07 22:41             ` Stephen Warren
2011-11-07 23:10               ` Wolfgang Denk
2011-11-07 23:43                 ` Stephen Warren
2011-11-07 22:57             ` Nicolas Pitre
2011-11-07 23:25               ` Wolfgang Denk
2011-11-08  0:10                 ` Stephen Warren
2011-11-08  0:29                   ` Wolfgang Denk
2011-11-08  0:48                     ` Nicolas Pitre
2011-11-08  8:38                       ` Wolfgang Denk
2011-11-08 11:35                         ` Marek Vasut
2011-11-08 11:50                           ` Wolfgang Denk
2011-11-08 11:52                             ` Marek Vasut
2011-11-08 18:17                             ` Stephen Warren
     [not found]                             ` <74CDBE0F657A3D45AFBB94109FB122FF173F9A5424@HQMAIL01.nvidia.com>
2011-11-08 19:44                               ` Wolfgang Denk
2011-11-08 21:17                                 ` Wolfgang Denk
2011-11-08 22:27                                   ` Stephen Warren
2011-11-08 22:46                                     ` Wolfgang Denk
2011-11-08  0:35                 ` Nicolas Pitre
2011-11-08  1:10                   ` Simon Glass
2011-11-08  3:51                     ` Nicolas Pitre
2011-11-08  5:37                       ` Simon Glass
2011-11-08  8:45                         ` Wolfgang Denk
2011-11-08 14:22                         ` Loïc Minier
2011-11-08 14:52                       ` Jason
2011-11-08 20:18                         ` Nicolas Pitre
2011-12-10 22:42                     ` Linus Walleij
2011-12-10 22:53                       ` Wolfgang Denk
2011-12-10 23:21                         ` Linus Walleij
2011-12-12 16:25                       ` Stephen Warren
2011-11-08  8:33                   ` Wolfgang Denk
2011-11-08 14:26                     ` Nicolas Pitre
2011-11-08 15:01                       ` Marek Vasut
2011-11-08 15:59                       ` Wolfgang Denk
2011-11-08 16:57                         ` Detlev Zundel
2011-11-08 20:05                         ` Nicolas Pitre
2011-11-07 21:27         ` Stephen Warren
2011-11-07 21:41           ` Nicolas Pitre
2011-11-07 22:42             ` Wolfgang Denk
2011-11-05 18:41 ` [U-Boot] [PATCH v2 1/3] image: Make image_get_fdt work like image_get_{ram_disk, kernel} Marek Vasut
2011-11-05 19:21   ` Simon Glass
2011-11-05 19:39     ` Marek Vasut
2011-11-05 20:38       ` Simon Glass
2011-11-05 20:41         ` Marek Vasut
2011-11-05 20:49           ` Simon Glass
2011-11-05 22:15           ` Wolfgang Denk
2011-11-05 22:18             ` Marek Vasut
2011-11-05 22:06       ` Wolfgang Denk
2011-11-05 21:53     ` Wolfgang Denk
2011-11-05 22:06       ` Marek Vasut
2011-11-05 22:22         ` Wolfgang Denk
2011-11-06  4:52       ` Simon Glass
2011-11-06  8:57         ` Wolfgang Denk
2011-11-05 21:40   ` Wolfgang Denk
2011-11-05 22:06     ` Marek Vasut
2011-11-05 22:24       ` Wolfgang Denk
2011-11-05 22:38         ` Marek Vasut
2011-11-08 14:24   ` Loïc Minier
2011-11-08 16:06 ` Wolfgang Denk
2011-11-08 18:15   ` Stephen Warren
     [not found]   ` <74CDBE0F657A3D45AFBB94109FB122FF173F9A5415@HQMAIL01.nvidia.com>
2011-11-08 19:33     ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox