aboutsummaryrefslogtreecommitdiffstats
path: root/lib/lmb.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lmb.c')
-rw-r--r--lib/lmb.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/lib/lmb.c b/lib/lmb.c
index 93445dc8f818..867f7b5a8231 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -19,31 +19,42 @@
19 19
20struct lmb lmb; 20struct lmb lmb;
21 21
22static int lmb_debug;
23
24static int __init early_lmb(char *p)
25{
26 if (p && strstr(p, "debug"))
27 lmb_debug = 1;
28 return 0;
29}
30early_param("lmb", early_lmb);
31
22void lmb_dump_all(void) 32void lmb_dump_all(void)
23{ 33{
24#ifdef DEBUG
25 unsigned long i; 34 unsigned long i;
26 35
27 pr_debug("lmb_dump_all:\n"); 36 if (!lmb_debug)
28 pr_debug(" memory.cnt = 0x%lx\n", lmb.memory.cnt); 37 return;
29 pr_debug(" memory.size = 0x%llx\n", 38
39 pr_info("lmb_dump_all:\n");
40 pr_info(" memory.cnt = 0x%lx\n", lmb.memory.cnt);
41 pr_info(" memory.size = 0x%llx\n",
30 (unsigned long long)lmb.memory.size); 42 (unsigned long long)lmb.memory.size);
31 for (i=0; i < lmb.memory.cnt ;i++) { 43 for (i=0; i < lmb.memory.cnt ;i++) {
32 pr_debug(" memory.region[0x%x].base = 0x%llx\n", 44 pr_info(" memory.region[0x%lx].base = 0x%llx\n",
33 i, (unsigned long long)lmb.memory.region[i].base); 45 i, (unsigned long long)lmb.memory.region[i].base);
34 pr_debug(" .size = 0x%llx\n", 46 pr_info(" .size = 0x%llx\n",
35 (unsigned long long)lmb.memory.region[i].size); 47 (unsigned long long)lmb.memory.region[i].size);
36 } 48 }
37 49
38 pr_debug(" reserved.cnt = 0x%lx\n", lmb.reserved.cnt); 50 pr_info(" reserved.cnt = 0x%lx\n", lmb.reserved.cnt);
39 pr_debug(" reserved.size = 0x%lx\n", lmb.reserved.size); 51 pr_info(" reserved.size = 0x%lx\n", lmb.reserved.size);
40 for (i=0; i < lmb.reserved.cnt ;i++) { 52 for (i=0; i < lmb.reserved.cnt ;i++) {
41 pr_debug(" reserved.region[0x%x].base = 0x%llx\n", 53 pr_info(" reserved.region[0x%lx].base = 0x%llx\n",
42 i, (unsigned long long)lmb.reserved.region[i].base); 54 i, (unsigned long long)lmb.reserved.region[i].base);
43 pr_debug(" .size = 0x%llx\n", 55 pr_info(" .size = 0x%llx\n",
44 (unsigned long long)lmb.reserved.region[i].size); 56 (unsigned long long)lmb.reserved.region[i].size);
45 } 57 }
46#endif /* DEBUG */
47} 58}
48 59
49static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2, 60static unsigned long lmb_addrs_overlap(u64 base1, u64 size1, u64 base2,