Ticket #5368: haiku-beagle-2.diff

File haiku-beagle-2.diff, 5.8 KB (added by notzed, 9 years ago)

fixes the boot block and retains precious spaces

  • build/jam/board/beagle/BoardSetup

     
     1# BeagleBoard board-specific definitions
     2
     3HAIKU_BOARD_DESCRIPTION = "BeagleBoard" ;
     4
     5
     6#
     7# Various hardcoded addresses
     8#
     9
     10# load address for haiku_loader
     11HAIKU_BOARD_LOADER_BASE = 0x80008000 ;
     12# entry points (raw binary, and netbsd loader emulation)
     13HAIKU_BOARD_LOADER_ENTRY_RAW = 0x80008000 ;
     14HAIKU_BOARD_LOADER_ENTRY_NBSD = 0x80008008 ;
     15
     16# load address for haiku_loader uimage
     17# (must be different than real load address)
     18HAIKU_BOARD_LOADER_UIBASE = 0x84000000 ;
     19
     20HAIKU_BOARD_LOADER_STACK_BASE = 0x84000000 ;
     21
     22#
     23# Flash image
     24#
     25
     26# OMAP x-loader image, must be first file on FAT partition
     27HAIKU_BOARD_MLO_IMAGE ?= MLO ;
     28HAIKU_BOARD_MLO_IMAGE_URL =
     29    http://www.angstrom-distribution.org/demo/beagleboard/MLO ;
     30
     31# u-boot binary image filename, to build the flash image
     32# XXX: Locate it somehow (for now just put it in generated/)
     33HAIKU_BOARD_UBOOT_IMAGE ?= u-boot.bin ;
     34HAIKU_BOARD_UBOOT_IMAGE_URL =
     35    http://www.angstrom-distribution.org/demo/beagleboard/u-boot.bin ;
     36
     37#
     38# mmc/SD image
     39#
     40
     41# in MB
     42HAIKU_BOARD_SDIMAGE_SIZE = 64 ;
     43
     44# in MB
     45HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ;
     46
     47# offset in blocks XXX: FIXME
     48# (autodetect from sfdisk or use cylinder count for fat size)
     49HAIKU_BOARD_SDIMAGE_BFS_OFFSET = ;
     50
     51HAIKU_BOARD_SDIMAGE_FILES =
     52    $(HAIKU_BOARD_MLO_IMAGE)
     53    $(HAIKU_BOARD_UBOOT_IMAGE)
     54    haiku_loader_nbsd.ub
     55;
     56
     57
     58#
     59# gcc flags for the specific cpu
     60#
     61
     62TARGET_KERNEL_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     63TARGET_KERNEL_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     64TARGET_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     65TARGET_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     66
     67
  • src/system/boot/platform/u-boot/mmu.cpp

     
    1717#include <arm_mmu.h>
    1818#include <kernel.h>
    1919
     20#include <board_config.h>
     21
    2022#include <OS.h>
    2123
    2224#include <string.h>
     
    99101
    100102
    101103//memory used by the loader that should be identity mapped
    102 /*
     104#ifdef BOARD_CPU_OMAP3
     105
    103106static struct memblock LOADER_MEMORYMAP[] = {
    104107        {
    105                 "vectors\0",//interrupt vectors
    106         0x00000000,
    107         0x00000fff,
     108                "RAM_internal\0",//internal ram/interrupt vectors
     109        0x40200000,
     110        0x4020ffff,
    108111        MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_B,
    109112        },
    110113        {
    111114                "devices\0",
    112115        0x48000000,
    113         0x48FFFFFF,
    114         MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_B,
     116        0x490FFFFF,
     117        MMU_L2_FLAG_AP_RW, //|MMU_L2_FLAG_B,
    115118        },
     119    // TODO: also sgx, dsp and whatnot
    116120        {
    117121                "RAM_image\0",//15MB for the initrd should be enough..
    118122        0x80000000,
     
    138142        MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_C,
    139143        },
    140144
     145
     146        {
     147                "RAM_fb\0",//2MB framebuffer ram
     148        0x88000000,
     149        0x88200000,
     150        MMU_L2_FLAG_AP_RW|MMU_L2_FLAG_C,
     151        },
     152
     153
    141154};
    142 */
     155
     156#else
     157
    143158static struct memblock LOADER_MEMORYMAP[] = {
    144159        {
    145160                "vectors\0",//interrupt vectors
     
    191206        },
    192207
    193208};
     209#endif
    194210
    195211
    196212
     
    350366void
    351367init_page_directory()
    352368{
     369    uint32 smalltype;
     370
     371    // see if subpages disabled
     372    if (mmu_read_C1() & (1<<23))
     373        smalltype = MMU_L2_TYPE_SMALLNEW;
     374    else
     375        smalltype = MMU_L2_TYPE_SMALLEXT;
     376
    353377        TRACE(("init_page_directory\n"));
    354378
    355379        gKernelArgs.arch_args.phys_pgdir = (uint32)sPageDirectory;
     
    368392        addr_t pos = LOADER_MEMORYMAP[i].start;
    369393        int c=0;
    370394        while(pos< LOADER_MEMORYMAP[i].end){
    371             pageTable[c]=pos |  LOADER_MEMORYMAP[i].flags | MMU_L2_TYPE_SMALLEXT;
     395            pageTable[c]=pos |  LOADER_MEMORYMAP[i].flags | smalltype;
    372396//          TRACE(("PAGE TABLE: %lx = [%lx] \n",c, pageTable[c]));             
    373397            c++;
    374398            if(c>255){ //we filled a pagetable => we need a new one
  • src/system/boot/platform/u-boot/Jamfile

     
    196197        $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT) ;
    197198}
    198199
     200if $(HAIKU_BOARD_MLO_IMAGE) && $(HAIKU_BOARD_MLO_IMAGE_URL) {
     201    DownloadFile $(HAIKU_BOARD_MLO_IMAGE) $(HAIKU_BOARD_MLO_IMAGE_URL) ;
     202}
     203
    199204if $(HAIKU_BOARD_UBOOT_IMAGE) && $(HAIKU_BOARD_UBOOT_IMAGE_URL) {
    200205    # Download the u-boot binary file.
    201206    DownloadFile $(HAIKU_BOARD_UBOOT_IMAGE) $(HAIKU_BOARD_UBOOT_IMAGE_URL) ;
  • headers/private/kernel/arch/arm/arm_mmu.h

     
    3737 */
    3838
    3939#define MMU_L2_TYPE_SMALLEXT 0x3
     40/* for new format entries (cortex-a8) */
     41#define MMU_L2_TYPE_SMALLNEW 0x2
     42
    4043// for B C and TEX see ARM arm B4-11
    4144#define MMU_L2_FLAG_B 0x4
    4245#define MMU_L2_FLAG_C 0x8
  • headers/private/kernel/arch/arm/board/beagle/board_config.h

     
     1/*
     2 * Copyright 2009
     3 * Distributed under the terms of the MIT License.
     4 */
     5#ifndef _BOARD_OVERO_BOARD_CONFIG_H
     6#define _BOARD_OVERO_BOARD_CONFIG_H
     7
     8#define BOARD_NAME_PRETTY "Beagle Board"
     9
     10#define BOARD_CPU_TYPE_OMAP 1
     11#define BOARD_CPU_OMAP3 1
     12
     13#include <arch/arm/omap3.h>
     14
     15#define BOARD_UART1_BASE OMAP_UART1_BASE
     16#define BOARD_UART2_BASE OMAP_UART2_BASE
     17#define BOARD_UART3_BASE OMAP_UART3_BASE
     18
     19#define BOARD_DEBUG_UART 2
     20
     21#endif /* _BOARD_OVERO_BOARD_CONFIG_H */