Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

of/fdt: factor out assignment of initrd_start/initrd_end

Since architectures may not yet have their linear mapping up and running
when the initrd address is discovered from the DT, factor out the
assignment of initrd_start and initrd_end, so that an architecture can
override it and use the translation it needs.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>

authored by

Ard Biesheuvel and committed by
Catalin Marinas
369bc9ab 270522a0

+11 -3
+11 -3
drivers/of/fdt.c
··· 760 760 } 761 761 762 762 #ifdef CONFIG_BLK_DEV_INITRD 763 + #ifndef __early_init_dt_declare_initrd 764 + static void __early_init_dt_declare_initrd(unsigned long start, 765 + unsigned long end) 766 + { 767 + initrd_start = (unsigned long)__va(start); 768 + initrd_end = (unsigned long)__va(end); 769 + initrd_below_start_ok = 1; 770 + } 771 + #endif 772 + 763 773 /** 764 774 * early_init_dt_check_for_initrd - Decode initrd location from flat tree 765 775 * @node: reference to node containing initrd location ('chosen') ··· 792 782 return; 793 783 end = of_read_number(prop, len/4); 794 784 795 - initrd_start = (unsigned long)__va(start); 796 - initrd_end = (unsigned long)__va(end); 797 - initrd_below_start_ok = 1; 785 + __early_init_dt_declare_initrd(start, end); 798 786 799 787 pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", 800 788 (unsigned long long)start, (unsigned long long)end);