File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 34
34
35
35
#include <linux/kernel.h>
36
36
#include <linux/of_fdt.h>
37
+ #include <linux/memblock.h>
37
38
38
39
#include <asm/idle.h>
39
40
#include <asm/reboot.h>
@@ -67,12 +68,11 @@ static void nlm_linux_exit(void)
67
68
static void nlm_fixup_mem (void )
68
69
{
69
70
const int pref_backup = 512 ;
70
- int i ;
71
+ struct memblock_region * mem ;
71
72
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 );
76
76
}
77
77
}
78
78
@@ -110,7 +110,7 @@ void __init plat_mem_setup(void)
110
110
/* memory and bootargs from DT */
111
111
xlp_early_init_devtree ();
112
112
113
- if (boot_mem_map . nr_map == 0 ) {
113
+ if (memblock_end_of_DRAM () == 0 ) {
114
114
pr_info ("Using DRAM BARs for memory map.\n" );
115
115
xlp_init_mem_from_bars ();
116
116
}
You can’t perform that action at this time.
0 commit comments