Merge tag 'arm64-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64...
[platform/kernel/linux-rpi.git] / arch / arm64 / mm / init.c
index 380ebe7..e19e065 100644 (file)
@@ -36,6 +36,7 @@
 #include <linux/efi.h>
 #include <linux/swiotlb.h>
 #include <linux/vmalloc.h>
+#include <linux/mm.h>
 
 #include <asm/boot.h>
 #include <asm/fixmap.h>
@@ -209,8 +210,8 @@ void __init arm64_memblock_init(void)
         * linear mapping. Take care not to clip the kernel which may be
         * high in memory.
         */
-       memblock_remove(max_t(u64, memstart_addr + linear_region_size, __pa(_end)),
-                       ULLONG_MAX);
+       memblock_remove(max_t(u64, memstart_addr + linear_region_size,
+                       __pa_symbol(_end)), ULLONG_MAX);
        if (memstart_addr + linear_region_size < memblock_end_of_DRAM()) {
                /* ensure that memstart_addr remains sufficiently aligned */
                memstart_addr = round_up(memblock_end_of_DRAM() - linear_region_size,
@@ -225,7 +226,7 @@ void __init arm64_memblock_init(void)
         */
        if (memory_limit != (phys_addr_t)ULLONG_MAX) {
                memblock_mem_limit_remove_map(memory_limit);
-               memblock_add(__pa(_text), (u64)(_end - _text));
+               memblock_add(__pa_symbol(_text), (u64)(_end - _text));
        }
 
        if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_start) {
@@ -278,7 +279,7 @@ void __init arm64_memblock_init(void)
         * Register the kernel text, kernel data, initrd, and initial
         * pagetables with memblock.
         */
-       memblock_reserve(__pa(_text), _end - _text);
+       memblock_reserve(__pa_symbol(_text), _end - _text);
 #ifdef CONFIG_BLK_DEV_INITRD
        if (initrd_start) {
                memblock_reserve(initrd_start, initrd_end - initrd_start);
@@ -486,7 +487,8 @@ void __init mem_init(void)
 
 void free_initmem(void)
 {
-       free_reserved_area(__va(__pa(__init_begin)), __va(__pa(__init_end)),
+       free_reserved_area(lm_alias(__init_begin),
+                          lm_alias(__init_end),
                           0, "unused kernel");
        /*
         * Unmap the __init region but leave the VM area in place. This