Patch by "notzed" (ticket #5368) (modified): Add bootloader support for BeagleBoard.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,67 @@
|
|||||||
|
# BeagleBoard board-specific definitions
|
||||||
|
|
||||||
|
HAIKU_BOARD_DESCRIPTION = "BeagleBoard" ;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Various hardcoded addresses
|
||||||
|
#
|
||||||
|
|
||||||
|
# load address for haiku_loader
|
||||||
|
HAIKU_BOARD_LOADER_BASE = 0x80008000 ;
|
||||||
|
# entry points (raw binary, and netbsd loader emulation)
|
||||||
|
HAIKU_BOARD_LOADER_ENTRY_RAW = 0x80008000 ;
|
||||||
|
HAIKU_BOARD_LOADER_ENTRY_NBSD = 0x80008008 ;
|
||||||
|
|
||||||
|
# load address for haiku_loader uimage
|
||||||
|
# (must be different than real load address)
|
||||||
|
HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ;
|
||||||
|
|
||||||
|
HAIKU_BOARD_LOADER_STACK_BASE = 0x84000000 ;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Flash image
|
||||||
|
#
|
||||||
|
|
||||||
|
# OMAP x-loader image, must be first file on FAT partition
|
||||||
|
HAIKU_BOARD_MLO_IMAGE ?= MLO ;
|
||||||
|
HAIKU_BOARD_MLO_IMAGE_URL =
|
||||||
|
http://www.angstrom-distribution.org/demo/beagleboard/MLO ;
|
||||||
|
|
||||||
|
# u-boot binary image filename, to build the flash image
|
||||||
|
# XXX: Locate it somehow (for now just put it in generated/)
|
||||||
|
HAIKU_BOARD_UBOOT_IMAGE ?= u-boot.bin ;
|
||||||
|
HAIKU_BOARD_UBOOT_IMAGE_URL =
|
||||||
|
http://www.angstrom-distribution.org/demo/beagleboard/u-boot.bin ;
|
||||||
|
|
||||||
|
#
|
||||||
|
# mmc/SD image
|
||||||
|
#
|
||||||
|
|
||||||
|
# in MB
|
||||||
|
HAIKU_BOARD_SDIMAGE_SIZE = 64 ;
|
||||||
|
|
||||||
|
# in MB
|
||||||
|
HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ;
|
||||||
|
|
||||||
|
# offset in blocks XXX: FIXME
|
||||||
|
# (autodetect from sfdisk or use cylinder count for fat size)
|
||||||
|
HAIKU_BOARD_SDIMAGE_BFS_OFFSET = ;
|
||||||
|
|
||||||
|
HAIKU_BOARD_SDIMAGE_FILES =
|
||||||
|
$(HAIKU_BOARD_MLO_IMAGE)
|
||||||
|
$(HAIKU_BOARD_UBOOT_IMAGE)
|
||||||
|
haiku_loader_nbsd.ub
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# gcc flags for the specific cpu
|
||||||
|
#
|
||||||
|
|
||||||
|
TARGET_KERNEL_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
|
||||||
|
TARGET_KERNEL_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
|
||||||
|
TARGET_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
|
||||||
|
TARGET_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
|
||||||
|
|
||||||
|
|
||||||
@@ -37,6 +37,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#define MMU_L2_TYPE_SMALLEXT 0x3
|
#define MMU_L2_TYPE_SMALLEXT 0x3
|
||||||
|
/* for new format entries (cortex-a8) */
|
||||||
|
#define MMU_L2_TYPE_SMALLNEW 0x2
|
||||||
|
|
||||||
// for B C and TEX see ARM arm B4-11
|
// for B C and TEX see ARM arm B4-11
|
||||||
#define MMU_L2_FLAG_B 0x4
|
#define MMU_L2_FLAG_B 0x4
|
||||||
#define MMU_L2_FLAG_C 0x8
|
#define MMU_L2_FLAG_C 0x8
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2009
|
||||||
|
* Distributed under the terms of the MIT License.
|
||||||
|
*/
|
||||||
|
#ifndef _BOARD_OVERO_BOARD_CONFIG_H
|
||||||
|
#define _BOARD_OVERO_BOARD_CONFIG_H
|
||||||
|
|
||||||
|
#define BOARD_NAME_PRETTY "Beagle Board"
|
||||||
|
|
||||||
|
#define BOARD_CPU_TYPE_OMAP 1
|
||||||
|
#define BOARD_CPU_OMAP3 1
|
||||||
|
|
||||||
|
#include <arch/arm/omap3.h>
|
||||||
|
|
||||||
|
#define BOARD_UART1_BASE OMAP_UART1_BASE
|
||||||
|
#define BOARD_UART2_BASE OMAP_UART2_BASE
|
||||||
|
#define BOARD_UART3_BASE OMAP_UART3_BASE
|
||||||
|
|
||||||
|
#define BOARD_DEBUG_UART 2
|
||||||
|
|
||||||
|
#endif /* _BOARD_OVERO_BOARD_CONFIG_H */
|
||||||
@@ -198,6 +198,10 @@ if $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME) {
|
|||||||
$(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT) ;
|
$(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $(HAIKU_BOARD_MLO_IMAGE) && $(HAIKU_BOARD_MLO_IMAGE_URL) {
|
||||||
|
DownloadFile $(HAIKU_BOARD_MLO_IMAGE) $(HAIKU_BOARD_MLO_IMAGE_URL) ;
|
||||||
|
}
|
||||||
|
|
||||||
if $(HAIKU_BOARD_UBOOT_IMAGE) && $(HAIKU_BOARD_UBOOT_IMAGE_URL) {
|
if $(HAIKU_BOARD_UBOOT_IMAGE) && $(HAIKU_BOARD_UBOOT_IMAGE_URL) {
|
||||||
# Download the u-boot binary file.
|
# Download the u-boot binary file.
|
||||||
ubootFile = [ DownloadFile $(HAIKU_BOARD_UBOOT_IMAGE)
|
ubootFile = [ DownloadFile $(HAIKU_BOARD_UBOOT_IMAGE)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#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>
|
||||||
@@ -99,7 +101,7 @@ static struct memblock MEMORYMAP[] = {
|
|||||||
|
|
||||||
|
|
||||||
//memory used by the loader that should be identity mapped
|
//memory used by the loader that should be identity mapped
|
||||||
/*
|
#if 0/*BOARD_CPU_OMAP3*/
|
||||||
static struct memblock LOADER_MEMORYMAP[] = {
|
static struct memblock LOADER_MEMORYMAP[] = {
|
||||||
{
|
{
|
||||||
"vectors",//interrupt vectors
|
"vectors",//interrupt vectors
|
||||||
@@ -138,27 +140,25 @@ static struct memblock LOADER_MEMORYMAP[] = {
|
|||||||
MMU_L2_FLAG_AP_RW | MMU_L2_FLAG_C,
|
MMU_L2_FLAG_AP_RW | MMU_L2_FLAG_C,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
#else
|
||||||
|
|
||||||
static struct memblock LOADER_MEMORYMAP[] = {
|
static struct memblock LOADER_MEMORYMAP[] = {
|
||||||
{
|
{
|
||||||
"vectors",//interrupt vectors
|
"vectors",//interrupt vectors
|
||||||
0x00000000,
|
VECT_BASE,
|
||||||
0x00000fff,
|
VECT_BASE + VECT_SIZE - 1,
|
||||||
MMU_L2_FLAG_B,
|
MMU_L2_FLAG_B,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"devices",
|
"devices",
|
||||||
0x40000000,
|
DEVICE_BASE,
|
||||||
0x44FFFFFF,
|
DEVICE_BASE + DEVICE_SIZE - 1,
|
||||||
MMU_L2_FLAG_B,
|
MMU_L2_FLAG_B,
|
||||||
},
|
},
|
||||||
/* {
|
|
||||||
"RAM_image",//15MB for the initrd should be enough..
|
|
||||||
0xA0000000,
|
|
||||||
0xA1ffffff,
|
|
||||||
MMU_L2_FLAG_C,
|
|
||||||
},*/
|
|
||||||
{
|
{
|
||||||
"RAM_loader",//1MB loader
|
"RAM_loader",//1MB loader
|
||||||
SDRAM_BASE + 0,
|
SDRAM_BASE + 0,
|
||||||
@@ -190,7 +190,18 @@ static struct memblock LOADER_MEMORYMAP[] = {
|
|||||||
MMU_L2_FLAG_C,
|
MMU_L2_FLAG_C,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
#ifdef FB_BASE
|
||||||
|
{
|
||||||
|
"framebuffer",//2MB framebuffer ram
|
||||||
|
FB_BASE,
|
||||||
|
FB_BASE + FB_SIZE - 1,
|
||||||
|
MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_C,
|
||||||
|
},
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -350,6 +361,14 @@ get_next_page_table(uint32 type)
|
|||||||
void
|
void
|
||||||
init_page_directory()
|
init_page_directory()
|
||||||
{
|
{
|
||||||
|
uint32 smalltype;
|
||||||
|
|
||||||
|
// see if subpages disabled
|
||||||
|
if (mmu_read_C1() & (1<<23))
|
||||||
|
smalltype = MMU_L2_TYPE_SMALLNEW;
|
||||||
|
else
|
||||||
|
smalltype = MMU_L2_TYPE_SMALLEXT;
|
||||||
|
|
||||||
TRACE(("init_page_directory\n"));
|
TRACE(("init_page_directory\n"));
|
||||||
|
|
||||||
gKernelArgs.arch_args.phys_pgdir = (uint32)sPageDirectory;
|
gKernelArgs.arch_args.phys_pgdir = (uint32)sPageDirectory;
|
||||||
@@ -368,7 +387,7 @@ init_page_directory()
|
|||||||
addr_t pos = LOADER_MEMORYMAP[i].start;
|
addr_t pos = LOADER_MEMORYMAP[i].start;
|
||||||
int c=0;
|
int c=0;
|
||||||
while(pos< LOADER_MEMORYMAP[i].end){
|
while(pos< LOADER_MEMORYMAP[i].end){
|
||||||
pageTable[c]=pos | LOADER_MEMORYMAP[i].flags | MMU_L2_TYPE_SMALLEXT;
|
pageTable[c]=pos | LOADER_MEMORYMAP[i].flags | smalltype;
|
||||||
// TRACE(("PAGE TABLE: %lx = [%lx] \n",c, pageTable[c]));
|
// TRACE(("PAGE TABLE: %lx = [%lx] \n",c, pageTable[c]));
|
||||||
c++;
|
c++;
|
||||||
if(c>255){ //we filled a pagetable => we need a new one
|
if(c>255){ //we filled a pagetable => we need a new one
|
||||||
|
|||||||
Reference in New Issue
Block a user