fix booting second core on toradex

This commit is contained in:
Aurel Feer 2022-04-26 20:55:03 +02:00
parent b66f20ae24
commit 4f71689996
2 changed files with 7 additions and 3 deletions

View File

@ -11,7 +11,7 @@
"${workspaceFolder}/kernel/include/arch/aarch64/",
"${workspaceFolder}/kernel/include/arch/armv8/",
"${workspaceFolder}/lib/aos/include/arch/aarch64/",
"${BFBUILD}/armv8/include/"
"${workspaceFolder}/build/armv8/include/"
],
"compilerPath": "",
"intelliSenseMode": "gcc-arm64",

View File

@ -313,7 +313,7 @@ errval_t coreboot(coreid_t mpid,
// - Relocate the boot and CPU driver. The boot driver runs with a 1:1
// VA->PA mapping. The CPU driver is expected to be loaded at the
// high virtual address space, at offset ARMV8_KERNEL_OFFSET.
err = relocate_elf((genvaddr_t) bootdriver_elf_addr, &bootdriver_mem_info, remote_bootdriver_elf_frame_id.base);
err = relocate_elf((genvaddr_t) bootdriver_elf_addr, &bootdriver_mem_info, 0);
if(err_is_fail(err)) return err;
err = relocate_elf((genvaddr_t) cpudriver_elf_addr, &cpudriver_mem_info, ARMv8_KERNEL_OFFSET);
@ -348,7 +348,8 @@ errval_t coreboot(coreid_t mpid,
// - Fill in the core data struct, for a description, see the definition
// in include/target/aarch64/barrelfish_kpi/arm_core_data.h
struct armv8_core_data *core_data;
paging_map_frame(get_current_paging_state(), (void**) &core_data, PAGE_SIZE, core_data_frame);
err = paging_map_frame(get_current_paging_state(), (void**) &core_data, PAGE_SIZE, core_data_frame);
if (err_is_fail(err)) return err_push(err, LIB_ERR_PMAP_MAP);
core_data->boot_magic = ARMV8_BOOTMAGIC_PSCI;
core_data->cpu_driver_stack = cpu_driver_stack_frame_id.base + 16 * BASE_PAGE_SIZE;
@ -373,6 +374,9 @@ errval_t coreboot(coreid_t mpid,
core_data->dst_arch_id = mpid;
// find cpu driver entry point
// debug_printf("[coreboot]: arch_init_sym->st_value = %p\n", arch_init_sym->st_value);
// debug_printf("[coreboot]: reloc_cpudriver_entry = %p\n", reloc_cpudriver_entry);
// debug_printf("[coreboot]: ARMv8_KERNEL_OFFSET = %p\n", ARMv8_KERNEL_OFFSET);
core_data->cpu_driver_entry = reloc_cpudriver_entry + ARMv8_KERNEL_OFFSET;
debug_printf("[coreboot] Flush the cache\n");