--- zzzz-none-000/linux-4.4.60/arch/mips/kernel/setup.c 2017-04-08 07:53:53.000000000 +0000 +++ wasp-540e-714/linux-4.4.60/arch/mips/kernel/setup.c 2019-07-03 09:21:34.000000000 +0000 @@ -9,6 +9,7 @@ * Copyright (C) 1996 Stoned Elipot * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) 2000, 2001, 2002, 2007 Maciej W. Rozycki + * Copyright (C) 2013 AVM GmbH */ #include #include @@ -24,6 +25,7 @@ #include #include #include +#include #include #include @@ -38,6 +40,9 @@ #include #include #include +#if defined(CONFIG_AVM_ENHANCED) +#include +#endif/*--- #if defined(CONFIG_AVM_ENHANCED) ---*/ #ifdef CONFIG_MIPS_ELF_APPENDED_DTB const char __section(.appended_dtb) __appended_dtb[0x100000]; @@ -172,6 +177,9 @@ case BOOT_MEM_ROM_DATA: printk(KERN_CONT "(ROM data)\n"); break; + case BOOT_MEM_BOOTLOADER: + printk(KERN_CONT "(bootloader)\n"); + break; case BOOT_MEM_RESERVED: printk(KERN_CONT "(reserved)\n"); break; @@ -713,6 +721,7 @@ static void __init resource_init(void) { + int avm_bootmem_init_done = 0; int i; if (UNCAC_BASE != IO_BASE) @@ -741,6 +750,9 @@ case BOOT_MEM_ROM_DATA: res->name = "System RAM"; break; + case BOOT_MEM_BOOTLOADER: + res->name = "bootloader"; + break; case BOOT_MEM_RESERVED: default: res->name = "reserved"; @@ -760,6 +772,13 @@ request_resource(res, &code_resource); request_resource(res, &data_resource); request_crashkernel(res); + + if (!avm_bootmem_init_done) { +#if defined(CONFIG_AVM_ENHANCED) + module_alloc_bootmem_init(res); +#endif/*--- #if defined(CONFIG_AVM_ENHANCED) ---*/ + avm_bootmem_init_done = 1; + } } } @@ -784,11 +803,26 @@ void __init setup_arch(char **cmdline_p) { + extern void plat_device_tree_setup(void); + +#if defined(CONFIG_EARLY_PRINTK) && defined(CONFIG_ATH79) + /* ATH79 earlyprintk can run without dt and prom */ + setup_early_printk(); +#endif + cpu_probe(); + /* ================================== * + * avm_kernel_config needs to be * + * initilized before prom for devices * + * with env in kernel config (HW238) * + * ================================== */ + init_avm_kernel_config(); prom_init(); + plat_device_tree_setup(); + setup_early_fdc_console(); -#ifdef CONFIG_EARLY_PRINTK +#if defined(CONFIG_EARLY_PRINTK) && !defined(CONFIG_ATH79) setup_early_printk(); #endif cpu_report();