Skip to contentSkip to conversation

lmb/bdinfo: dump lmb info via bdinfo

PATCH New Tero Kristo 2 participants 2 messages Jul 20, 2020 – Aug 5, 2020 Library code

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lmb/bdinfo: dump lmb info via bdinfo

Dump lmb status from the bdinfo command. This is useful for seeing the reserved memory regions from the u-boot cmdline.

---
v2:
* rebased to latest master

 cmd/bdinfo.c  |  6 ++++++
 include/lmb.h |  1 +
 lib/lmb.c     | 42 +++++++++++++++++++++++-------------------
 3 files changed, 30 insertions(+), 19 deletions(-)
cmd/bdinfo.c +7 -0
index b7f5f710b4..d1be42469e 100644
@@ -9,6 +9,7 @@
 #include <common.h>
 #include <command.h>
 #include <env.h>
+#include <lmb.h>
 #include <net.h>
 #include <vsprintf.h>
 #include <asm/cache.h>
@@ -96,6 +97,12 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 #if CONFIG_IS_ENABLED(MULTI_DTB_FIT)
 	bdinfo_print_num("multi_dtb_fit", (ulong)gd->multi_dtb_fit);
 #endif
+	if (gd->fdt_blob) {
+		struct lmb lmb;
+
+		lmb_init_and_reserve(&lmb, gd->bd, (void *)gd->fdt_blob);
+		lmb_dump_all_force(&lmb);
+	}
 
 	arch_print_bdinfo();
 
include/lmb.h +1 -0
index 3b338dfee0..0d90ab1d65 100644
@@ -48,6 +48,7 @@ extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
 extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size);
 
 extern void lmb_dump_all(struct lmb *lmb);
+extern void lmb_dump_all_force(struct lmb *lmb);
 
 static inline phys_size_t
 lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
lib/lmb.c +23 -19

56 lines not on this page · raw message

Signature · 4 lines
2.17.1

--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
#1 lore raw

PATCH v2 1/1 lmb/bdinfo: dump lmb info via bdinfo

Quoted 4 lines · Tero Kristo

Dump lmb status from the bdinfo command. This is useful for seeing the reserved memory regions from the u-boot cmdline.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/0dd92f1d/attachment.sig>