Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 088b334 in mainline


Ignore:
Timestamp:
2013-02-24T11:24:16Z (7 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
master
Children:
8ab339e, b42c8d8
Parents:
df64dbc (diff), 9ad289d (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 initial Beaglebone support from lp:helenos-bbone

Files:
18 added
14 edited
4 moved

Legend:

Unmodified
Added
Removed
  • HelenOS.config

    rdf64dbc r088b334  
    6464@ "gta02" GTA02 / Neo FreeRunner
    6565@ "integratorcp" Integratorcp
    66 @ "beagleboardxm" BeogleBoard-xM
     66@ "beagleboardxm" BeagleBoard-xM
     67@ "beaglebone" BeagleBone
    6768! [PLATFORM=arm32] MACHINE (choice)
    6869
     
    8889% CPU type
    8990@ "cortex_a8" ARM Cortex A-8
    90 ! [PLATFORM=arm32&MACHINE=beagleboardxm] PROCESSOR (choice)
     91! [PLATFORM=arm32&(MACHINE=beagleboardxm|MACHINE=beaglebone)] PROCESSOR (choice)
    9192
    9293% CPU type
     
    441442% Output device class
    442443@ "generic" Monitor or serial line
    443 ! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm)] CONFIG_HID_OUT (choice)
     444! [PLATFORM=arm32&(MACHINE=gta02|MACHINE=integratorcp|MACHINE=beagleboardxm|MACHINE=beaglebone)] CONFIG_HID_OUT (choice)
    444445
    445446% Output device class
     
    488489! [PLATFORM=arm32&MACHINE=gta02] CONFIG_S3C24XX_IRQC (y)
    489490
    490 % Support for TI AMDM37X on-chip UART
     491% Support for TI AM335x on-chip UART
     492! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beaglebone] CONFIG_AM335X_UART (y/n)
     493
     494% Support for TI AM335x timers support
     495! [PLATFORM=arm32&MACHINE=beaglebone] CONFIG_AM335X_TIMERS (y)
     496
     497% Support for TI AMDM37x on-chip UART
    491498! [(CONFIG_HID_OUT=generic|CONFIG_HID_OUT=serial)&PLATFORM=arm32&MACHINE=beagleboardxm] CONFIG_AMDM37X_UART (y/n)
    492499
     
    510517
    511518% Serial line input module
    512 ! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_AMDM37X_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
     519! [CONFIG_DSRLNIN=y|(PLATFORM=arm32&MACHINE=gta02)|(PLATFORM=arm32&MACHINE=integratorcp&CONFIG_ARM926_UART=y)|(PLATFORM=arm32&MACHINE=beaglebone&CONFIG_AM335X_UART=y)|(PLATFORM=arm32&MACHINE=beagleboardxm&CONFIG_AMDM37X_UART=y)|(PLATFORM=ia64&MACHINE=i460GX&CONFIG_NS16550=y)|(PLATFORM=ia64&MACHINE=ski)|(PLATFORM=sparc64&PROCESSOR=sun4v)] CONFIG_SRLN (y)
    513520
    514521% EGA support
     
    623630% uImage OS type
    624631@ "2" NetBSD stage 2 boot loader
    625 ! [PLATFORM=arm32&MACHINE=beagleboardxm] UIMAGE_OS (choice)
     632! [PLATFORM=arm32&(MACHINE=beagleboardxm|MACHINE=beaglebone)] UIMAGE_OS (choice)
    626633
    627634% uImage OS type
    628635@ "5" Linux kernel
    629 ! [PLATFORM=arm32&MACHINE!=beagleboardxm] UIMAGE_OS (choice)
     636! [PLATFORM=arm32&MACHINE!=beagleboardxm&MACHINE!=beaglebone] UIMAGE_OS (choice)
  • boot/arch/arm32/Makefile.inc

    rdf64dbc r088b334  
    3535endif
    3636
    37 ifeq ($(MACHINE), beagleboardxm)
     37ifeq ($(MACHINE), $(filter $(MACHINE),beagleboardxm beaglebone))
    3838        BOOT_OUTPUT = image.boot
    3939        POST_OUTPUT = $(ROOT_PATH)/uImage.bin
  • boot/arch/arm32/include/arch.h

    rdf64dbc r088b334  
    4444#elif defined MACHINE_beagleboardxm
    4545#define BOOT_BASE       0x80000000
     46#elif defined MACHINE_beaglebone
     47#define BOOT_BASE       0x80000000
    4648#else
    4749#define BOOT_BASE       0x00000000
     
    5153
    5254#ifdef MACHINE_beagleboardxm
     55        #define PA_OFFSET 0
     56#elif defined MACHINE_beaglebone
    5357        #define PA_OFFSET 0
    5458#else
  • boot/arch/arm32/include/main.h

    rdf64dbc r088b334  
    5151#define BBXM_THR_FULL           0x00000001
    5252
     53/** Beaglebone UART register addresses
     54 *
     55 * This is UART0 of AM335x CPU
     56 */
     57#define BBONE_SCONS_THR         0x44E09000
     58#define BBONE_SCONS_SSR         0x44E09044
     59
     60/** Check this bit before writing (tx fifo full) */
     61#define BBONE_TXFIFO_FULL       0x00000001
    5362
    5463/** GTA02 serial console UART register addresses.
  • boot/arch/arm32/include/mm.h

    rdf64dbc r088b334  
    6363#define BBXM_RAM_END   0xc0000000
    6464
     65/** Start of ram memory on AM335x */
     66#define AM335x_RAM_START   0x80000000
     67/** End of ram memory on AM335x */
     68#define AM335x_RAM_END     0xC0000000
     69
    6570
    6671/* Page table level 0 entry - "section" format is used
     
    7681        unsigned int access_permission_0 : 2;
    7782        unsigned int tex : 3;
    78         unsigned int access_permission_1 : 2;
     83        unsigned int access_permission_1 : 1;
     84        unsigned int shareable : 1;
    7985        unsigned int non_global : 1;
    8086        unsigned int should_be_zero_2 : 1;
  • boot/arch/arm32/src/mm.c

    rdf64dbc r088b334  
    3838#include <arch/mm.h>
    3939
     40/** Disable the MMU */
     41static void disable_paging(void)
     42{
     43        asm volatile (
     44                "mrc p15, 0, r0, c1, c0, 0\n"
     45                "bic r0, r0, #1\n"
     46                "mcr p15, 0, r0, c1, c0, 0\n"
     47                ::: "r0"
     48        );
     49}
     50
    4051/** Check if caching can be enabled for a given memory section.
    4152 *
     
    5970        const unsigned long address = section << PTE_SECTION_SHIFT;
    6071        if (address >= BBXM_RAM_START && address < BBXM_RAM_END)
     72                return 1;
     73#elif defined MACHINE_beaglebone
     74        const unsigned long address = section << PTE_SECTION_SHIFT;
     75        if (address >= AM335x_RAM_START && address < AM335x_RAM_END)
    6176                return 1;
    6277#endif
     
    88103        pte->tex = 0;
    89104        pte->access_permission_1 = 0;
     105        pte->shareable = 0;
    90106        pte->non_global = 0;
    91107        pte->should_be_zero_2 = 0;
     
    102118        for (page = 0; page < split_page; page++)
    103119                init_ptl0_section(&boot_pt[page], page);
    104        
    105         /*
    106          * Create 1:1 virtual-physical mapping in kernel space
    107          * (upper 2 GB), physical addresses start from 0.
    108          */
    109         /* BeagleBoard-xM (DM37x) memory starts at 2GB border,
    110          * thus mapping only lower 2GB is not not enough.
    111          * Map entire AS 1:1 instead and hope it works. */
    112         for (page = split_page; page < PTL0_ENTRIES; page++)
    113 #ifndef MACHINE_beagleboardxm
    114                 init_ptl0_section(&boot_pt[page], page - split_page);
    115 #else
    116                 init_ptl0_section(&boot_pt[page], page);
    117 #endif
    118120       
    119121        asm volatile (
     
    132134                "ldr r0, =0x55555555\n"
    133135                "mcr p15, 0, r0, c3, c0, 0\n"
    134                
     136
    135137                /* Current settings */
    136138                "mrc p15, 0, r0, c1, c0, 0\n"
     
    143145               
    144146                "orr r0, r0, r1\n"
     147
     148                /* Invalidate the TLB content before turning on the MMU.
     149                 * ARMv7-A Reference manual, B3.10.3
     150                 */
     151                "mcr p15, 0, r0, c8, c7, 0\n"
    145152               
    146                 /* Store settings */
     153                /* Store settings, enable the MMU */
    147154                "mcr p15, 0, r0, c1, c0, 0\n"
    148155                ::: "r0", "r1"
     
    152159/** Start the MMU - initialize page table and enable paging. */
    153160void mmu_start() {
     161        disable_paging();
    154162        init_boot_pt();
    155163        enable_paging();
  • boot/arch/arm32/src/putchar.c

    rdf64dbc r088b334  
    4040#include <putchar.h>
    4141#include <str.h>
     42
     43#ifdef MACHINE_beaglebone
     44
     45/** Send a byte to the am335x serial console.
     46 *
     47 * @param byte          Byte to send.
     48 */
     49static void scons_sendb_bbone(uint8_t byte)
     50{
     51        volatile uint32_t *thr =
     52                (volatile uint32_t *) BBONE_SCONS_THR;
     53        volatile uint32_t *ssr =
     54                (volatile uint32_t *) BBONE_SCONS_SSR;
     55
     56        /* Wait until transmitter is empty */
     57        while (*ssr & BBONE_TXFIFO_FULL);
     58
     59        /* Transmit byte */
     60        *thr = (uint32_t) byte;
     61}
     62
     63#endif
    4264
    4365#ifdef MACHINE_beagleboardxm
     
    106128static void scons_sendb(uint8_t byte)
    107129{
     130#ifdef MACHINE_beaglebone
     131        scons_sendb_bbone(byte);
     132#endif
    108133#ifdef MACHINE_beagleboardxm
    109134        scons_sendb_bbxm(byte);
  • kernel/arch/arm32/Makefile.inc

    rdf64dbc r088b334  
    8585endif
    8686
     87ifeq ($(MACHINE),beaglebone)
     88        ARCH_SOURCES += arch/$(KARCH)/src/mach/beaglebone/beaglebone.c
     89endif
     90
    8791ifeq ($(CONFIG_PL050),y)
    8892        ARCH_SOURCES += genarch/src/drivers/pl050/pl050.c
  • kernel/arch/arm32/_link.ld.in

    rdf64dbc r088b334  
    1010#define KERNEL_LOAD_ADDRESS 0xb0a08000
    1111#elif defined MACHINE_beagleboardxm
     12#define KERNEL_LOAD_ADDRESS 0x80a00000
     13#elif define MACHINE_beaglebone
    1214#define KERNEL_LOAD_ADDRESS 0x80a00000
    1315#else
  • kernel/arch/arm32/include/mm/frame.h

    rdf64dbc r088b334  
    5656#define BOOT_PAGE_TABLE_ADDRESS  0x80008000
    5757
     58#elif defined MACHINE_beaglebone
     59
     60#define PHYSMEM_START_ADDR       0x80000000
     61#define BOOT_PAGE_TABLE_ADDRESS  0x80008000
     62
    5863#else
    5964
     
    6570#define BOOT_PAGE_TABLE_START_FRAME     (BOOT_PAGE_TABLE_ADDRESS >> FRAME_WIDTH)
    6671#define BOOT_PAGE_TABLE_SIZE_IN_FRAMES  (BOOT_PAGE_TABLE_SIZE >> FRAME_WIDTH)
    67 
    6872
    6973extern void frame_low_arch_init(void);
  • kernel/arch/arm32/include/mm/page.h

    rdf64dbc r088b334  
    4646#define PAGE_SIZE       FRAME_SIZE
    4747
    48 #ifdef MACHINE_beagleboardxm
     48#if (defined MACHINE_beagleboardxm) || (defined MACHINE_beaglebone)
    4949#ifndef __ASM__
    5050#       define KA2PA(x) ((uintptr_t) (x))
  • kernel/arch/arm32/src/mach/beagleboardxm/beagleboardxm.c

    rdf64dbc r088b334  
    3535#include <arch/exception.h>
    3636#include <arch/mach/beagleboardxm/beagleboardxm.h>
    37 #include <genarch/drivers/amdm37x_irc/amdm37x_irc.h>
    38 #include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
    39 #include <genarch/drivers/amdm37x_gpt/amdm37x_gpt.h>
     37#include <genarch/drivers/amdm37x/uart.h>
     38#include <genarch/drivers/amdm37x/irc.h>
     39#include <genarch/drivers/amdm37x/gpt.h>
    4040#include <genarch/fb/fb.h>
    4141#include <genarch/srln/srln.h>
  • kernel/arch/arm32/src/machine_func.c

    rdf64dbc r088b334  
    4242#include <arch/mach/integratorcp/integratorcp.h>
    4343#include <arch/mach/beagleboardxm/beagleboardxm.h>
     44#include <arch/mach/beaglebone/beaglebone.h>
    4445
    4546/** Pointer to machine_ops structure being used. */
     
    5556#elif defined(MACHINE_beagleboardxm)
    5657        machine_ops = &bbxm_machine_ops;
     58#elif defined(MACHINE_beaglebone)
     59        machine_ops = &bbone_machine_ops;
    5760#else
    5861#error Machine type not defined.
  • kernel/genarch/Makefile.inc

    rdf64dbc r088b334  
    106106endif
    107107
     108ifeq ($(CONFIG_AM335X_UART),y)
     109        GENARCH_SOURCES += \
     110                genarch/src/drivers/am335x/uart.c
     111endif
     112
     113ifeq ($(CONFIG_AM335X_TIMERS),y)
     114        GENARCH_SOURCES += \
     115                genarch/src/drivers/am335x/timer.c
     116endif
     117
    108118ifeq ($(CONFIG_AMDM37X_UART),y)
    109119        GENARCH_SOURCES += \
    110                 genarch/src/drivers/amdm37x_uart/amdm37x_uart.c
     120                genarch/src/drivers/amdm37x/uart.c
    111121endif
    112122
  • kernel/genarch/include/drivers/amdm37x/uart_regs.h

    rdf64dbc r088b334  
    3131/**
    3232 * @file
    33  * @brief Texas Instruments AMDM37x on-chip interrupt controller driver.
     33 * @brief Texas Instruments AMDM37x UART memory mapped registers.
    3434 */
    3535
     
    4040#include <console/chardev.h>
    4141#include <ddi/irq.h>
    42 
    43 /* AMDM37x TRM p. 2950 */
    44 #define AMDM37x_UART1_BASE_ADDRESS   0x4806a000
    45 #define AMDM37x_UART1_SIZE   1024
    46 #define AMDM37x_UART1_IRQ   72 /* AMDM37x TRM p. 2418 */
    47 
    48 #define AMDM37x_UART2_BASE_ADDRESS   0x4806b000
    49 #define AMDM37x_UART2_SIZE   1024
    50 #define AMDM37x_UART2_IRQ   73 /* AMDM37x TRM p. 2418 */
    51 
    52 #define AMDM37x_UART3_BASE_ADDRESS   0x49020000
    53 #define AMDM37x_UART3_SIZE   1024
    54 #define AMDM37x_UART3_IRQ   74 /* AMDM37x TRM p. 2418 */
    55 
    56 #define AMDM37x_UART4_BASE_ADDRESS   0x49042000
    57 #define AMDM37x_UART4_SIZE   1024
    58 #define AMDM37x_UART4_IRQ   80 /* AMDM37x TRM p. 2418 */
    5942
    6043typedef struct {
     
    343326
    344327                /** BOF control register (IrDA only) */
    345                 ioport32_t blr; /* UART3 sepcific */
     328                ioport32_t blr; /* UART3 specific */
    346329#define AMDM37x_IRDA_BLR_XBOF_TYPE_FLAG   (1 << 6)
    347330#define AMDM37x_IRDA_BLR_STS_FIFO_RESET   (1 << 7)
     
    442425} amdm37x_uart_regs_t;
    443426
    444 typedef struct {
    445         amdm37x_uart_regs_t *regs;
    446         indev_t *indev;
    447         outdev_t outdev;
    448         irq_t irq;
    449 } amdm37x_uart_t;
    450 
    451 
    452 bool amdm37x_uart_init(amdm37x_uart_t *, inr_t, uintptr_t, size_t);
    453 void amdm37x_uart_input_wire(amdm37x_uart_t *, indev_t *);
    454 
    455427#endif
    456428
  • kernel/genarch/src/drivers/amdm37x/uart.c

    rdf64dbc r088b334  
    3434 */
    3535
    36 #include <genarch/drivers/amdm37x_uart/amdm37x_uart.h>
     36#include <genarch/drivers/amdm37x/uart.h>
    3737#include <ddi/device.h>
    3838#include <str.h>
Note: See TracChangeset for help on using the changeset viewer.