Patchwork [U-Boot,v3,08/10] sandbox: image: Adjust FIT image printing to work with sandbox

login
register
mail settings
Submitter Simon Glass
Date May 16, 2013, 11:53 p.m.
Message ID <1368748408-31893-9-git-send-email-sjg@chromium.org>
Download mbox | patch
Permalink /patch/244442/
State Accepted, archived
Delegated to: Tom Rini
Headers show

Comments

Simon Glass - May 16, 2013, 11:53 p.m.
Use map_sysmem() to convert from address to pointer, so that sandbox can
print FIT information without crashing.

Signed-off-by: Simon Glass <sjg@chromium.org>
---
Changes in v3: None
Changes in v2:
- Add workaround for ELDK-4.2 to avoid cast warning

 common/image-fit.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Patch

diff --git a/common/image-fit.c b/common/image-fit.c
index 589f53d..7bf82d3 100644
--- a/common/image-fit.c
+++ b/common/image-fit.c
@@ -351,10 +351,13 @@  void fit_image_print(const void *fit, int image_noffset, const char *p)
 
 #ifndef USE_HOSTCC
 	printf("%s  Data Start:   ", p);
-	if (ret)
+	if (ret) {
 		printf("unavailable\n");
-	else
-		printf("0x%08lx\n", (ulong)data);
+	} else {
+		void *vdata = (void *)data;
+
+		printf("0x%08lx\n", (ulong)map_to_sysmem(vdata));
+	}
 #endif
 
 	printf("%s  Data Size:    ", p);