diff options
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r-- | arch/mips/kernel/setup.c | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c71d1eb7da59..8aaaa42f91ed 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
@@ -846,6 +846,34 @@ static void __init arch_mem_init(char **cmdline_p) | |||
846 | struct memblock_region *reg; | 846 | struct memblock_region *reg; |
847 | extern void plat_mem_setup(void); | 847 | extern void plat_mem_setup(void); |
848 | 848 | ||
849 | /* | ||
850 | * Initialize boot_command_line to an innocuous but non-empty string in | ||
851 | * order to prevent early_init_dt_scan_chosen() from copying | ||
852 | * CONFIG_CMDLINE into it without our knowledge. We handle | ||
853 | * CONFIG_CMDLINE ourselves below & don't want to duplicate its | ||
854 | * content because repeating arguments can be problematic. | ||
855 | */ | ||
856 | strlcpy(boot_command_line, " ", COMMAND_LINE_SIZE); | ||
857 | |||
858 | /* call board setup routine */ | ||
859 | plat_mem_setup(); | ||
860 | |||
861 | /* | ||
862 | * Make sure all kernel memory is in the maps. The "UP" and | ||
863 | * "DOWN" are opposite for initdata since if it crosses over | ||
864 | * into another memory section you don't want that to be | ||
865 | * freed when the initdata is freed. | ||
866 | */ | ||
867 | arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT, | ||
868 | PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT, | ||
869 | BOOT_MEM_RAM); | ||
870 | arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT, | ||
871 | PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT, | ||
872 | BOOT_MEM_INIT_RAM); | ||
873 | |||
874 | pr_info("Determined physical RAM map:\n"); | ||
875 | print_memory_map(); | ||
876 | |||
849 | #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) | 877 | #if defined(CONFIG_CMDLINE_BOOL) && defined(CONFIG_CMDLINE_OVERRIDE) |
850 | strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); | 878 | strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE); |
851 | #else | 879 | #else |
@@ -873,26 +901,6 @@ static void __init arch_mem_init(char **cmdline_p) | |||
873 | } | 901 | } |
874 | #endif | 902 | #endif |
875 | #endif | 903 | #endif |
876 | |||
877 | /* call board setup routine */ | ||
878 | plat_mem_setup(); | ||
879 | |||
880 | /* | ||
881 | * Make sure all kernel memory is in the maps. The "UP" and | ||
882 | * "DOWN" are opposite for initdata since if it crosses over | ||
883 | * into another memory section you don't want that to be | ||
884 | * freed when the initdata is freed. | ||
885 | */ | ||
886 | arch_mem_addpart(PFN_DOWN(__pa_symbol(&_text)) << PAGE_SHIFT, | ||
887 | PFN_UP(__pa_symbol(&_edata)) << PAGE_SHIFT, | ||
888 | BOOT_MEM_RAM); | ||
889 | arch_mem_addpart(PFN_UP(__pa_symbol(&__init_begin)) << PAGE_SHIFT, | ||
890 | PFN_DOWN(__pa_symbol(&__init_end)) << PAGE_SHIFT, | ||
891 | BOOT_MEM_INIT_RAM); | ||
892 | |||
893 | pr_info("Determined physical RAM map:\n"); | ||
894 | print_memory_map(); | ||
895 | |||
896 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); | 904 | strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); |
897 | 905 | ||
898 | *cmdline_p = command_line; | 906 | *cmdline_p = command_line; |