diff options
author | Markos Chandras <markos.chandras@imgtec.com> | 2014-01-15 09:06:03 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-03-26 18:09:18 -0400 |
commit | 0893d3fb8d27320d4301f14a0b331df291a08044 (patch) | |
tree | 71126690cfaf4a5f1de4daa6fddfa25ce2184020 /arch/mips/mm | |
parent | 91119686f33928e2ced93eaedf4191cedbd0e827 (diff) |
MIPS: mm: init: Add free_init_pages() callback for EVA
A core in EVA mode can have any possible segment mapping, so the
default free_initmem_default() function may not always work as expected.
Therefore, add a callback that platforms can use to free up the init section.
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r-- | arch/mips/mm/init.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c index 6b59617760c1..4fc74c78265a 100644 --- a/arch/mips/mm/init.c +++ b/arch/mips/mm/init.c | |||
@@ -422,10 +422,20 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
422 | } | 422 | } |
423 | #endif | 423 | #endif |
424 | 424 | ||
425 | void (*free_init_pages_eva)(void *begin, void *end) = NULL; | ||
426 | |||
425 | void __init_refok free_initmem(void) | 427 | void __init_refok free_initmem(void) |
426 | { | 428 | { |
427 | prom_free_prom_memory(); | 429 | prom_free_prom_memory(); |
428 | free_initmem_default(POISON_FREE_INITMEM); | 430 | /* |
431 | * Let the platform define a specific function to free the | ||
432 | * init section since EVA may have used any possible mapping | ||
433 | * between virtual and physical addresses. | ||
434 | */ | ||
435 | if (free_init_pages_eva) | ||
436 | free_init_pages_eva((void *)&__init_begin, (void *)&__init_end); | ||
437 | else | ||
438 | free_initmem_default(POISON_FREE_INITMEM); | ||
429 | } | 439 | } |
430 | 440 | ||
431 | #ifndef CONFIG_MIPS_PGD_C0_CONTEXT | 441 | #ifndef CONFIG_MIPS_PGD_C0_CONTEXT |