Changeset ff381a7 in mainline for boot


Ignore:
Timestamp:
2015-11-02T20:54:19Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8513177
Parents:
3feeab2 (diff), 5265eea4 (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 mainline changes.

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

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/asm.S

    r3feeab2 rff381a7  
    7575        bic     r4, r4, #(1 << CP15_C1_DC)
    7676
    77         # Disable I-cache and Branche predictors.
     77        # Disable I-cache and Branch predictors.
    7878        bic     r4, r4, #(1 << CP15_C1_IC)
     79#ifdef PROCESSOR_ARCH_armv6
    7980        bic     r4, r4, #(1 << CP15_C1_BP)
     81#endif
    8082       
    8183        mcr     p15, 0, r4, c1, c0, 0
    8284#endif
    83 
    84 
    8585       
    86         #Wait for the operations to complete
     86        # Wait for the operations to complete
    8787#ifdef PROCESSOR_ARCH_armv7_a
    8888        dsb
    8989#else
    90         #cp15 dsb, r4 is ignored (should be zero)
     90        # cp15 dsb, r4 is ignored (should be zero)
    9191        mov r4, #0
    9292        mcr p15, 0, r4, c7, c10, 4
     
    9898        nop
    9999
    100         #Wait for the operations to complete
     100        # Wait for the operations to complete
    101101#ifdef PROCESSOR_ARCH_armv7_a
    102102        isb
    103103        nop
    104 #else
     104#elif defined(PROCESSOR_ARCH_armv6)
    105105        # cp15 isb
    106106        mcr p15, 0, r4, c7, c5, 4
  • boot/arch/arm32/src/main.c

    r3feeab2 rff381a7  
    4747#include <errno.h>
    4848#include <inflate.h>
     49#include <arch/cp15.h>
    4950
    5051#define TOP2ADDR(top)  (((void *) PA2KA(BOOT_OFFSET)) + (top))
     
    5556static inline void clean_dcache_poc(void *address, size_t size)
    5657{
    57         const uintptr_t addr = (uintptr_t)address;
    58         for (uintptr_t a = addr; a < addr + size; a += 4) {
    59                 /* DCCMVAC - clean by address to the point of coherence */
    60                 asm volatile ("mcr p15, 0, %[a], c7, c10, 1\n" :: [a]"r"(a) : );
     58        const uintptr_t addr = (uintptr_t) address;
     59
     60#if !defined(PROCESSOR_ARCH_armv7_a)
     61        bool sep;
     62        if (MIDR_read() != CTR_read()) {
     63                sep = (CTR_read() & CTR_SEP_FLAG) == CTR_SEP_FLAG;
     64        } else {
     65                printf("Unknown cache type.\n");
     66                halt();
     67        }
     68#endif
     69
     70        for (uintptr_t a = ALIGN_DOWN(addr, CP15_C7_MVA_ALIGN); a < addr + size;
     71            a += CP15_C7_MVA_ALIGN) {
     72#if defined(PROCESSOR_ARCH_armv7_a)
     73                DCCMVAC_write(a);
     74#else
     75                if (sep)
     76                        DCCMVA_write(a);
     77                else
     78                        CCMVA_write(a);
     79#endif
    6180        }
    6281}
  • boot/arch/arm32/src/mm.c

    r3feeab2 rff381a7  
    143143        pte->should_be_zero_1 = 0;
    144144        pte->access_permission_0 = PTE_AP_USER_NO_KERNEL_RW;
    145 #ifdef PROCESSOR_ARCH_armv7_a
     145#if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a)
    146146        /*
    147147         * Keeps this setting in sync with memory type attributes in:
     
    152152        pte->tex = section_cacheable(frame) ? 5 : 0;
    153153        pte->cacheable = section_cacheable(frame) ? 0 : 0;
    154         pte->bufferable = section_cacheable(frame) ? 1 : 0;
     154        pte->bufferable = section_cacheable(frame) ? 1 : 1;
    155155#else
    156         pte->bufferable = 1;
     156        pte->bufferable = section_cacheable(frame);
    157157        pte->cacheable = section_cacheable(frame);
    158158        pte->tex = 0;
     
    189189         */
    190190        uint32_t val = (uint32_t)boot_pt & TTBR_ADDR_MASK;
     191#if defined(PROCESSOR_ARCH_armv6) || defined(PROCESSOR_ARCH_armv7_a)
     192        // FIXME: TTBR_RGN_WBWA_CACHE is unpredictable on ARMv6
    191193        val |= TTBR_RGN_WBWA_CACHE | TTBR_C_FLAG;
     194#endif
    192195        TTBR0_write(val);
    193196}
Note: See TracChangeset for help on using the changeset viewer.