hrev48867 adds 1 changeset to branch 'master' old head: 7ddf9bcf0df22da3c26edae53190c8dbd6feb7c0 new head: 5906dbb4d4656919daaf375510132107b0af6a8a overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=5906dbb4d465+%5E7ddf9bcf0df2 ---------------------------------------------------------------------------- 5906dbb4d465: platform/u-boot: Work towards using arm mailbox driver * Reference bcm2708 framebuffer when it makes sense * Add bcm2708 define to Raspberry Pi board_config.h [ Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev48867 Commit: 5906dbb4d4656919daaf375510132107b0af6a8a URL: http://cgit.haiku-os.org/haiku/commit/?id=5906dbb4d465 Author: Alexander von Gluck IV <kallisti5@xxxxxxxxxxx> Date: Fri Mar 6 13:47:32 2015 UTC ---------------------------------------------------------------------------- 5 files changed, 44 insertions(+), 1 deletion(-) .../arch/arm/board/raspberry_pi/board_config.h | 3 ++- src/system/boot/platform/u-boot/arch/arm/Jamfile | 4 +++ .../platform/u-boot/arch/arm/arch_mailbox.cpp | 27 ++++++++++++++++++++ src/system/boot/platform/u-boot/start.cpp | 7 +++++ src/system/boot/platform/u-boot/video.cpp | 4 +++ ---------------------------------------------------------------------------- diff --git a/headers/private/kernel/arch/arm/board/raspberry_pi/board_config.h b/headers/private/kernel/arch/arm/board/raspberry_pi/board_config.h index 789ca49..39d05ce 100644 --- a/headers/private/kernel/arch/arm/board/raspberry_pi/board_config.h +++ b/headers/private/kernel/arch/arm/board/raspberry_pi/board_config.h @@ -11,7 +11,8 @@ #define BOARD_NAME_PRETTY "Raspberry Pi" -#define BOARD_CPU_ARM6 1 +#define BOARD_CPU_TYPE_ARM6 1 +#define BOARD_CPU_BCM2708 1 #include <arch/arm/bcm2708.h> diff --git a/src/system/boot/platform/u-boot/arch/arm/Jamfile b/src/system/boot/platform/u-boot/arch/arm/Jamfile index d5221ac..620056b 100644 --- a/src/system/boot/platform/u-boot/arch/arm/Jamfile +++ b/src/system/boot/platform/u-boot/arch/arm/Jamfile @@ -1,6 +1,8 @@ SubDir HAIKU_TOP src system boot platform u-boot arch arm ; SubDirHdrs $(HAIKU_TOP) src system boot platform $(TARGET_BOOT_PLATFORM) ; +SubDirHdrs $(HAIKU_TOP) src system boot arch $(TARGET_KERNEL_ARCH) ; + UsePrivateSystemHeaders ; UsePrivateHeaders kernel [ FDirName kernel arch $(TARGET_KERNEL_ARCH) ] [ FDirName kernel boot platform $(HAIKU_BOOT_PLATFORM) ] ; @@ -11,6 +13,8 @@ SubDirC++Flags -fno-rtti ; BootMergeObject boot_platform_u-boot_arm.o : # must come first to have _start_* at correct locations shell.S + + arch_mailbox.cpp : -fno-pic ; diff --git a/src/system/boot/platform/u-boot/arch/arm/arch_mailbox.cpp b/src/system/boot/platform/u-boot/arch/arm/arch_mailbox.cpp new file mode 100644 index 0000000..b796a78 --- /dev/null +++ b/src/system/boot/platform/u-boot/arch/arm/arch_mailbox.cpp @@ -0,0 +1,27 @@ +/* + * Copyright 2012-2015 Haiku, Inc. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexander von Gluck IV, kallisti5@xxxxxxxxxxx + */ + + +#include "arch_mailbox.h" + +#include <board_config.h> + + +ArchMailbox *gMailbox = NULL; + + +extern "C" status_t +arch_mailbox_init() +{ + #if defined(BOARD_CPU_BCM2708) + extern ArchMailbox *arch_get_mailbox_arm_bcm2708(addr_t base); + #warning ARM: Add gPeripheralBase to ARM_CTRL_0_MAILBOX_BASE + gMailbox = arch_get_mailbox_arm_bcm2708(ARM_CTRL_0_MAILBOX_BASE); + #endif + return B_OK; +} diff --git a/src/system/boot/platform/u-boot/start.cpp b/src/system/boot/platform/u-boot/start.cpp index e23cfb3..b9faf9f 100644 --- a/src/system/boot/platform/u-boot/start.cpp +++ b/src/system/boot/platform/u-boot/start.cpp @@ -60,6 +60,10 @@ extern "C" int start_gen(int argc, const char **argv, struct image_header *uimage=NULL, void *fdt=NULL); extern "C" void dump_uimage(struct image_header *image); extern "C" void dump_fdt(const void *fdt); +#if defined(__ARM__) +extern "C" status_t arch_mailbox_init(); +#endif + // declared in shell.S // those are initialized to NULL but not in the BSS @@ -210,6 +214,9 @@ start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt) gFDT = args.platform.fdt_data; } + #if defined(__ARM__) + arch_mailbox_init(); + #endif serial_init(gFDT); console_init(); // initialize the OpenFirmware wrapper diff --git a/src/system/boot/platform/u-boot/video.cpp b/src/system/boot/platform/u-boot/video.cpp index 72f9416..1ea111b 100644 --- a/src/system/boot/platform/u-boot/video.cpp +++ b/src/system/boot/platform/u-boot/video.cpp @@ -108,6 +108,10 @@ platform_init_video(void) #if defined(BOARD_CPU_ARM920T) extern ArchFramebuffer *arch_get_fb_arm_920(addr_t base); gFramebuffer = arch_get_fb_arm_920(0x88000000); + #elif defined(BOARD_CPU_BCM2708) + extern ArchFramebuffer *arch_get_fb_arm_bcm2708(addr_t base); + // BCM2708 gets its framebuffer base from a Mailbox + gFramebuffer = arch_get_fb_arm_bcm2708(0x0); #elif defined(BOARD_CPU_OMAP3) extern ArchFramebuffer *arch_get_fb_arm_omap3(addr_t base); gFramebuffer = arch_get_fb_arm_omap3(FB_BASE);