u-boot/arm: Initial steps to drop target board requirements

This commit is contained in:
Alexander von Gluck IV 2017-07-09 22:51:50 -05:00
parent 855fc5a0d3
commit e40cea64bd
10 changed files with 22 additions and 70 deletions

View File

@ -233,48 +233,8 @@ rule KernelArchitectureSetup architecture
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
case arm :
switch $(HAIKU_BOOT_BOARD) {
case beagleboard :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case beaglebone :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case neo_freerunner :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case overo :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case rpi2 :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case cubieboard4 :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case verdex :
{
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
}
case * :
{
Exit "Set HAIKU_BOOT_BOARD for your target ARM device!" ;
}
}
HAIKU_BOOT_PLATFORM ?= u-boot ;
HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
# offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
@ -376,6 +336,13 @@ rule KernelArchitectureSetup architecture
}
switch $(cpu) {
case arm :
# Workaround for ld using 32k for alignment despite forcing it in the config...
# should definitely not be needed!
HAIKU_KERNEL_LINKFLAGS +=
-Wl,-z -Wl,max-page-size=0x1000
-Wl,-z -Wl,common-page-size=0x1000 ;
case ppc :
# Build a position independent PPC kernel. We need to be able to
# relocate the kernel, since the virtual address space layout at

View File

@ -3,7 +3,6 @@ SubDir HAIKU_TOP src system boot arch arm ;
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
#XXX: should not be needed here
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
UseLibraryHeaders [ FDirName libfdt ] ;
{

View File

@ -17,8 +17,6 @@
#include <arm_mmu.h>
#include <kernel.h>
#include <board_config.h>
#include <OS.h>
#include <string.h>
@ -88,13 +86,16 @@ struct memblock {
};
#warning TODO: Plot pref. base from fdt!
static struct memblock LOADER_MEMORYMAP[] = {
/*
{
"devices",
DEVICE_BASE,
DEVICE_BASE + DEVICE_SIZE - 1,
ARM_MMU_L2_FLAG_B,
},
*/
{
"RAM_kernel", // 8MB space for kernel, drivers etc
KERNEL_LOAD_BASE,
@ -112,7 +113,6 @@ static struct memblock LOADER_MEMORYMAP[] = {
#endif
};
//static const uint32 kDefaultPageTableFlags = MMU_FLAG_READWRITE;
// not cached not buffered, R/W

View File

@ -7,7 +7,6 @@ UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
SubDirC++Flags -fno-rtti ;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2012-2015 Haiku, Inc. All rights reserved.
* Copyright 2012-2016 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
@ -9,8 +9,6 @@
#include "arch_mailbox.h"
#include <board_config.h>
#include "fdt_support.h"
ArchMailbox *gMailbox = NULL;
@ -19,12 +17,11 @@ extern void* gFDT;
extern "C" status_t
arch_mailbox_init()
{
#if defined(BOARD_CPU_BCM2835) || defined(BOARD_CPU_BCM2836)
extern ArchMailbox *arch_get_mailbox_arm_bcm2835(addr_t base);
phys_addr_t mboxBase = fdt_get_device_reg_byname(gFDT, "/axi/mbox");
if (mboxBase) {
gMailbox = arch_get_mailbox_arm_bcm2835(mboxBase);
if (!mboxBase) {
return B_ERROR;
}
#endif
gMailbox = arch_get_mailbox_arm_bcm2835(mboxBase);
return B_OK;
}

View File

@ -4,6 +4,7 @@ SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ;
UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
UseLibraryHeaders [ FDirName libfdt ] ;

View File

@ -19,7 +19,6 @@
#include <arch/arm/arch_uart_pl011.h>
#endif
#include <board_config.h>
#include <boot/platform.h>
#include <arch/cpu.h>
#include <boot/stage2.h>
@ -124,17 +123,8 @@ serial_init(const void *fdt)
// first try with hints from the FDT
gUART = debug_uart_from_fdt(fdt);
// fallback to known board UARTs
#if defined(BOARD_UART_DEBUG) && defined(BOARD_UART_CLOCK)
if (gUART == NULL) {
#ifdef BOARD_UART_PL011
gUART = arch_get_uart_pl011(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
#else
gUART = arch_get_uart_8250(BOARD_UART_DEBUG, BOARD_UART_CLOCK);
#endif
}
#endif
// Do we can some kind of direct fallback here
// (aka, guess arch_get_uart_pl011 or arch_get_uart_8250?)
if (gUART == NULL)
return;

View File

@ -20,7 +20,6 @@
#include <arch/cpu.h>
#include <platform_arch.h>
#include <platform/openfirmware/openfirmware.h>
#include <board_config.h>
#include <string.h>

View File

@ -14,7 +14,6 @@
#include <boot/platform/generic/video.h>
#include <util/list.h>
#include <drivers/driver_settings.h>
#include <board_config.h>
#include <stdio.h>
#include <stdlib.h>
@ -104,6 +103,8 @@ platform_switch_to_text_mode(void)
extern "C" status_t
platform_init_video(void)
{
#warning TODO: Fix u-boot arm framebuffer location from fdt!
#ifdef __ARM__
#if defined(BOARD_CPU_ARM920T)
extern ArchFramebuffer *arch_get_fb_arm_920(addr_t base);

View File

@ -9,7 +9,6 @@
#include <arch/arm/reg.h>
#include <arch/generic/debug_uart_8250.h>
#include <board_config.h>
#include <debug.h>
#include <new>
@ -42,7 +41,7 @@ void
ArchUART8250::InitEarly()
{
// Perform special hardware UART configuration
#warning TODO: Detect OMAP3 from fdt!
#if BOARD_CPU_OMAP3
/* UART1 */
RMWREG32(CM_FCLKEN1_CORE, 13, 1, 1);