linux-mips
[Top] [All Lists]

[PATCH 55/58] MIPS: malta: malta-memory: Add free_init_pages_eva() callb

To: <linux-mips@linux-mips.org>
Subject: [PATCH 55/58] MIPS: malta: malta-memory: Add free_init_pages_eva() callback
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Mon, 27 Jan 2014 20:19:42 +0000
Cc: Markos Chandras <markos.chandras@imgtec.com>
In-reply-to: <1390853985-14246-1-git-send-email-markos.chandras@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1390853985-14246-1-git-send-email-markos.chandras@imgtec.com>
Sender: linux-mips-bounce@linux-mips.org
Use a Malta specific function to free the init section once the
kernel has booted. When operating in EVA mode, the physical memory
is shifted to 0x80000000. Kernel is loaded into 0x80000000 (virtual)
so the offset between physical and virtual addresses is 0.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 arch/mips/mti-malta/malta-memory.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/mips/mti-malta/malta-memory.c 
b/arch/mips/mti-malta/malta-memory.c
index 9235aee8..6d0f4ab 100644
--- a/arch/mips/mti-malta/malta-memory.c
+++ b/arch/mips/mti-malta/malta-memory.c
@@ -111,6 +111,12 @@ fw_memblock_t * __init fw_getmdesc(int eva)
        return &mdesc[0];
 }
 
+static void free_init_pages_eva_malta(void *begin, void *end)
+{
+       free_init_pages("unused kernel", __pa_symbol((unsigned long *)begin),
+                       __pa_symbol((unsigned long *)end));
+}
+
 static int __init fw_memtype_classify(unsigned int type)
 {
        switch (type) {
@@ -128,6 +134,8 @@ void __init fw_meminit(void)
        fw_memblock_t *p;
 
        p = fw_getmdesc(config_enabled(CONFIG_EVA));
+       free_init_pages_eva = (config_enabled(CONFIG_EVA) ?
+                              free_init_pages_eva_malta : NULL);
 
        while (p->size) {
                long type;
-- 
1.8.5.3



<Prev in Thread] Current Thread [Next in Thread>