mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-28 09:31:32 +00:00
x86: mrccache: Add more debugging
When the MRC cache fails to save it is useful to have some debugging info to indicate what when wrong. Add some more debug() calls. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
9a67994e01
commit
079b38ba04
1 changed files with 12 additions and 4 deletions
|
@ -113,8 +113,10 @@ int mrccache_update(struct udevice *sf, struct mrc_region *entry,
|
||||||
ulong base_addr;
|
ulong base_addr;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!is_mrc_cache(cur))
|
if (!is_mrc_cache(cur)) {
|
||||||
|
debug("%s: Cache data not valid\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Find the last used block */
|
/* Find the last used block */
|
||||||
base_addr = entry->base + entry->offset;
|
base_addr = entry->base + entry->offset;
|
||||||
|
@ -205,17 +207,23 @@ int mrccache_get_region(struct udevice **devp, struct mrc_region *entry)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fdtdec_get_int_array(blob, node, "memory-map", reg, 2))
|
if (fdtdec_get_int_array(blob, node, "memory-map", reg, 2)) {
|
||||||
|
debug("%s: Cannot find memory map\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
entry->base = reg[0];
|
entry->base = reg[0];
|
||||||
|
|
||||||
/* Find the place where we put the MRC cache */
|
/* Find the place where we put the MRC cache */
|
||||||
mrc_node = fdt_subnode_offset(blob, node, "rw-mrc-cache");
|
mrc_node = fdt_subnode_offset(blob, node, "rw-mrc-cache");
|
||||||
if (mrc_node < 0)
|
if (mrc_node < 0) {
|
||||||
|
debug("%s: Cannot find node\n", __func__);
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
if (fdtdec_get_int_array(blob, mrc_node, "reg", reg, 2))
|
if (fdtdec_get_int_array(blob, mrc_node, "reg", reg, 2)) {
|
||||||
|
debug("%s: Cannot find address\n", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
entry->offset = reg[0];
|
entry->offset = reg[0];
|
||||||
entry->length = reg[1];
|
entry->length = reg[1];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue