arm: Show early-malloc() usage in bdinfo
authorSimon Glass <sjg@chromium.org>
Tue, 5 Jul 2016 23:10:11 +0000 (17:10 -0600)
committerSimon Glass <sjg@chromium.org>
Wed, 27 Jul 2016 20:15:54 +0000 (14:15 -0600)
This is useful information to show how close we are to the limit. At present
it is only available by enabling DEBUG in board_r.c.

Make it available with the 'bdinfo' command also.

Note that this affects ARM only. The bdinfo command is different for each
architecture. Rather than duplicating the code it would be better to
refactor it (as was done with global_data).

Signed-off-by: Simon Glass <sjg@chromium.org>
cmd/bdinfo.c

index f2435ab..1fb66c4 100644 (file)
@@ -416,6 +416,11 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
 #ifdef CONFIG_BOARD_TYPES
        printf("Board Type  = %ld\n", gd->board_type);
 #endif
+#ifdef CONFIG_SYS_MALLOC_F
+       printf("Early malloc usage: %lx / %x\n", gd->malloc_ptr,
+              CONFIG_SYS_MALLOC_F_LEN);
+#endif
+
        return 0;
 }