From bc1f40df1b1c8e1a555ad2622a1a5f4cea299a17 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Fri, 1 Nov 2019 17:03:02 +0800 Subject: [PATCH] reserved_memory: change print of all reserved memory [1/1] PD#SWPL-16049 Problem: When boot, print information of all reserved memory is not nice for reading. Solution: Change print format of reserved memory like: 07400000 - 07500000, 1024 KB, ramoops@0x07400000 05000000 - 05400000, 4096 KB, linux,secmon 3f800000 - 40000000, 8192 KB, linux,meson-fb 31c00000 - 3f800000, 225280 KB, linux,codec_mm_cma 31c00000 - 31c00000, 0 KB, linux,codec_mm_reserved 2e000000 - 30000000, 32768 KB, linux,ion-dev 30800000 - 31c00000, 20480 KB, linux,vdin1_cma 30000000 - 30800000, 8192 KB, linux,demod_cma 2b800000 - 2e000000, 40960 KB, linux,di_cma 2b400000 - 2b800000, 4096 KB, linux,emp_cma Verify: TL1 X301 Change-Id: I5a010118665a886896c7db8be2bb911813647e9e Signed-off-by: Tao Zeng --- drivers/base/dma-contiguous.c | 4 ++++ drivers/of/fdt.c | 10 ++++++++++ drivers/of/of_reserved_mem.c | 10 ++++++++++ 3 files changed, 24 insertions(+) diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c index 5fae019..e0c09f3 100644 --- a/drivers/base/dma-contiguous.c +++ b/drivers/base/dma-contiguous.c @@ -263,7 +263,9 @@ static int __init rmem_cma_setup(struct reserved_mem *rmem) err = cma_init_reserved_mem(rmem->base, rmem->size, 0, &cma); if (err) { + #ifndef CONFIG_AMLOGIC_MODIFY pr_err("Reserved memory: unable to setup CMA region\n"); + #endif return err; } /* Architecture specific contiguous memory fixup. */ @@ -279,8 +281,10 @@ static int __init rmem_cma_setup(struct reserved_mem *rmem) rmem->ops = &rmem_cma_ops; rmem->priv = cma; +#ifndef CONFIG_AMLOGIC_MODIFY pr_info("Reserved memory: created CMA memory pool at %pa, size %ld MiB\n", &rmem->base, (unsigned long)rmem->size / SZ_1M); +#endif return 0; } diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index e37a2a5..62b228c 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -9,7 +9,9 @@ * version 2 as published by the Free Software Foundation. */ +#ifndef CONFIG_AMLOGIC_MODIFY /* save print time */ #define pr_fmt(fmt) "OF: fdt:" fmt +#endif #include #include @@ -605,8 +607,16 @@ static int __init __reserved_mem_reserve_reg(unsigned long node, if (size && early_init_dt_reserve_memory_arch(base, size, nomap) == 0) + #ifdef CONFIG_AMLOGIC_MODIFY + pr_emerg("\t%08lx - %08lx, %8ld KB, %s\n", + (unsigned long)base, + (unsigned long)(base + size), + (unsigned long)(size >> 10), + uname); + #else pr_debug("Reserved memory: reserved region for node '%s': base %pa, size %ld MiB\n", uname, &base, (unsigned long)size / SZ_1M); + #endif else pr_info("Reserved memory: failed to reserve memory for node '%s': base %pa, size %ld MiB\n", uname, &base, (unsigned long)size / SZ_1M); diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c index d25d9981..0d706be 100644 --- a/drivers/of/of_reserved_mem.c +++ b/drivers/of/of_reserved_mem.c @@ -13,7 +13,9 @@ * License or (at your optional) any later version of the license. */ +#ifndef CONFIG_AMLOGIC_MODIFY /* save print time */ #define pr_fmt(fmt) "OF: reserved mem: " fmt +#endif #include #include @@ -233,8 +235,16 @@ static int __init __reserved_mem_init_node(struct reserved_mem *rmem) continue; if (initfn(rmem) == 0) { + #ifdef CONFIG_AMLOGIC_MODIFY + pr_emerg("\t%08lx - %08lx, %8ld KB, %s\n", + (unsigned long)rmem->base, + (unsigned long)(rmem->base + rmem->size), + (unsigned long)(rmem->size >> 10), + rmem->name); + #else pr_info("initialized node %s, compatible id %s\n", rmem->name, compat); + #endif return 0; } } -- 2.7.4