Changeset 296a80e in mainline


Ignore:
Timestamp:
2013-08-03T22:16:12Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
67d02bb
Parents:
9120b69
Message:

arm32: Fix pt mapping, and enable caches in early boot.

Files:
2 edited

Legend:

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

    r9120b69 r296a80e  
    5656jump_to_kernel:
    5757        #
    58         # TODO
    5958        # Make sure that the I-cache, D-cache and memory are mutually coherent
    6059        # before passing control to the copied code.
     
    6867#define CP15_C1_BP              11
    6968#define CP15_C1_DC              2
    70         # Disable I-cache and D-cache before the kernel is started.
     69
     70
     71#ifndef PROCESSOR_ARCH_armv7_a
    7172        mrc     p15, 0, r4, c1, c0, 0
     73       
     74        # D-cache before the kernel is started.
    7275        bic     r4, r4, #(1 << CP15_C1_DC)
    73 #ifndef PROCESSOR_ARCH_armv7_a
     76
     77        #Disable I-cache and Branche predicotrs on non-armv7
    7478        bic     r4, r4, #(1 << CP15_C1_IC)
    7579        bic     r4, r4, #(1 << CP15_C1_BP)
     80       
     81        mcr     p15, 0, r4, c1, c0, 0
    7682#endif
    77         mcr     p15, 0, r4, c1, c0, 0
     83
    7884
    7985       
     
    8288        dsb
    8389#else
     90        andi r4, 0
    8491        #cp15 dsb, r4 is ignored (should be zero)
    8592        mcr p15, 0, r4, c7, c10, 4
  • kernel/arch/arm32/include/arch/mm/page_armv6.h

    r9120b69 r296a80e  
    205205                p->ns = 0;
    206206        }
    207         DCCMVAU_write((uint32_t)p);
     207        DCCMVAC_write((uint32_t)p);
     208        //TODO: DCCMVAU should be enough but it does not work.
    208209}
    209210
     
    236237         * tex=0 buf=1 and cache=0 => shareable device mmio
    237238         */
    238         p->cacheable = (flags & PAGE_CACHEABLE);
     239
     240        if (flags & PAGE_CACHEABLE) {
     241                p->tex = 1;
     242                p->cacheable = 1;
     243        } else {
     244                p->tex = 0;
     245                p->cacheable = 0;
     246        }
    239247        p->bufferable = 1;
    240         p->tex = 0;
    241248       
    242249        /* Shareable is ignored for devices (non-cacheable),
    243250         * turn it on for normal memory. */
    244         p->shareable = 1;
     251        p->shareable = 0;
    245252       
    246253        p->non_global = !(flags & PAGE_GLOBAL);
     
    256263                        p->access_permission_1 = PTE_AP1_RO;
    257264        }
    258         DCCMVAU_write((uint32_t)p);
     265        DCCMVAC_write((uint32_t)p);
     266        //TODO: DCCMVAU should be enough but it does not work.
    259267}
    260268
     
    267275        write_barrier();
    268276        p->descriptor_type = PTE_DESCRIPTOR_COARSE_TABLE;
    269         DCCMVAU_write((uint32_t)p);
     277        DCCMVAC_write((uint32_t)p);
     278        //TODO: DCCMVAU should be enough but it does not work.
    270279}
    271280
     
    275284
    276285        p->descriptor_type = PTE_DESCRIPTOR_SMALL_PAGE;
    277         DCCMVAU_write((uint32_t)p);
     286        DCCMVAC_write((uint32_t)p);
     287        //TODO: DCCMVAU should be enough but it does not work.
    278288}
    279289
Note: See TracChangeset for help on using the changeset viewer.