Changeset 19b3cc6 in mainline for boot


Ignore:
Timestamp:
2014-01-17T23:12:10Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e26a9d95
Parents:
fddffb2 (diff), facc34d (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 libdrv-cleanup branch (includes mainline changes)

Location:
boot
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    rfddffb2 r19b3cc6  
    9696        $(USPACE_PATH)/srv/devman/devman \
    9797        $(USPACE_PATH)/srv/fs/locfs/locfs \
    98         $(USPACE_PATH)/srv/hid/compositor/compositor
     98        $(USPACE_PATH)/srv/hid/compositor/compositor \
     99        $(USPACE_PATH)/srv/klog/klog
    99100
    100101RD_SRVS_NON_ESSENTIAL = \
     
    161162        $(USPACE_PATH)/app/bdsh/bdsh \
    162163        $(USPACE_PATH)/app/getterm/getterm \
    163         $(USPACE_PATH)/app/klog/klog \
     164        $(USPACE_PATH)/app/kio/kio \
    164165        $(USPACE_PATH)/app/vlaunch/vlaunch \
    165166        $(USPACE_PATH)/app/vterm/vterm
  • boot/arch/arm32/Makefile.inc

    rfddffb2 r19b3cc6  
    4343endif
    4444
     45ifeq ($(MACHINE), raspberrypi)
     46        BOOT_OUTPUT = image.boot
     47        POST_OUTPUT = $(ROOT_PATH)/uImage.bin   
     48        LADDR = 0x00008000
     49        SADDR = 0x00008000
     50        POSTBUILD = Makefile.uboot           
     51endif
     52
    4553BFD_NAME = elf32-littlearm
    4654BFD_OUTPUT = $(BFD_NAME)
  • boot/arch/arm32/include/arch.h

    rfddffb2 r19b3cc6  
    4646#elif defined MACHINE_beaglebone
    4747#define BOOT_BASE       0x80000000
     48#elif defined MACHINE_raspberrypi
     49#define BOOT_BASE       0x00008000
    4850#else
    4951#define BOOT_BASE       0x00000000
  • boot/arch/arm32/include/main.h

    rfddffb2 r19b3cc6  
    7575#define ICP_SCONS_ADDR          0x16000000
    7676
     77/** Raspberry PI serial console registers */
     78#define BCM2835_UART0_BASE      0x20201000
     79#define BCM2835_UART0_DR        (BCM2835_UART0_BASE + 0x00)
     80#define BCM2835_UART0_FR        (BCM2835_UART0_BASE + 0x18)
     81#define BCM2835_UART0_ILPR      (BCM2835_UART0_BASE + 0x20)
     82#define BCM2835_UART0_IBRD      (BCM2835_UART0_BASE + 0x24)
     83#define BCM2835_UART0_FBRD      (BCM2835_UART0_BASE + 0x28)
     84#define BCM2835_UART0_LCRH      (BCM2835_UART0_BASE + 0x2C)
     85#define BCM2835_UART0_CR        (BCM2835_UART0_BASE + 0x30)
     86#define BCM2835_UART0_ICR       (BCM2835_UART0_BASE + 0x44)
     87
     88#define BCM2835_UART0_FR_TXFF   (1 << 5)
     89#define BCM2835_UART0_LCRH_FEN  (1 << 4)
     90#define BCM2835_UART0_LCRH_WL8  ((1 << 5) | (1 << 6))
     91#define BCM2835_UART0_CR_UARTEN (1 << 0)
     92#define BCM2835_UART0_CR_TXE    (1 << 8)
     93#define BCM2835_UART0_CR_RXE    (1 << 9)
     94
     95
     96
    7797extern void bootstrap(void);
    7898
  • boot/arch/arm32/include/mm.h

    rfddffb2 r19b3cc6  
    6868#define AM335x_RAM_END     0xC0000000
    6969
     70/** Start of ram memory on BCM2835 */
     71#define BCM2835_RAM_START   0
     72/** End of ram memory on BCM2835 */
     73#define BCM2835_RAM_END     0x20000000
    7074
    7175/* Page table level 0 entry - "section" format is used
  • boot/arch/arm32/src/mm.c

    rfddffb2 r19b3cc6  
    116116        if (address >= AM335x_RAM_START && address < AM335x_RAM_END)
    117117                return 1;
     118#elif defined MACHINE_raspberrypi
     119        if (address < BCM2835_RAM_END)
     120                return 1;
    118121#endif
    119122        return address * 0;
  • boot/arch/arm32/src/putchar.c

    rfddffb2 r19b3cc6  
    122122#endif
    123123
     124#ifdef MACHINE_raspberrypi
     125
     126static int raspi_init;
     127
     128static inline void write32(uint32_t addr, uint32_t data)
     129{
     130        *(volatile uint32_t *)(addr) = data;
     131}
     132
     133static inline uint32_t read32(uint32_t addr)
     134{
     135        return *(volatile uint32_t *)(addr);
     136}
     137
     138static void scons_init_raspi(void)
     139{
     140        write32(BCM2835_UART0_CR, 0x0);         /* Disable UART */
     141        write32(BCM2835_UART0_ICR, 0x7f);       /* Clear interrupts */
     142        write32(BCM2835_UART0_IBRD, 1);         /* Set integer baud rate */
     143        write32(BCM2835_UART0_FBRD, 40);        /* Set fractional baud rate */
     144        write32(BCM2835_UART0_LCRH,
     145                BCM2835_UART0_LCRH_FEN |        /* Enable FIFOs */
     146                BCM2835_UART0_LCRH_WL8);        /* Word length: 8 */
     147        write32(BCM2835_UART0_CR,
     148                BCM2835_UART0_CR_UARTEN |       /* Enable UART */
     149                BCM2835_UART0_CR_TXE |          /* Enable TX */
     150                BCM2835_UART0_CR_RXE);          /* Enable RX */
     151}
     152
     153static void scons_sendb_raspi(uint8_t byte)
     154{
     155        if (!raspi_init) {
     156                scons_init_raspi();
     157                raspi_init = 1;
     158        }
     159
     160        while (read32(BCM2835_UART0_FR) & BCM2835_UART0_FR_TXFF);
     161
     162        write32(BCM2835_UART0_DR, byte);
     163}
     164#endif
     165
    124166/** Send a byte to the serial console.
    125167 *
     
    139181#ifdef MACHINE_integratorcp
    140182        scons_sendb_icp(byte);
     183#endif
     184#ifdef MACHINE_raspberrypi
     185        scons_sendb_raspi(byte);
    141186#endif
    142187}
Note: See TracChangeset for help on using the changeset viewer.