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
+9 -42
View File
@@ -233,48 +233,8 @@ rule KernelArchitectureSetup architecture
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
case arm : case arm :
switch $(HAIKU_BOOT_BOARD) { HAIKU_BOOT_PLATFORM ?= u-boot ;
case beagleboard : HAIKU_BOOT_FLOPPY_IMAGE_SIZE = 1440 ;
{
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!" ;
}
}
# offset in floppy image (>= sizeof(haiku_loader)) # offset in floppy image (>= sizeof(haiku_loader))
HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet HAIKU_BOOT_ARCHIVE_IMAGE_OFFSET = 192 ; # in kB - unused yet
@@ -376,6 +336,13 @@ rule KernelArchitectureSetup architecture
} }
switch $(cpu) { 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 : case ppc :
# Build a position independent PPC kernel. We need to be able to # Build a position independent PPC kernel. We need to be able to
# relocate the kernel, since the virtual address space layout at # relocate the kernel, since the virtual address space layout at
-1
View File
@@ -3,7 +3,6 @@ SubDir HAIKU_TOP src system boot arch arm ;
UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ; UsePrivateHeaders [ FDirName kernel platform $(TARGET_BOOT_PLATFORM) ] ;
#XXX: should not be needed here #XXX: should not be needed here
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
UseLibraryHeaders [ FDirName libfdt ] ; UseLibraryHeaders [ FDirName libfdt ] ;
{ {
+3 -3
View File
@@ -17,8 +17,6 @@
#include <arm_mmu.h> #include <arm_mmu.h>
#include <kernel.h> #include <kernel.h>
#include <board_config.h>
#include <OS.h> #include <OS.h>
#include <string.h> #include <string.h>
@@ -88,13 +86,16 @@ struct memblock {
}; };
#warning TODO: Plot pref. base from fdt!
static struct memblock LOADER_MEMORYMAP[] = { static struct memblock LOADER_MEMORYMAP[] = {
/*
{ {
"devices", "devices",
DEVICE_BASE, DEVICE_BASE,
DEVICE_BASE + DEVICE_SIZE - 1, DEVICE_BASE + DEVICE_SIZE - 1,
ARM_MMU_L2_FLAG_B, ARM_MMU_L2_FLAG_B,
}, },
*/
{ {
"RAM_kernel", // 8MB space for kernel, drivers etc "RAM_kernel", // 8MB space for kernel, drivers etc
KERNEL_LOAD_BASE, KERNEL_LOAD_BASE,
@@ -112,7 +113,6 @@ static struct memblock LOADER_MEMORYMAP[] = {
#endif #endif
}; };
//static const uint32 kDefaultPageTableFlags = MMU_FLAG_READWRITE; //static const uint32 kDefaultPageTableFlags = MMU_FLAG_READWRITE;
// not cached not buffered, R/W // not cached not buffered, R/W
@@ -7,7 +7,6 @@ UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ; UsePrivateHeaders kernel [ FDirName kernel platform u-boot ] ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ; [ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
SubDirC++Flags -fno-rtti ; SubDirC++Flags -fno-rtti ;
@@ -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. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -9,8 +9,6 @@
#include "arch_mailbox.h" #include "arch_mailbox.h"
#include <board_config.h>
#include "fdt_support.h" #include "fdt_support.h"
ArchMailbox *gMailbox = NULL; ArchMailbox *gMailbox = NULL;
@@ -19,12 +17,11 @@ extern void* gFDT;
extern "C" status_t extern "C" status_t
arch_mailbox_init() arch_mailbox_init()
{ {
#if defined(BOARD_CPU_BCM2835) || defined(BOARD_CPU_BCM2836)
extern ArchMailbox *arch_get_mailbox_arm_bcm2835(addr_t base); extern ArchMailbox *arch_get_mailbox_arm_bcm2835(addr_t base);
phys_addr_t mboxBase = fdt_get_device_reg_byname(gFDT, "/axi/mbox"); phys_addr_t mboxBase = fdt_get_device_reg_byname(gFDT, "/axi/mbox");
if (mboxBase) { if (!mboxBase) {
gMailbox = arch_get_mailbox_arm_bcm2835(mboxBase); return B_ERROR;
} }
#endif gMailbox = arch_get_mailbox_arm_bcm2835(mboxBase);
return B_OK; return B_OK;
} }
@@ -4,6 +4,7 @@ SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ;
UsePrivateSystemHeaders ; UsePrivateSystemHeaders ;
UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ]
[ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ; [ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ;
UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ; UsePrivateHeaders [ FDirName kernel arch $(TARGET_KERNEL_ARCH) board $(TARGET_BOOT_BOARD) ] ;
UseLibraryHeaders [ FDirName libfdt ] ; UseLibraryHeaders [ FDirName libfdt ] ;
+2 -12
View File
@@ -19,7 +19,6 @@
#include <arch/arm/arch_uart_pl011.h> #include <arch/arm/arch_uart_pl011.h>
#endif #endif
#include <board_config.h>
#include <boot/platform.h> #include <boot/platform.h>
#include <arch/cpu.h> #include <arch/cpu.h>
#include <boot/stage2.h> #include <boot/stage2.h>
@@ -124,17 +123,8 @@ serial_init(const void *fdt)
// first try with hints from the FDT // first try with hints from the FDT
gUART = debug_uart_from_fdt(fdt); gUART = debug_uart_from_fdt(fdt);
// fallback to known board UARTs // Do we can some kind of direct fallback here
#if defined(BOARD_UART_DEBUG) && defined(BOARD_UART_CLOCK) // (aka, guess arch_get_uart_pl011 or arch_get_uart_8250?)
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
if (gUART == NULL) if (gUART == NULL)
return; return;
@@ -20,7 +20,6 @@
#include <arch/cpu.h> #include <arch/cpu.h>
#include <platform_arch.h> #include <platform_arch.h>
#include <platform/openfirmware/openfirmware.h> #include <platform/openfirmware/openfirmware.h>
#include <board_config.h>
#include <string.h> #include <string.h>
+2 -1
View File
@@ -14,7 +14,6 @@
#include <boot/platform/generic/video.h> #include <boot/platform/generic/video.h>
#include <util/list.h> #include <util/list.h>
#include <drivers/driver_settings.h> #include <drivers/driver_settings.h>
#include <board_config.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@@ -104,6 +103,8 @@ platform_switch_to_text_mode(void)
extern "C" status_t extern "C" status_t
platform_init_video(void) platform_init_video(void)
{ {
#warning TODO: Fix u-boot arm framebuffer location from fdt!
#ifdef __ARM__ #ifdef __ARM__
#if defined(BOARD_CPU_ARM920T) #if defined(BOARD_CPU_ARM920T)
extern ArchFramebuffer *arch_get_fb_arm_920(addr_t base); extern ArchFramebuffer *arch_get_fb_arm_920(addr_t base);
@@ -9,7 +9,6 @@
#include <arch/arm/reg.h> #include <arch/arm/reg.h>
#include <arch/generic/debug_uart_8250.h> #include <arch/generic/debug_uart_8250.h>
#include <board_config.h>
#include <debug.h> #include <debug.h>
#include <new> #include <new>
@@ -42,7 +41,7 @@ void
ArchUART8250::InitEarly() ArchUART8250::InitEarly()
{ {
// Perform special hardware UART configuration // Perform special hardware UART configuration
#warning TODO: Detect OMAP3 from fdt!
#if BOARD_CPU_OMAP3 #if BOARD_CPU_OMAP3
/* UART1 */ /* UART1 */
RMWREG32(CM_FCLKEN1_CORE, 13, 1, 1); RMWREG32(CM_FCLKEN1_CORE, 13, 1, 1);