device: Add log_resource()

This will replace LOG_{MEM/IO}_RESOURCE macros once
the new resource constructors are available.

Change-Id: I21b030dc42dcb8e462b29f49499be5fd31ea38f5
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55476
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Kyösti Mälkki
2021-06-14 00:40:22 +03:00
committed by Felix Held
parent 0c78f4c05a
commit 68e6dc9832
2 changed files with 18 additions and 0 deletions

View File

@@ -932,3 +932,12 @@ const char *dev_path_name(enum device_path_type type)
type_name = type_names[type];
return type_name;
}
void log_resource(const char *type, const struct device *dev, const struct resource *res,
const char *srcfile, const int line)
{
printk(BIOS_SPEW, "%s:%d res: %s, dev: %s, index: 0x%lx, base: 0x%llx, "
"end: 0x%llx, size_kb: 0x%llx\n",
srcfile, line, type, dev_path(dev), res->index, res->base,
resource_end(res), res->size / KiB);
}