Changeset 4d0f97d in mainline for boot/arch


Ignore:
Timestamp:
2010-07-16T14:23:41Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e2650d3
Parents:
aa0d227 (diff), 24697c3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge from lp:~jsvoboda/helenos/gta02. This adds support for the GTA02 platform. Fixes ticket #134.

Location:
boot/arch/arm32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/Makefile.inc

    raa0d227 r4d0f97d  
    2727#
    2828
     29ifeq ($(MACHINE), gta02)
     30        BOOT_OUTPUT = image.boot
     31        POST_OUTPUT = $(ROOT_PATH)/uImage.bin
     32        POSTBUILD = Makefile.uboot
     33endif
     34
    2935BFD_NAME = elf32-littlearm
    3036BFD_OUTPUT = $(BFD_NAME)
  • boot/arch/arm32/_link.ld.in

    raa0d227 r4d0f97d  
     1#include <arch/arch.h>
     2
    13ENTRY(start)
    24
    35SECTIONS {
    4         . = 0x0000;
     6        . = BOOT_BASE;
    57        .text : {
    68                *(BOOTSTRAP);
    79                *(.text);
    810        }
    9         . = 0x8000;
     11        . = BOOT_BASE + 0x8000;
    1012        .data : {
    1113                *(BOOTPT);      /* bootstrap page table */
  • boot/arch/arm32/include/arch.h

    raa0d227 r4d0f97d  
    3636#define PTL0_ENTRY_SIZE  4
    3737
    38 #define BOOT_OFFSET  0xa00000
     38/*
     39 * Address where the boot stage image starts (beginning of usable physical
     40 * memory).
     41 */
     42#ifdef MACHINE_gta02
     43#define BOOT_BASE       0x30008000
     44#else
     45#define BOOT_BASE       0x00000000
     46#endif
     47
     48#define BOOT_OFFSET     (BOOT_BASE + 0xa00000)
    3949
    4050#ifndef __ASM__
  • boot/arch/arm32/include/main.h

    raa0d227 r4d0f97d  
    11/*
    22 * Copyright (c) 2007 Michal Kebrt
     3 * Copyright (c) 2010 Jiri Svoboda
    34 * All rights reserved.
    45 *
     
    3839
    3940/** Address where characters to be printed are expected. */
    40 #ifdef MACHINE_testarm
    41         #define VIDEORAM_ADDRESS  0x10000000
    42 #endif
    4341
    44 #ifdef MACHINE_integratorcp
    45         #define VIDEORAM_ADDRESS  0x16000000
    46 #endif
     42/** GTA02 serial console UART register addresses.
     43 *
     44 * This is UART channel 2 of the S3C24xx CPU
     45 */
     46#define GTA02_SCONS_UTRSTAT     0x50008010
     47#define GTA02_SCONS_UTXH        0x50008020
     48
     49/* Bits in UTXH register */
     50#define S3C24XX_UTXH_TX_EMPTY   0x00000004
     51
     52
     53/** GXemul testarm serial console output register */
     54#define TESTARM_SCONS_ADDR      0x10000000
     55
     56/** IntegratorCP serial console output register */
     57#define ICP_SCONS_ADDR          0x16000000
    4758
    4859extern void bootstrap(void);
  • boot/arch/arm32/src/putchar.c

    raa0d227 r4d0f97d  
    22 * Copyright (c) 2007 Michal Kebrt
    33 * Copyright (c) 2009 Vineeth Pillai
     4 * Copyright (c) 2010 Jiri Svoboda
    45 * All rights reserved.
    56 *
     
    4041#include <str.h>
    4142
     43#ifdef MACHINE_gta02
     44
     45/** Send a byte to the gta02 serial console.
     46 *
     47 * @param byte          Byte to send.
     48 */
     49static void scons_sendb_gta02(uint8_t byte)
     50{
     51        volatile uint32_t *utrstat;
     52        volatile uint32_t *utxh;
     53
     54        utrstat = (volatile uint32_t *) GTA02_SCONS_UTRSTAT;
     55        utxh    = (volatile uint32_t *) GTA02_SCONS_UTXH;
     56
     57        /* Wait until transmitter is empty. */
     58        while ((*utrstat & S3C24XX_UTXH_TX_EMPTY) == 0)
     59                ;
     60
     61        /* Transmit byte. */
     62        *utxh = (uint32_t) byte;
     63}
     64
     65#endif
     66
     67#ifdef MACHINE_testarm
     68
     69/** Send a byte to the GXemul testarm serial console.
     70 *
     71 * @param byte          Byte to send.
     72 */
     73static void scons_sendb_testarm(uint8_t byte)
     74{
     75        *((volatile uint8_t *) TESTARM_SCONS_ADDR) = byte;
     76}
     77
     78#endif
     79
     80#ifdef MACHINE_integratorcp
     81
     82/** Send a byte to the IntegratorCP serial console.
     83 *
     84 * @param byte          Byte to send.
     85 */
     86static void scons_sendb_icp(uint8_t byte)
     87{
     88        *((volatile uint8_t *) ICP_SCONS_ADDR) = byte;
     89}
     90
     91#endif
     92
     93/** Send a byte to the serial console.
     94 *
     95 * @param byte          Byte to send.
     96 */
     97static void scons_sendb(uint8_t byte)
     98{
     99#ifdef MACHINE_gta02
     100        scons_sendb_gta02(byte);
     101#endif
     102#ifdef MACHINE_testarm
     103        scons_sendb_testarm(byte);
     104#endif
     105#ifdef MACHINE_integratorcp
     106        scons_sendb_icp(byte);
     107#endif
     108}
     109
     110/** Display a character
     111 *
     112 * @param ch    Character to display
     113 */
    42114void putchar(const wchar_t ch)
    43115{
    44116        if (ch == '\n')
    45                 *((volatile char *) VIDEORAM_ADDRESS) = '\r';
    46        
     117                scons_sendb('\r');
     118
    47119        if (ascii_check(ch))
    48                 *((volatile char *) VIDEORAM_ADDRESS) = ch;
     120                scons_sendb((uint8_t) ch);
    49121        else
    50                 *((volatile char *) VIDEORAM_ADDRESS) = U_SPECIAL;
     122                scons_sendb(U_SPECIAL);
    51123}
    52124
Note: See TracChangeset for help on using the changeset viewer.