Merge branch 'yaml-bindings-for-v4.21' into dt/next
[linux-2.6-microblaze.git] / arch / arm64 / mm / init.c
index 9b432d9..ecc316b 100644 (file)
 s64 memstart_addr __ro_after_init = -1;
 phys_addr_t arm64_dma_phys_limit __ro_after_init;
 
-#ifdef CONFIG_BLK_DEV_INITRD
-static int __init early_initrd(char *p)
-{
-       unsigned long start, size;
-       char *endp;
-
-       start = memparse(p, &endp);
-       if (*endp == ',') {
-               size = memparse(endp + 1, NULL);
-
-               initrd_start = start;
-               initrd_end = start + size;
-       }
-       return 0;
-}
-early_param("initrd", early_initrd);
-#endif
-
 #ifdef CONFIG_KEXEC_CORE
 /*
  * reserve_crashkernel() - reserves memory for crash kernel
@@ -407,14 +389,14 @@ void __init arm64_memblock_init(void)
                memblock_add(__pa_symbol(_text), (u64)(_end - _text));
        }
 
-       if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_start) {
+       if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) {
                /*
                 * Add back the memory we just removed if it results in the
                 * initrd to become inaccessible via the linear mapping.
                 * Otherwise, this is a no-op
                 */
-               u64 base = initrd_start & PAGE_MASK;
-               u64 size = PAGE_ALIGN(initrd_end) - base;
+               u64 base = phys_initrd_start & PAGE_MASK;
+               u64 size = PAGE_ALIGN(phys_initrd_size);
 
                /*
                 * We can only add back the initrd memory if we don't end up
@@ -458,15 +440,11 @@ void __init arm64_memblock_init(void)
         * pagetables with memblock.
         */
        memblock_reserve(__pa_symbol(_text), _end - _text);
-#ifdef CONFIG_BLK_DEV_INITRD
-       if (initrd_start) {
-               memblock_reserve(initrd_start, initrd_end - initrd_start);
-
+       if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) {
                /* the generic initrd code expects virtual addresses */
-               initrd_start = __phys_to_virt(initrd_start);
-               initrd_end = __phys_to_virt(initrd_end);
+               initrd_start = __phys_to_virt(phys_initrd_start);
+               initrd_end = initrd_start + phys_initrd_size;
        }
-#endif
 
        early_init_fdt_scan_reserved_mem();