From 89f8a247a4629932822f9a06db5b178075481fa4 Mon Sep 17 00:00:00 2001 From: Martin Peschke Date: Fri, 16 Sep 2016 14:39:46 +0200 Subject: p9_xip_tool: fix lost change The p9_xip_tool source file was renamed from .c to .C some months ago. Unfortunately, a lot of changes were made at the same time, and the author based their work on an outdated version of the original file. As a result, a change merged into the original file got lost. This patch adds the erroneously deleted change back in. Commit that was lost and is added back in: 6b1c327dfc190bfa9585825a672e10c30210a4c7 "P9-XIP: improved image reports" Commit that deletes the original .c file: fff71ea814b0e942ffc999d065f7cd3bc4f1672f Commit that adds the new .C file: f50099fed8593a9079dda2bf6e6637a00e946218 Change-Id: I1aa8fb9bd0ce069875e64b213f10365258af5f9a Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29835 Tested-by: Jenkins Server Tested-by: PPE CI Reviewed-by: Claus M. Olsen Reviewed-by: Sachin Gupta Reviewed-by: Martin Peschke Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/29838 Reviewed-by: Hostboot Team Tested-by: FSP CI Jenkins --- src/import/chips/p9/xip/p9_xip_tool.C | 45 ++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 16 deletions(-) (limited to 'src/import/chips/p9/xip/p9_xip_tool.C') diff --git a/src/import/chips/p9/xip/p9_xip_tool.C b/src/import/chips/p9/xip/p9_xip_tool.C index 8c7d3cf4..890dfe36 100644 --- a/src/import/chips/p9/xip/p9_xip_tool.C +++ b/src/import/chips/p9/xip/p9_xip_tool.C @@ -534,37 +534,50 @@ dumpHeader(void* i_image) memcpy(magicString, (char*)(&(((P9XipHeader*)i_image)->iv_magic)), 8); magicString[8] = 0; - printf("Magic Number : 0x%016lx \"%s\"\n", + printf("Magic Number : 0x%016lx \"%s\"\n", header.iv_magic, magicString); - printf("Header Version : 0x%02x\n", header.iv_headerVersion); - printf("Link Address : 0x%016lx\n", header.iv_linkAddress); - printf("L1 Loader Address : 0x%08x\n", (uint32_t)header.iv_L1LoaderAddr); - printf("L2 Loader Address : 0x%08x\n", (uint32_t)header.iv_L2LoaderAddr); - printf("Kernel Address : 0x%08x\n", (uint32_t)header.iv_kernelAddr); - printf("Image Size : 0x%08x (%d)\n", + printf("Header Version : 0x%02x\n", header.iv_headerVersion); + printf("Link Address : 0x%016lx\n", header.iv_linkAddress); + printf("L1 Loader Address : 0x%08x\n", (uint32_t)header.iv_L1LoaderAddr); + printf("L2 Loader Address : 0x%08x\n", (uint32_t)header.iv_L2LoaderAddr); + printf("Kernel Address : 0x%08x\n", (uint32_t)header.iv_kernelAddr); + printf("Image Size : 0x%08x (%d)\n", header.iv_imageSize, header.iv_imageSize); - printf("Normalized : %s\n", header.iv_normalized ? "Yes" : "No"); - printf("TOC Sorted : %s\n", header.iv_tocSorted ? "Yes" : "No"); - printf("Build Date : %02d/%02d/%04d\n", + printf("Normalized : %s\n", header.iv_normalized ? "Yes" : "No"); + printf("TOC Sorted : %s\n", header.iv_tocSorted ? "Yes" : "No"); + printf("Build Date : %02d/%02d/%04d\n", (header.iv_buildDate / 100) % 100, header.iv_buildDate % 100, header.iv_buildDate / 10000); - printf("Build Time : %02d:%02d\n", + printf("Build Time : %02d:%02d\n", header.iv_buildTime / 100, header.iv_buildTime % 100); - printf("Build User : %s\n", header.iv_buildUser); - printf("Build Host : %s\n", header.iv_buildHost); + printf("Build User : %s\n", header.iv_buildUser); + printf("Build Host : %s\n", header.iv_buildHost); printf("\n"); - printf("Section Table : Offset Size\n"); + printf("Section Table :\n\n"); + printf(" Name Alignment Start End Size\n"); printf("\n"); for (i = 0; i < P9_XIP_SECTIONS; i++) { section = &(header.iv_section[i]); - printf("%-16s 0x%08x 0x%08x (%d)\n", + printf(" %-16s %d 0x%08x ", get_sectionName(header.iv_magic, i), - section->iv_offset, section->iv_size, section->iv_size); + section->iv_alignment, + section->iv_offset); + + if (section->iv_size == 0) + { + printf(" "); + } + else + { + printf("0x%08x", section->iv_offset + section->iv_size - 1); + } + + printf(" 0x%08x (%d)\n", section->iv_size, section->iv_size); } printf("\n"); -- cgit v1.2.1