static char * __init x86_intel_ce_memory_setup(void) { unsigned long memory_top, linux_top; /* Our only memory config option is e801, * firmware doesn't seem to bother with e820 map. */ memory_top = ONE_MB + boot_params.alt_mem_k * 1024; /* Ancient bootloaders pass garbage here, do a basic sanity check */ if (memory_top < 4 * ONE_MB) { printk(KERN_WARNING "Incorrect e801 memory size 0x%08lx, using 768 MB\n", memory_top); memory_top = 768 * ONE_MB; } e820_add_region(0, LOWMEMSIZE(), E820_RAM); e820_add_region(HIGH_MEMORY, memory_top - HIGH_MEMORY, E820_RAM); /* CEFDK uses some regions in the first 1MB for various purposes. * We hardcode superset of those regions to support different * CEFDK releases. */ #ifdef CONFIG_ACPI e820_update_range(0x10000, 0x8000, E820_RAM, E820_ACPI); #endif /* 8051 microcode can be loaded at 0x30000 or 0x40000 */ e820_update_range(0x30000, 0x20000, E820_RAM, E820_RESERVED); /* e1000 "NVRAM" */ e820_update_range(0x60000, 0x1000, E820_RAM, E820_RESERVED); linux_top = x86_intel_ce_machine_top_of_ram(memory_top); if (linux_top < memory_top) e820_update_range(linux_top, memory_top - linux_top, E820_RAM, E820_RESERVED); /* check board name for reboot and halt sequence*/ { static __initdata char tmp_cmdline[COMMAND_LINE_SIZE]; strlcpy(tmp_cmdline, boot_command_line, COMMAND_LINE_SIZE); parse_args("beyond_param", tmp_cmdline, NULL, 0, parse_pwrctl_type); } return "BIOS-e801"; }
void __init setup_bios_corruption_check(void) { u64 addr = PAGE_SIZE; /* assume first page is reserved anyway */ if (memory_corruption_check == -1) { memory_corruption_check = #ifdef CONFIG_X86_BOOTPARAM_MEMORY_CORRUPTION_CHECK 1 #else 0 #endif ; } if (corruption_check_size == 0) memory_corruption_check = 0; if (!memory_corruption_check) return; corruption_check_size = round_up(corruption_check_size, PAGE_SIZE); while (addr < corruption_check_size && num_scan_areas < MAX_SCAN_AREAS) { u64 size; addr = find_e820_area_size(addr, &size, PAGE_SIZE); if (addr == 0) break; if ((addr + size) > corruption_check_size) size = corruption_check_size - addr; if (size == 0) break; e820_update_range(addr, size, E820_RAM, E820_RESERVED); scan_areas[num_scan_areas].addr = addr; scan_areas[num_scan_areas].size = size; num_scan_areas++; /* Assume we've already mapped this early memory */ memset(__va(addr), 0, size); addr += size; } printk(KERN_INFO "Scanning %d areas for low memory corruption\n", num_scan_areas); update_e820(); }