20 #include <linux/export.h>
21 #include <linux/kernel.h>
22 #include <linux/stddef.h>
25 #include <linux/utsname.h>
30 #include <linux/screen_info.h>
32 #include <linux/kexec.h>
43 #include <asm/cputype.h>
45 #include <asm/cputable.h>
46 #include <asm/sections.h>
47 #include <asm/setup.h>
48 #include <asm/cacheflush.h>
49 #include <asm/tlbflush.h>
50 #include <asm/traps.h>
51 #include <asm/memblock.h>
59 static const char *cpu_name;
60 static const char *machine_name;
68 .name =
"Kernel code",
74 .name =
"Kernel data",
81 #define kernel_code mem_res[0]
82 #define kernel_data mem_res[1]
96 static void __init setup_processor(
void)
107 printk(
"CPU configuration botched (ID %08x), unable to continue.\n",
114 printk(
"CPU: %s [%08x] revision %d\n",
115 cpu_name, read_cpuid_id(), read_cpuid_id() & 15);
124 unsigned long dt_root;
129 "Error: NULL or invalid device tree blob\n"
130 "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
131 "\nPlease check your bootloader.\n");
143 "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n"
144 "Expected 0x%x, found 0x%x\n"
145 "\nPlease check your bootloader.\n",
154 dt_root = of_get_flat_dt_root();
156 machine_name = of_get_flat_dt_prop(dt_root,
"model",
NULL);
158 machine_name = of_get_flat_dt_prop(dt_root,
"compatible",
NULL);
160 machine_name =
"<unknown>";
161 pr_info(
"Machine: %s\n", machine_name);
166 of_scan_flat_dt(early_init_dt_scan_root,
NULL);
168 of_scan_flat_dt(early_init_dt_scan_memory,
NULL);
176 pr_warning(
"Ignoring memory block 0x%llx - 0x%llx\n",
181 pr_warning(
"Ignoring memory range 0x%llx - 0x%llx\n",
197 static int __init early_mem(
char *
p)
205 pr_notice(
"Memory limited to %lldMB\n", limit >> 20);
213 static void __init request_standard_resources(
void)
215 struct memblock_region *
region;
223 for_each_memblock(
memory, region) {
225 res->
name =
"System RAM";
259 request_standard_resources();
261 unflatten_device_tree();
268 #if defined(CONFIG_VGA_CONSOLE)
270 #elif defined(CONFIG_DUMMY_CONSOLE)
278 static int __init topology_init(
void)
292 static const char *hwcap_str[] = {
298 static int c_show(
struct seq_file *
m,
void *
v)
302 seq_printf(m,
"Processor\t: %s rev %d (%s)\n",
322 for (i = 0; hwcap_str[
i]; i++)
326 seq_printf(m,
"\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
328 seq_printf(m,
"CPU variant\t: 0x%x\n", (read_cpuid_id() >> 20) & 15);
329 seq_printf(m,
"CPU part\t: 0x%03x\n", (read_cpuid_id() >> 4) & 0xfff);
330 seq_printf(m,
"CPU revision\t: %d\n", read_cpuid_id() & 15);
334 seq_printf(m,
"Hardware\t: %s\n", machine_name);
341 return *pos < 1 ? (
void *)1 :
NULL;
344 static void *c_next(
struct seq_file *m,
void *v, loff_t *
pos)
350 static void c_stop(
struct seq_file *m,
void *v)