Commit 0893d3fb authored by Markos Chandras's avatar Markos Chandras Committed by Ralf Baechle

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: default avatarMarkos Chandras <markos.chandras@imgtec.com>
parent 91119686
...@@ -112,6 +112,8 @@ extern void prom_free_prom_memory(void); ...@@ -112,6 +112,8 @@ extern void prom_free_prom_memory(void);
extern void free_init_pages(const char *what, extern void free_init_pages(const char *what,
unsigned long begin, unsigned long end); unsigned long begin, unsigned long end);
extern void (*free_init_pages_eva)(void *begin, void *end);
/* /*
* Initial kernel command line, usually setup by prom_init() * Initial kernel command line, usually setup by prom_init()
*/ */
......
...@@ -422,9 +422,19 @@ void free_initrd_mem(unsigned long start, unsigned long end) ...@@ -422,9 +422,19 @@ void free_initrd_mem(unsigned long start, unsigned long end)
} }
#endif #endif
void (*free_init_pages_eva)(void *begin, void *end) = NULL;
void __init_refok free_initmem(void) void __init_refok free_initmem(void)
{ {
prom_free_prom_memory(); prom_free_prom_memory();
/*
* Let the platform define a specific function to free the
* init section since EVA may have used any possible mapping
* between virtual and physical addresses.
*/
if (free_init_pages_eva)
free_init_pages_eva((void *)&__init_begin, (void *)&__init_end);
else
free_initmem_default(POISON_FREE_INITMEM); free_initmem_default(POISON_FREE_INITMEM);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment