Ignore:
File:
1 edited

Legend:

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

    rdf334ca r9d58539  
    3838#include <arch/mm.h>
    3939
    40 /** Check if caching can be enabled for a given memory section.
    41  *
    42  * Memory areas used for I/O are excluded from caching.
    43  * At the moment caching is enabled only on GTA02.
    44  *
    45  * @param section       The section number.
    46  *
    47  * @return      1 if the given section can be mapped as cacheable, 0 otherwise.
    48 */
    49 static inline int section_cacheable(pfn_t section)
    50 {
    51 #ifdef MACHINE_gta02
    52         unsigned long address = section << PTE_SECTION_SHIFT;
    53 
    54         if (address >= GTA02_IOMEM_START && address < GTA02_IOMEM_END)
    55                 return 0;
    56         else
    57                 return 1;
    58 #elif defined MACHINE_beagleboardxm
    59         const unsigned long address = section << PTE_SECTION_SHIFT;
    60         if (address >= BBXM_RAM_START && address < BBXM_RAM_END)
    61                 return 1;
    62 #endif
    63         return 0;
    64 }
    65 
    6640/** Initialize "section" page table entry.
    6741 *
     
    8054{
    8155        pte->descriptor_type = PTE_DESCRIPTOR_SECTION;
    82         pte->bufferable = 1;
    83         pte->cacheable = section_cacheable(frame);
    84         pte->xn = 0;
     56        pte->bufferable = 0;
     57        pte->cacheable = 0;
     58        pte->impl_specific = 0;
    8559        pte->domain = 0;
    8660        pte->should_be_zero_1 = 0;
    87         pte->access_permission_0 = PTE_AP_USER_NO_KERNEL_RW;
    88         pte->tex = 0;
    89         pte->access_permission_1 = 0;
    90         pte->non_global = 0;
     61        pte->access_permission = PTE_AP_USER_NO_KERNEL_RW;
    9162        pte->should_be_zero_2 = 0;
    92         pte->non_secure = 0;
    9363        pte->section_base_addr = frame;
    9464}
     
    9767static void init_boot_pt(void)
    9868{
    99         const pfn_t split_page = PTL0_ENTRIES;
     69        pfn_t split_page = 0x800;
     70       
    10071        /* Create 1:1 virtual-physical mapping (in lower 2 GB). */
    10172        pfn_t page;
     
    10778         * (upper 2 GB), physical addresses start from 0.
    10879         */
    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. */
    11280        for (page = split_page; page < PTL0_ENTRIES; page++)
    113 #ifndef MACHINE_beagleboardxm
    11481                init_ptl0_section(&boot_pt[page], page - split_page);
    115 #else
    116                 init_ptl0_section(&boot_pt[page], page);
    117 #endif
    11882       
    11983        asm volatile (
     
    13195                /* Behave as a client of domains */
    13296                "ldr r0, =0x55555555\n"
    133                 "mcr p15, 0, r0, c3, c0, 0\n"
     97                "mcr p15, 0, r0, c3, c0, 0\n" 
    13498               
    13599                /* Current settings */
    136100                "mrc p15, 0, r0, c1, c0, 0\n"
    137101               
    138                 /* Enable ICache, DCache, BPredictors and MMU,
    139                  * we disable caches before jumping to kernel
    140                  * so this is safe for all archs.
    141                  */
    142                 "ldr r1, =0x00001805\n"
    143                
     102                /* Mask to enable paging */
     103                "ldr r1, =0x00000001\n"
    144104                "orr r0, r0, r1\n"
    145105               
Note: See TracChangeset for help on using the changeset viewer.