Skip to content

Commit a121d6e

Browse files
FlyGoatpaulburton
authored andcommitted
MIPS: xlp: Drop boot_mem_map
Simply replace with memblock functions. Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected]
1 parent aa1edac commit a121d6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/mips/netlogic/xlp/setup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
#include <linux/kernel.h>
3636
#include <linux/of_fdt.h>
37+
#include <linux/memblock.h>
3738

3839
#include <asm/idle.h>
3940
#include <asm/reboot.h>
@@ -67,12 +68,11 @@ static void nlm_linux_exit(void)
6768
static void nlm_fixup_mem(void)
6869
{
6970
const int pref_backup = 512;
70-
int i;
71+
struct memblock_region *mem;
7172

72-
for (i = 0; i < boot_mem_map.nr_map; i++) {
73-
if (boot_mem_map.map[i].type != BOOT_MEM_RAM)
74-
continue;
75-
boot_mem_map.map[i].size -= pref_backup;
73+
for_each_memblock(memory, mem) {
74+
memblock_remove(mem->base + mem->size - pref_backup,
75+
pref_backup);
7676
}
7777
}
7878

@@ -110,7 +110,7 @@ void __init plat_mem_setup(void)
110110
/* memory and bootargs from DT */
111111
xlp_early_init_devtree();
112112

113-
if (boot_mem_map.nr_map == 0) {
113+
if (memblock_end_of_DRAM() == 0) {
114114
pr_info("Using DRAM BARs for memory map.\n");
115115
xlp_init_mem_from_bars();
116116
}

0 commit comments

Comments
 (0)