From 399a61de4a23f1f75f85ed070bff2d7d70a710cc Mon Sep 17 00:00:00 2001 From: schulz Date: Mon, 30 Mar 2015 17:26:08 +0000 Subject: [PATCH] Query VideoCore for VMEM (needed for further MMU mapping) git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@50260 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/arm-raspi/boot/boot.c | 31 +++++++++++++++++++++++++++++++ compiler/include/aros/kernel.h | 4 +++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/arch/arm-raspi/boot/boot.c b/arch/arm-raspi/boot/boot.c index 69a690a89b..4d9e626bdc 100644 --- a/arch/arm-raspi/boot/boot.c +++ b/arch/arm-raspi/boot/boot.c @@ -15,6 +15,7 @@ #include #include +#include #include "boot.h" #include "serialdebug.h" @@ -22,6 +23,7 @@ #include "atags.h" #include "elf.h" +#include "vc_mb.h" #include "vc_fb.h" #define DBOOT(x) x @@ -134,6 +136,34 @@ static void parse_atags(struct tag *tags) } } +void query_vmem() +{ + volatile unsigned int *vc_msg = (unsigned int *) MESSAGE_BUFFER; + + kprintf("[BOOT] Query VC memory\n"); + vc_msg[0] = 8 * 4; + vc_msg[1] = VCTAG_REQ; + vc_msg[2] = VCTAG_GETVCRAM; + vc_msg[3] = 8; + vc_msg[4] = 0; + vc_msg[5] = 0; + vc_msg[6] = 0; + vc_msg[7] = 0; + + vcmb_write(VCMB_BASE, VCMB_PROPCHAN, vc_msg); + vc_msg = vcmb_read(VCMB_BASE, VCMB_PROPCHAN); + + kprintf("[BOOT] Base = %08x, Size = %08x\n", vc_msg[5], vc_msg[6]); + + boottag->ti_Tag = KRN_VMEMLower; + boottag->ti_Data = vc_msg[5]; + boottag++; + + boottag->ti_Tag = KRN_VMEMUpper; + boottag->ti_Data = vc_msg[5] + vc_msg[6]; + boottag++; +} + static const char bootstrapName[] = "Bootstrap/RasPI ARM"; void boot(uintptr_t dummy, uintptr_t arch, struct tag * atags) @@ -245,6 +275,7 @@ void boot(uintptr_t dummy, uintptr_t arch, struct tag * atags) }) parse_atags(atags); + query_vmem(); kprintf("[BOOT] Bootstrap @ %08x-%08x\n", &__bootstrap_start, &__bootstrap_end); diff --git a/compiler/include/aros/kernel.h b/compiler/include/aros/kernel.h index 35648a5e55..1c1172f05b 100644 --- a/compiler/include/aros/kernel.h +++ b/compiler/include/aros/kernel.h @@ -2,7 +2,7 @@ #define AROS_KERNEL_H /* - Copyright © 1995-2011, The AROS Development Team. All rights reserved. + Copyright � 1995-2011, The AROS Development Team. All rights reserved. $Id$ Desc: TagItems for the kernel.resource @@ -58,6 +58,8 @@ typedef enum #define KRN_EFISystemTable (KRN_Dummy + 23) /* Pointer to EFI system table */ #define KRN_KernelStackBase (KRN_Dummy + 26) /* Kickstart Boot Task stack base address */ #define KRN_KernelStackSize (KRN_Dummy + 27) /* Kickstart Boot Task stack size */ +#define KRN_VMEMLower (KRN_Dummy + 28) /* Lowest address of framebuffer, e.g. on embedded systems */ +#define KRN_VMEMUpper (KRN_Dummy + 29) /* Highest address of framebuffer, e.g. on embedded systems */ /* Magic value passed by the bootstrap as second parameter */ #define AROS_BOOT_MAGIC AROS_MAKE_ID('A', 'R', 'O', 'S') -- 2.11.4.GIT