MIPS: xlp: Drop boot_mem_map
Simply replace with memblock functions. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: linux-mips@vger.kernel.org Cc: yasha.che3@gmail.com Cc: aurelien@aurel32.net Cc: sfr@canb.auug.org.au Cc: fancer.lancer@gmail.com Cc: matt.redfearn@mips.com Cc: chenhc@lemote.com
This commit is contained in:
parent
aa1edac13e
commit
a121d6e0ca
@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/of_fdt.h>
|
#include <linux/of_fdt.h>
|
||||||
|
#include <linux/memblock.h>
|
||||||
|
|
||||||
#include <asm/idle.h>
|
#include <asm/idle.h>
|
||||||
#include <asm/reboot.h>
|
#include <asm/reboot.h>
|
||||||
@ -67,12 +68,11 @@ static void nlm_linux_exit(void)
|
|||||||
static void nlm_fixup_mem(void)
|
static void nlm_fixup_mem(void)
|
||||||
{
|
{
|
||||||
const int pref_backup = 512;
|
const int pref_backup = 512;
|
||||||
int i;
|
struct memblock_region *mem;
|
||||||
|
|
||||||
for (i = 0; i < boot_mem_map.nr_map; i++) {
|
for_each_memblock(memory, mem) {
|
||||||
if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
|
memblock_remove(mem->base + mem->size - pref_backup,
|
||||||
continue;
|
pref_backup);
|
||||||
boot_mem_map.map[i].size -= pref_backup;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ void __init plat_mem_setup(void)
|
|||||||
/* memory and bootargs from DT */
|
/* memory and bootargs from DT */
|
||||||
xlp_early_init_devtree();
|
xlp_early_init_devtree();
|
||||||
|
|
||||||
if (boot_mem_map.nr_map == 0) {
|
if (memblock_end_of_DRAM() == 0) {
|
||||||
pr_info("Using DRAM BARs for memory map.\n");
|
pr_info("Using DRAM BARs for memory map.\n");
|
||||||
xlp_init_mem_from_bars();
|
xlp_init_mem_from_bars();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user