Ticket #5368: arm-beagle.diff

File arm-beagle.diff, 6.3 KB (added by notzed, 14 years ago)
  • 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# u-boot binary image filename, to build the flash image
     27# XXX: Locate it somehow (for now just put it in generated/)
     28HAIKU_BOARD_UBOOT_IMAGE ?= u-boot.bin ;
     29HAIKU_BOARD_UBOOT_IMAGE_URL =
     30    http://www.angstrom-distribution.org/demo/beagleboard/u-boot.bin ;
     31
     32#
     33# mmc/SD image
     34#
     35
     36# in MB
     37HAIKU_BOARD_SDIMAGE_SIZE = 64 ;
     38
     39# in MB
     40HAIKU_BOARD_SDIMAGE_FAT_SIZE = 32 ;
     41
     42# offset in blocks XXX: FIXME
     43# (autodetect from sfdisk or use cylinder count for fat size)
     44HAIKU_BOARD_SDIMAGE_BFS_OFFSET = ;
     45
     46# autoboot script
     47HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME = beagle-factory.script ;
     48HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT = "\
     49setenv bootargs debug_screen true; \
     50if mmc init; then \
     51    fatload mmc 0 $(HAIKU_BOARD_LOADER_UIBASE) haiku_loader.ub; \
     52    bootm $(HAIKU_BOARD_LOADER_UIBASE); \
     53fi" ;
     54
     55HAIKU_BOARD_SDIMAGE_FILES =
     56    haiku_loader
     57    haiku_loader.ub
     58    haiku_loader_nbsd.ub
     59    $(HAIKU_BOARD_SDIMAGE_UBOOT_SCRIPT_NAME)
     60;
     61
     62
     63#
     64# gcc flags for the specific cpu
     65#
     66
     67TARGET_KERNEL_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     68TARGET_KERNEL_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     69TARGET_CCFLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     70TARGET_C++FLAGS += -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=soft ;
     71
     72
  • 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
     
    200216
    201217
    202218
    203 
    204219//static const uint32 kDefaultPageTableFlags = MMU_FLAG_READWRITE;  // not cached not buffered, R/W
    205220static const size_t kMaxKernelSize = 0x200000;      // 2 MB for the kernel
    206221
     
    322337    asm volatile("MCR p15, 0, %[c1in], c3, c0, 0"::[c1in] "r" (value));
    323338}
    324339
    325 
    326340static uint32 *
    327341get_next_page_table(uint32 type)
    328342{
     
    350364void
    351365init_page_directory()
    352366{
     367    uint32 smalltype;
     368
     369    // see if subpages disabled
     370    if (mmu_read_C1() & (1<<23))
     371        smalltype = MMU_L2_TYPE_SMALLNEW;
     372    else
     373        smalltype = MMU_L2_TYPE_SMALLEXT;
     374
    353375        TRACE(("init_page_directory\n"));
    354376
    355377        gKernelArgs.arch_args.phys_pgdir = (uint32)sPageDirectory;
     
    368390        addr_t pos = LOADER_MEMORYMAP[i].start;
    369391        int c=0;
    370392        while(pos< LOADER_MEMORYMAP[i].end){
    371             pageTable[c]=pos |  LOADER_MEMORYMAP[i].flags | MMU_L2_TYPE_SMALLEXT;
     393            pageTable[c]=pos |  LOADER_MEMORYMAP[i].flags | smalltype;
    372394//          TRACE(("PAGE TABLE: %lx = [%lx] \n",c, pageTable[c]));             
    373395            c++;
    374396            if(c>255){ //we filled a pagetable => we need a new one
  • src/system/boot/platform/u-boot/video.cpp

     
    8888        return;
    8989
    9090    //XXX: not yet, DISABLED
    91     return;
     91    //return;
    9292
    9393    status_t err;
    9494
     
    118118        #warning ARM:TODO
    119119    arch_probe_video_mode();
    120120    //XXX for testing
    121     //platform_switch_to_logo();
     121    platform_switch_to_logo();
    122122    //return arch_probe_video_mode();
    123     //return B_OK;
     123    return B_OK;
    124124}
    125125
  • 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 */