Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1433749

[PATCH v4 01/22] sh: Add sh-specific early_init_dt_reserve_memory_arch

From Yoshinori Sato <ysato@users.sourceforge.jp>
Newsgroups linux.kernel
Subject [PATCH v4 01/22] sh: Add sh-specific early_init_dt_reserve_memory_arch
Date 2016-06-29 15:50 +0200
Message-ID <rPo2m-4Od-27@gated-at.bofh.it> (permalink)
References <rPo2m-4Od-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


sh used P1 address space in early device tree.
So need convert P1 to physical address before reserve memory.

Changes v4
none

Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
---
 arch/sh/boards/of-generic.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/sh/boards/of-generic.c b/arch/sh/boards/of-generic.c
index 57d45dc..8dbf978 100644
--- a/arch/sh/boards/of-generic.c
+++ b/arch/sh/boards/of-generic.c
@@ -15,6 +15,7 @@
 #include <linux/clocksource.h>
 #include <linux/irqchip.h>
 #include <linux/clk-provider.h>
+#include <linux/memblock.h>
 #include <asm/machvec.h>
 #include <asm/rtc.h>
 
@@ -203,3 +204,14 @@ static int __init sh_of_device_init(void)
 	return 0;
 }
 arch_initcall_sync(sh_of_device_init);
+
+int __init early_init_dt_reserve_memory_arch(phys_addr_t base,
+					     phys_addr_t size, bool nomap)
+{
+	if (nomap)
+		return memblock_remove(base, size);
+
+	if (base >= P1SEG)
+		base &= ~P1SEG;
+	return memblock_reserve(base, size);
+}
-- 
2.7.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v4 01/22] sh: Add sh-specific early_init_dt_reserve_memory_arch Yoshinori Sato <ysato@users.sourceforge.jp> - 2016-06-29 15:50 +0200

csiph-web