MCPcopy Create free account
hub / github.com/F-Stack/f-stack / initarm

Function initarm

freebsd/arm/arm/machdep.c:735–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

733
734#ifdef FDT
735void *
736initarm(struct arm_boot_params *abp)
737{
738 struct mem_region mem_regions[FDT_MEM_REGIONS];
739 vm_paddr_t lastaddr;
740 vm_offset_t dtbp, kernelstack, dpcpu;
741 char *env;
742 void *kmdp;
743 int err_devmap, mem_regions_sz;
744 phandle_t root;
745 char dts_version[255];
746#ifdef EFI
747 struct efi_map_header *efihdr;
748#endif
749
750 /* get last allocated physical address */
751 arm_physmem_kernaddr = abp->abp_physaddr;
752 lastaddr = parse_boot_param(abp) - KERNVIRTADDR + arm_physmem_kernaddr;
753
754 set_cpufuncs();
755 cpuinfo_init();
756
757 /*
758 * Find the dtb passed in by the boot loader.
759 */
760 kmdp = preload_search_by_type("elf kernel");
761 dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t);
762#if defined(FDT_DTB_STATIC)
763 /*
764 * In case the device tree blob was not retrieved (from metadata) try
765 * to use the statically embedded one.
766 */
767 if (dtbp == (vm_offset_t)NULL)
768 dtbp = (vm_offset_t)&fdt_static_dtb;
769#endif
770
771 if (OF_install(OFW_FDT, 0) == FALSE)
772 panic("Cannot install FDT");
773
774 if (OF_init((void *)dtbp) != 0)
775 panic("OF_init failed with the found device tree");
776
777#if defined(LINUX_BOOT_ABI)
778 arm_parse_fdt_bootargs();
779#endif
780
781#ifdef EFI
782 efihdr = (struct efi_map_header *)preload_search_info(kmdp,
783 MODINFO_METADATA | MODINFOMD_EFI_MAP);
784 if (efihdr != NULL) {
785 arm_add_efi_map_entries(efihdr, mem_regions, &mem_regions_sz);
786 } else
787#endif
788 {
789 /* Grab physical memory regions information from device tree. */
790 if (fdt_get_mem_regions(mem_regions, &mem_regions_sz,NULL) != 0)
791 panic("Cannot get physical memory regions");
792 }

Callers

nothing calls this directly

Calls 15

parse_boot_paramFunction · 0.85
set_cpufuncsFunction · 0.85
cpuinfo_initFunction · 0.85
preload_search_by_typeFunction · 0.85
arm_parse_fdt_bootargsFunction · 0.85
preload_search_infoFunction · 0.85
arm_add_efi_map_entriesFunction · 0.85
physmem_hardware_regionsFunction · 0.85
physmem_exclude_regionsFunction · 0.85
pmap_set_texFunction · 0.85
pmap_bootstrap_prepareFunction · 0.85
pmap_preboot_map_attrFunction · 0.85

Tested by

no test coverage detected