arm: add relocate initrd support
Subsystems (3)
RFC v2 1/1 arm: add relocate initrd support
Add support for initrd on ARM arch, in case
mem= boot option change the memory size or the initrd are not placed in low memory region, we need copy the initrd to low memory region.
Signed-off-by yalin wang <[email protected]>
--- arch/arm/include/asm/fixmap.h | 1 + arch/arm/kernel/setup.c | 70 +++++++++++++++++++++++++++++++++++++++++++ drivers/of/fdt.c | 2 ++ include/linux/initrd.h | 1 + init/do_mounts_initrd.c | 2 ++ 5 files changed, 76 insertions(+)
arch/arm/include/asm/fixmap.h +1 -0
@@ -10,6 +10,7 @@enum fixed_addresses {FIX_EARLYCON_MEM_BASE , +FIX_RELOCATE_INITRD , __end_of_permanent_fixed_addresses,FIX_KMAP_BEGIN = __end_of_permanent_fixed_addresses,
arch/arm/kernel/setup.c +70 -0
82 lines not on this page · raw message
drivers/of/fdt.c +2 -0
@@ -777,6 +777,8 @@ static void __init early_init_dt_check_for_initrd(unsigned long node)return ; end =of_read_number (prop, len/4 ); + initrd_start_phys = start; + initrd_end_phys = end; initrd_start = (unsigned long )__va (start); initrd_end = (unsigned long )__va (end); initrd_below_start_ok =1 ;
include/linux/initrd.h +1 -0
@@ -15,6 +15,7 @@ extern int initrd_below_start_ok;/* free_initrd_mem always gets called with the next two as arguments.. */ extern unsigned long initrd_start, initrd_end; +extern phys_addr_t initrd_start_phys, initrd_end_phys;extern void free_initrd_mem (unsigned long ,unsigned long );extern unsigned int real_root_dev;
init/do_mounts_initrd.c +2 -0
@@ -21,6 +21,8 @@#include "do_mounts.h" unsigned long initrd_start, initrd_end; +phys_addr_t initrd_start_pyhs__initdata ; +phys_addr_t initrd_end_phys__initdata ;int initrd_below_start_ok;unsigned int real_root_dev;/* do_proc_dointvec cannot handle kdev_t */ static int __initdata mount_initrd =1 ;
Signature · 1 line
1.9.1