aboutsummaryrefslogtreecommitdiff
path: root/core/nvram-format.c
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2016-07-26 13:49:31 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-07-27 18:24:16 +1000
commitd7ce0ac42b49d274c40fe8edf73b10a640116479 (patch)
tree8e3ff3749dd4461b34e4564d473b458412094d28 /core/nvram-format.c
parenta2d630bc2bdd0007f06d1552361d08ef9d313a1a (diff)
downloadskiboot-d7ce0ac42b49d274c40fe8edf73b10a640116479.zip
skiboot-d7ce0ac42b49d274c40fe8edf73b10a640116479.tar.gz
skiboot-d7ce0ac42b49d274c40fe8edf73b10a640116479.tar.bz2
nvram: Add extra debug printing when NVRAM needs formatting
Be more verbose (at debug level) when formatting the NVRAM, this can help catch errors at other levels of the stack. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/nvram-format.c')
-rw-r--r--core/nvram-format.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/nvram-format.c b/core/nvram-format.c
index 899fab4..1c164d4 100644
--- a/core/nvram-format.c
+++ b/core/nvram-format.c
@@ -65,7 +65,7 @@ int nvram_format(void *nvram_image, uint32_t nvram_size)
struct chrp_nvram_hdr *h;
unsigned int offset = 0;
- prerror("NVRAM: Re-initializing\n");
+ prerror("NVRAM: Re-initializing (size: 0x%08x)\n", nvram_size);
memset(nvram_image, 0, nvram_size);
/* Create private partition */
@@ -76,6 +76,8 @@ int nvram_format(void *nvram_image, uint32_t nvram_size)
h->len = NVRAM_SIZE_FW_PRIV >> 4;
strcpy(h->name, NVRAM_NAME_FW_PRIV);
h->cksum = chrp_nv_cksum(h);
+ prlog(PR_DEBUG, "NVRAM: Created '%s' partition at 0x%08x for size 0x%08x"
+ " with cksum 0x%02x\n", NVRAM_NAME_FW_PRIV, offset, h->len, h->cksum);
offset += NVRAM_SIZE_FW_PRIV;
/* Create common partition */
@@ -86,6 +88,8 @@ int nvram_format(void *nvram_image, uint32_t nvram_size)
h->len = NVRAM_SIZE_COMMON >> 4;
strcpy(h->name, NVRAM_NAME_COMMON);
h->cksum = chrp_nv_cksum(h);
+ prlog(PR_DEBUG, "NVRAM: Created '%s' partition at 0x%08x for size 0x%08x"
+ " with cksum 0x%02x\n", NVRAM_NAME_COMMON, offset, h->len, h->cksum);
offset += NVRAM_SIZE_COMMON;
/* Create free space partition */
@@ -97,7 +101,8 @@ int nvram_format(void *nvram_image, uint32_t nvram_size)
/* We have the full 12 bytes here */
memcpy(h->name, NVRAM_NAME_FREE, 12);
h->cksum = chrp_nv_cksum(h);
-
+ prlog(PR_DEBUG, "NVRAM: Created '%s' partition at 0x%08x for size 0x%08x"
+ " with cksum 0x%02x\n", NVRAM_NAME_FREE, offset, h->len, h->cksum);
return 0;
}
@@ -117,7 +122,8 @@ int nvram_check(void *nvram_image, const uint32_t nvram_size)
if (chrp_nv_cksum(h) != h->cksum) {
prerror("NVRAM: Partition at offset 0x%x"
- " has bad checksum\n", offset);
+ " has bad checksum: 0x%02x vs 0x%02x\n",
+ offset, h->cksum, chrp_nv_cksum(h));
goto failed;
}
if (h->len < 1) {