void __init __dt_setup_arch(void *bph) { if (!early_init_dt_scan(bph)) return; mips_set_machine_name(of_flat_dt_get_machine_name()); }
void __init __dt_setup_arch(struct boot_param_header *bph) { if (!early_init_dt_scan(bph)) return; mips_set_machine_name(of_flat_dt_get_machine_name()); }
void __init early_init_devtree(void *params) { __be32 *dtb = (u32 *)__dtb_start; #if defined(CONFIG_NIOS2_DTB_AT_PHYS_ADDR) if (be32_to_cpup((__be32 *)CONFIG_NIOS2_DTB_PHYS_ADDR) == OF_DT_HEADER) { params = (void *)CONFIG_NIOS2_DTB_PHYS_ADDR; early_init_dt_scan(params); return; } #endif if (be32_to_cpu((__be32) *dtb) == OF_DT_HEADER) params = (void *)__dtb_start; early_init_dt_scan(params); }
static void __init setup_machine_fdt(phys_addr_t dt_phys) { unsigned long dt_root; if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) { early_print("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n" "\nPlease check your bootloader.\n", dt_phys, phys_to_virt(dt_phys)); while (true) cpu_relax(); } dt_root = of_get_flat_dt_root(); /* for hacking machine desc, not upstream */ machine_desc = get_machine_desc_compatible(); if (machine_desc) early_print("find compat machine_desc %s\n", machine_desc->name); machine_name = of_get_flat_dt_prop(dt_root, "model", NULL); if (!machine_name) machine_name = of_get_flat_dt_prop(dt_root, "compatible", NULL); if (!machine_name) machine_name = "<unknown>"; pr_info("Machine: %s\n", machine_name); }
void __init early_init_devtree(void *params) { early_init_dt_scan(params); of_scan_flat_dt(xtensa_dt_io_area, NULL); if (!command_line[0]) strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); }
void __init h8300_fdt_init(void *fdt, char *bootargs) { if (!fdt) fdt = __dtb_start; else strcpy(command_line, bootargs); early_init_dt_scan(fdt); memblock_allow_resize(); }
void __init parse_dtb(unsigned int hartid, void *dtb) { if (early_init_dt_scan(__va(dtb))) return; pr_err("No DTB passed to the kernel\n"); #ifdef CONFIG_CMDLINE_FORCE strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); pr_info("Forcing kernel command line to: %s\n", boot_command_line); #endif }
void __init early_init_devtree(void *params) { if (sysmem.nr_banks == 0) dt_memory_scan = true; early_init_dt_scan(params); of_scan_flat_dt(xtensa_dt_io_area, NULL); if (!command_line[0]) strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE); }
void __init parse_dtb(phys_addr_t dtb_phys) { void *dtb = __va(dtb_phys); if (early_init_dt_scan(dtb)) return; pr_err("No DTB passed to the kernel\n"); #ifdef CONFIG_CMDLINE_FORCE strlcpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); pr_info("Forcing kernel command line to: %s\n", boot_command_line); #endif }
static void __init setup_machine_fdt(phys_addr_t dt_phys) { if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) { early_print("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n" "\nPlease check your bootloader.\n", dt_phys, phys_to_virt(dt_phys)); while (true) cpu_relax(); } machine_name = of_flat_dt_get_machine_name(); }
static void __init setup_machine_fdt(phys_addr_t dt_phys) { void *dt_virt = fixmap_remap_fdt(dt_phys); if (!dt_virt || !early_init_dt_scan(dt_virt)) { pr_crit("\n" "Error: invalid device tree blob at physical address %pa (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and must not exceed 2 MB in size\n" "\nPlease check your bootloader.", &dt_phys, dt_virt); while (true) cpu_relax(); } dump_stack_set_arch_desc("%s (DT)", of_flat_dt_get_machine_name()); }
/** * setup_machine_fdt - Machine setup when an dtb was passed to the kernel * @dt: virtual address pointer to dt blob * * If a dtb was passed to the kernel, then use it to choose the correct * machine_desc and to setup the system. */ const struct machine_desc * __init setup_machine_fdt(void *dt) { const struct machine_desc *mdesc; unsigned long dt_root; if (!early_init_dt_scan(dt)) return NULL; mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach); if (!mdesc) machine_halt(); dt_root = of_get_flat_dt_root(); arc_set_early_base_baud(dt_root); return mdesc; }
/** * setup_machine_fdt - Machine setup when an dtb was passed to the kernel * @dt: virtual address pointer to dt blob * * If a dtb was passed to the kernel, then use it to choose the correct * machine_desc and to setup the system. */ const struct machine_desc * __init setup_machine_fdt(void *dt) { const struct machine_desc *mdesc; unsigned long dt_root; const void *clk; int len; if (!early_init_dt_scan(dt)) return NULL; mdesc = of_flat_dt_match_machine(NULL, arch_get_next_mach); if (!mdesc) machine_halt(); dt_root = of_get_flat_dt_root(); clk = of_get_flat_dt_prop(dt_root, "clock-frequency", &len); if (clk) arc_set_core_freq(of_read_ulong(clk, len/4)); return mdesc; }
void __init setup_arch(char **cmdline_p) { extern void init_etrax_debug(void); unsigned long bootmap_size; unsigned long start_pfn, max_pfn; unsigned long memory_start; #ifdef CONFIG_OF early_init_dt_scan(__dtb_start); #endif /* register an initial console printing routine for printk's */ init_etrax_debug(); /* we should really poll for DRAM size! */ high_memory = &dram_end; if(romfs_in_flash || !romfs_length) { /* if we have the romfs in flash, or if there is no rom filesystem, * our free area starts directly after the BSS */ memory_start = (unsigned long) &_end; } else { /* otherwise the free area starts after the ROM filesystem */ printk("ROM fs in RAM, size %lu bytes\n", romfs_length); memory_start = romfs_start + romfs_length; } /* process 1's initial memory region is the kernel code/data */ init_mm.start_code = (unsigned long) &text_start; init_mm.end_code = (unsigned long) &_etext; init_mm.end_data = (unsigned long) &_edata; init_mm.brk = (unsigned long) &_end; /* min_low_pfn points to the start of DRAM, start_pfn points * to the first DRAM pages after the kernel, and max_low_pfn * to the end of DRAM. */ /* * partially used pages are not usable - thus * we are rounding upwards: */ start_pfn = PFN_UP(memory_start); /* usually c0000000 + kernel + romfs */ max_pfn = PFN_DOWN((unsigned long)high_memory); /* usually c0000000 + dram size */ /* * Initialize the boot-time allocator (start, end) * * We give it access to all our DRAM, but we could as well just have * given it a small slice. No point in doing that though, unless we * have non-contiguous memory and want the boot-stuff to be in, say, * the smallest area. * * It will put a bitmap of the allocated pages in the beginning * of the range we give it, but it won't mark the bitmaps pages * as reserved. We have to do that ourselves below. * * We need to use init_bootmem_node instead of init_bootmem * because our map starts at a quite high address (min_low_pfn). */ max_low_pfn = max_pfn; min_low_pfn = PAGE_OFFSET >> PAGE_SHIFT; bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, min_low_pfn, max_low_pfn); /* And free all memory not belonging to the kernel (addr, size) */ free_bootmem(PFN_PHYS(start_pfn), PFN_PHYS(max_pfn - start_pfn)); /* * Reserve the bootmem bitmap itself as well. We do this in two * steps (first step was init_bootmem()) because this catches * the (very unlikely) case of us accidentally initializing the * bootmem allocator with an invalid RAM area. * * Arguments are start, size */ reserve_bootmem(PFN_PHYS(start_pfn), bootmap_size, BOOTMEM_DEFAULT); unflatten_and_copy_device_tree(); /* paging_init() sets up the MMU and marks all pages as reserved */ paging_init(); *cmdline_p = cris_command_line; #ifdef CONFIG_ETRAX_CMDLINE if (!strcmp(cris_command_line, "")) { strlcpy(cris_command_line, CONFIG_ETRAX_CMDLINE, COMMAND_LINE_SIZE); cris_command_line[COMMAND_LINE_SIZE - 1] = '\0'; } #endif /* Save command line for future references. */ memcpy(boot_command_line, cris_command_line, COMMAND_LINE_SIZE); boot_command_line[COMMAND_LINE_SIZE - 1] = '\0'; /* give credit for the CRIS port */ show_etrax_copyright(); /* Setup utsname */ strcpy(init_utsname()->machine, cris_machine_name); }
void __init early_init_devtree(void *params) { early_init_dt_scan(params); memblock_allow_resize(); }