dm: spl: Allow SPL to show memory usage

Add an option to tell SPL to show memory usage for driver model just
before it boots into the next phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2022-05-08 04:39:27 -06:00
parent 2cb4ddb91e
commit 4f6500aa1a
2 changed files with 19 additions and 0 deletions

View File

@@ -34,6 +34,7 @@
#include <malloc.h>
#include <mapmem.h>
#include <dm/root.h>
#include <dm/util.h>
#include <linux/compiler.h>
#include <fdt_support.h>
#include <bootcount.h>
@@ -780,6 +781,14 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
bootcount_inc();
/* Dump driver model states to aid analysis */
if (CONFIG_IS_ENABLED(DM_STATS)) {
struct dm_stats mem;
dm_get_mem(&mem);
dm_dump_mem(&mem);
}
memset(&spl_image, '\0', sizeof(spl_image));
#ifdef CONFIG_SYS_SPL_ARGS_ADDR
spl_image.arg = (void *)CONFIG_SYS_SPL_ARGS_ADDR;