--- zzzz-none-000/linux-2.6.28.10/arch/mips/kernel/setup.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/arch/mips/kernel/setup.c 2015-07-23 14:10:39.000000000 +0000 @@ -31,6 +31,11 @@ #include #include #include +#include + +#if defined(CONFIG_AR9) || defined(CONFIG_VR9) + #include "../mach-infineon/common/ifxmips_core.h" +#endif /*--- #if defined(CONFIG_AR9) || defined(CONFIG_VR9) ---*/ struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly; @@ -520,13 +525,13 @@ res = alloc_bootmem(sizeof(struct resource)); switch (boot_mem_map.map[i].type) { - case BOOT_MEM_RAM: - case BOOT_MEM_ROM_DATA: - res->name = "System RAM"; - break; - case BOOT_MEM_RESERVED: - default: - res->name = "reserved"; + case BOOT_MEM_RAM: + case BOOT_MEM_ROM_DATA: + res->name = "System RAM"; + break; + case BOOT_MEM_RESERVED: + default: + res->name = "reserved"; } res->start = start; @@ -542,12 +547,78 @@ */ request_resource(res, &code_resource); request_resource(res, &data_resource); + + { + static char run_once = 0; + + if(!run_once) { +#if defined(CONFIG_AR9) || defined(CONFIG_VR9) + extern struct resource *ar9vr9_alloc_c55_code(unsigned long start, unsigned long end); + struct resource *pc55req; + /*--- struct resource *pmodulereq; ---*/ + pc55req = ar9vr9_alloc_c55_code(res->start, res->end); + if(pc55req) { + request_resource(res, pc55req); + /*--- reserved memory for all time: ---*/ + if(reserve_bootmem(pc55req->start, pc55req->end - pc55req->start + 1, BOOTMEM_DEFAULT)) { + printk(KERN_ERR "[c55-alloc] reserve memory for module-load failed (start 0x%x end 0x%x)\n", + pc55req->start, pc55req->end); + } + } +#endif /*--- #if defined(CONFIG_AR9) || defined(CONFIG_VR9) ---*/ + + + { + extern unsigned long module_alloc_size_list_base; + extern unsigned int module_alloc_size_list_size; + static struct resource module_param; + char *arg; + if((arg = prom_getenv("modulemem")) != NULL) { + module_alloc_size_list_size = simple_strtoul(arg, NULL, 0); + } + if(module_alloc_size_list_size == 0UL) { + printk("[module-alloc-by-name] 'modulemem' not set, function disabled\n"); + } else { + module_alloc_size_list_base = (unsigned long)alloc_bootmem_pages(module_alloc_size_list_size + (1 << PAGE_SHIFT)); + module_param.start = CPHYSADDR(module_alloc_size_list_base); + module_param.end = CPHYSADDR(module_alloc_size_list_base + module_alloc_size_list_size); + module_param.name = "module memory"; + module_param.flags = IORESOURCE_MEM | IORESOURCE_BUSY; + if(request_resource(res, &module_param)) { + printk(KERN_ERR "[module-alloc] use 0x%x bytes at 0x%lx\n", module_alloc_size_list_size, module_alloc_size_list_base); + } else { + printk(KERN_ERR "[module-alloc] failed 0x%x bytes at 0x%lx\n", module_alloc_size_list_size, module_alloc_size_list_base); + } + if(reserve_bootmem(module_param.start, module_param.end - module_param.start + 1, BOOTMEM_DEFAULT)) { + printk(KERN_ERR "[module-alloc] reserve memory for module-load failed (start 0x%x end 0x%x)\n", + module_param.start, module_param.end); + } + } + } + { + /*--- reserve memory for rebootstring ---*/ + if(reserve_bootmem(CPHYSADDR(AVM_REBOOT_STRING_LOCATION), AVM_REBOOT_STRING_SIZE, BOOTMEM_DEFAULT)) { + printk(KERN_ERR "[%s] reserve memory for rebootstring failed (start 0x%x end 0x%x)\n", + __func__, CPHYSADDR(AVM_REBOOT_STRING_LOCATION), CPHYSADDR(AVM_REBOOT_STRING_LOCATION) + AVM_REBOOT_STRING_SIZE); + } + } + + run_once = 1; + } + } } } void __init setup_arch(char **cmdline_p) { + unsigned int cp0_status; + cpu_probe(); + if(current_cpu_data.ases & MIPS_ASE_DSP){ + cp0_status = read_c0_status(); + cp0_status |= ST0_MX; + write_c0_status(cp0_status); + } prom_init(); #ifdef CONFIG_EARLY_PRINTK