reserved_memory: change print of all reserved memory [1/1]
authorTao Zeng <tao.zeng@amlogic.com>
Fri, 1 Nov 2019 09:03:02 +0000 (17:03 +0800)
committerJianxin Pan <jianxin.pan@amlogic.com>
Mon, 4 Nov 2019 09:07:10 +0000 (02:07 -0700)
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 <tao.zeng@amlogic.com>
drivers/base/dma-contiguous.c
drivers/of/fdt.c
drivers/of/of_reserved_mem.c

index 5fae019..e0c09f3 100644 (file)
@@ -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;
 }
index e37a2a5..62b228c 100644 (file)
@@ -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 <linux/crc32.h>
 #include <linux/kernel.h>
@@ -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);
index d25d998..0d706be 100644 (file)
@@ -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 <linux/err.h>
 #include <linux/of.h>
@@ -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;
                }
        }