Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • EcnlProtoTool/trunk/ntshell/src/syscall.c

    r331 r429  
    6161// https://os.mbed.com/users/dkato/code/FlashAccess/#652a093cf264
    6262void flash_access_cache_control(void) {
    63     unsigned int assoc;
    64 
    65     /* ==== Cleaning and invalidation of the L1 data cache ==== */
    66     __v7_all_cache(2);
    67     __DSB();
    68 
    69     /* ==== Cleaning and invalidation of the L2 cache ==== */
    70     if (PL310->AUX_CNT & (1<<16)) {
    71         assoc = 16;
    72     } else {
    73         assoc =  8;
    74     }
    75     PL310->INV_WAY = (1 << assoc) - 1;
    76     while(PL310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate
    77     PL310->CACHE_SYNC = 0x0;
    78 
    79     /* ==== Invalidate all TLB entries ==== */
    80     __ca9u_inv_tlb_all();
    81 
    82     /* ==== Invalidate the L1 instruction cache ==== */
    83     __v7_inv_icache_all();
    84     __DSB();
    85     __ISB();
     63        unsigned int assoc;
     64
     65        /* ==== Cleaning and invalidation of the L1 data cache ==== */
     66        L1C_CleanInvalidateDCacheAll();
     67        __DSB();
     68
     69        /* ==== Cleaning and invalidation of the L2 cache ==== */
     70        if (L2C_310->AUX_CNT & (1 << 16)) {
     71                assoc = 16;
     72        }
     73        else {
     74                assoc = 8;
     75        }
     76        L2C_310->INV_WAY = (1 << assoc) - 1;
     77        while (L2C_310->INV_WAY & ((1 << assoc) - 1)); // poll invalidate
     78        L2C_310->CACHE_SYNC = 0x0;
     79
     80        /* ==== Invalidate all TLB entries ==== */
     81        MMU_InvalidateTLB();
     82
     83        /* ==== Invalidate the L1 instruction cache ==== */
     84        L1C_InvalidateICacheAll();
     85        __DSB();
     86        __ISB();
    8687}
    8788
Note: See TracChangeset for help on using the changeset viewer.