efi/arm: Begin stubbing out the essentials, add fdt library

* We *might* no longer need FDT knowledge in the bootloader?
* For now though, arm sources reference gFDT, so we need it.
* Need to move away from lazy gFDT and store in arch_kernel_args.
  (which is next and will be a larger commit)

Change-Id: I77cce0fc645143b78a7fd9f50ac8b96c97b5c862
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2268
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
Alexander von Gluck IV 2020-02-22 16:49:27 -06:00 committed by Alex von Gluck IV
parent 2a64b13f81
commit 82a7c7395c
5 changed files with 111 additions and 5 deletions

View File

@ -8,7 +8,7 @@ UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] ;
SubDirHdrs $(HAIKU_TOP) src add-ons kernel partitioning_systems gpt ;
{
local defines = _BOOT_MODE GNU_EFI_USE_MS_ABI _BOOT_PLATFORM_EFI ;
local defines = _BOOT_MODE _BOOT_PLATFORM_EFI ;
defines = [ FDefines $(defines) ] ;
SubDirCcFlags $(defines) ;
SubDirC++Flags $(defines) -fno-rtti ;
@ -31,14 +31,21 @@ local platform_src =
serial.cpp
;
local support_libs ;
if $(TARGET_KERNEL_ARCH) in arm arm64 {
support_libs += boot_fdt.a ;
}
local platform ;
for platform in [ MultiBootSubDirSetup efi ] {
on $(platform) {
BootMergeObject boot_platform_efi_common.o :
$(platform_src)
:
: boot_platform_generic_efi.a
: :
$(support_libs)
boot_platform_generic_efi.a
;
BootMergeObject boot_platform_efi.o :

View File

@ -6,10 +6,11 @@ UsePrivateHeaders [ FDirName kernel platform ] ;
UsePrivateHeaders [ FDirName kernel boot platform efi ] ;
local arch_src =
crt0-efi-$(TARGET_ARCH).S
#entry.S
relocation_func.cpp
#arch_smp.cpp
#arch_mmu.cpp
arch_smp.cpp
arch_mmu.cpp
arch_timer.cpp
;

View File

@ -0,0 +1,10 @@
/*
* Copyright 2019-2020 Haiku, Inc. All rights reserved.
* Released under the terms of the MIT License.
*/
void
arch_mmu_init()
{
// Stub
}

View File

@ -0,0 +1,72 @@
/*
* Copyright 2019-2020, Haiku, Inc. All rights reserved.
* Released under the terms of the MIT License.
*/
#include "arch_smp.h"
#include <string.h>
#include <KernelExport.h>
#include <kernel.h>
#include <safemode.h>
#include <boot/platform.h>
#include <boot/stage2.h>
#include <boot/menu.h>
//#define TRACE_SMP
#ifdef TRACE_SMP
# define TRACE(x) dprintf x
#else
# define TRACE(x) ;
#endif
int
arch_smp_get_current_cpu(void)
{
// One cpu for now.
return 0;
}
void
arch_smp_init_other_cpus(void)
{
// One cpu for now.
gKernelArgs.num_cpus = 1;
return;
}
void
arch_smp_boot_other_cpus(uint32 pml4, uint64 kernel_entry)
{
// One cpu for now.
}
void
arch_smp_add_safemode_menus(Menu *menu)
{
MenuItem *item;
if (gKernelArgs.num_cpus < 2)
return;
item = new(nothrow) MenuItem("Disable SMP");
menu->AddItem(item);
item->SetData(B_SAFEMODE_DISABLE_SMP);
item->SetType(MENU_ITEM_MARKABLE);
item->SetHelpText("Disables all but one CPU core.");
}
void
arch_smp_init(void)
{
// One cpu for now.
}

View File

@ -0,0 +1,16 @@
/*
* Copyright 2019-2020 Haiku, Inc. All rights reserved.
* Released under the terms of the MIT License.
*/
#include <boot/platform.h>
#include <boot/stage2.h>
#include <boot/stdio.h>
void
arch_start_kernel(addr_t kernelEntry)
{
// Kernel Entry!
}