* [PATCH v2] of: reserved-mem: print out reserved-mem details during boot
@ 2023-02-09 16:09 Martin Liu
2023-02-15 18:19 ` Rob Herring
0 siblings, 1 reply; 2+ messages in thread
From: Martin Liu @ 2023-02-09 16:09 UTC (permalink / raw)
To: robh+dt, frowand.list
Cc: devicetree, linux-kernel, surenb, minchan, tkjos, liumartin
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>
---
Changes in V2:
-- instead of using debugfs, just print them out during boot
drivers/of/of_reserved_mem.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index 65f3b02a0e4e..00e75064ca19 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -284,6 +284,16 @@ void __init fdt_init_reserved_mem(void)
else
memblock_phys_free(rmem->base,
rmem->size);
+ } else {
+ phys_addr_t end = rmem->base + rmem->size - 1;
+ bool reusable =
+ (of_get_flat_dt_prop(node, "reusable", NULL)) != NULL;
+
+ pr_info("%pa..%pa ( %lu KB ) %s %s %s\n",
+ &rmem->base, &end, (unsigned long)(rmem->size / SZ_1K),
+ nomap ? "nomap" : "map",
+ reusable ? "reusable" : "non-reusable",
+ rmem->name ? rmem->name : "unknown");
}
}
}
--
2.39.1.519.gcb327c4b5f-goog
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] of: reserved-mem: print out reserved-mem details during boot
2023-02-09 16:09 [PATCH v2] of: reserved-mem: print out reserved-mem details during boot Martin Liu
@ 2023-02-15 18:19 ` Rob Herring
0 siblings, 0 replies; 2+ messages in thread
From: Rob Herring @ 2023-02-15 18:19 UTC (permalink / raw)
To: Martin Liu
Cc: frowand.list, devicetree, minchan, tkjos, linux-kernel, surenb, robh+dt
On Fri, 10 Feb 2023 00:09:55 +0800, Martin Liu wrote:
> 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>
> ---
> Changes in V2:
> -- instead of using debugfs, just print them out during boot
>
> drivers/of/of_reserved_mem.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
Applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-15 18:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-09 16:09 [PATCH v2] of: reserved-mem: print out reserved-mem details during boot Martin Liu
2023-02-15 18:19 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®