Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

of: reserved-mem: print out reserved-mem details during boot

It's important to know reserved-mem information in mobile world
since reserved memory via device tree keeps increased in platform
(e.g., 45% in our platform). Therefore, it's crucial to know the
reserved memory sizes breakdown for the memory accounting.

This patch prints out reserved memory details during boot to make
them visible.

Below is an example output:

[ 0.000000] OF: reserved mem: 0x00000009f9400000..0x00000009fb3fffff ( 32768 KB ) map reusable test1
[ 0.000000] OF: reserved mem: 0x00000000ffdf0000..0x00000000ffffffff ( 2112 KB ) map non-reusable test2
[ 0.000000] OF: reserved mem: 0x0000000091000000..0x00000000912fffff ( 3072 KB ) nomap non-reusable test3

Signed-off-by: Martin Liu <liumartin@google.com>
Link: https://lore.kernel.org/r/20230209160954.1471909-1-liumartin@google.com
Signed-off-by: Rob Herring <robh@kernel.org>

authored by

Martin Liu and committed by
Rob Herring
aeb9267e 0c559bc8

+10
+10
drivers/of/of_reserved_mem.c
··· 284 284 else 285 285 memblock_phys_free(rmem->base, 286 286 rmem->size); 287 + } else { 288 + phys_addr_t end = rmem->base + rmem->size - 1; 289 + bool reusable = 290 + (of_get_flat_dt_prop(node, "reusable", NULL)) != NULL; 291 + 292 + pr_info("%pa..%pa ( %lu KB ) %s %s %s\n", 293 + &rmem->base, &end, (unsigned long)(rmem->size / SZ_1K), 294 + nomap ? "nomap" : "map", 295 + reusable ? "reusable" : "non-reusable", 296 + rmem->name ? rmem->name : "unknown"); 287 297 } 288 298 } 289 299 }