Changeset dff90fa7 in mainline for boot/arch/arm32/src


Ignore:
Timestamp:
2013-06-05T19:41:12Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
74dcc07
Parents:
f288d85 (diff), 6db5d4b (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:

mainline changes

Location:
boot/arch/arm32/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/mm.c

    rf288d85 rdff90fa7  
    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

    rf288d85 rdff90fa7  
    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);
Note: See TracChangeset for help on using the changeset viewer.