This is the mail archive of the ecos-discuss@sourceware.cygnus.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[ECOS] ppc603e cache sync


Maybe this isn't the right forum for this but:

I need to flush the cache on an MPC8240, which is basicly a ppc603e.
One way of doing this is to zero the cache with a dummy area, this area
need not be specially aligned, and could be put into the .bss section.
 
- In which source file would it be logical to place it?

- and what should that area be named?

Maybe someone could suggest a neater solution?

BTW. the 'sync' is probably only needed once after the for loop.


/Daniel

hal/powerpc/arch/current/include/hal_cache.h
---------------------
// Synchronize the contents of the cache with memory.
// a bit brain damaged... assumes, no write modify on area defined
#define HAL_DCACHE_DUMMYAREA 0x20000
#define HAL_DCACHE_SYNC()                                              
\
    CYG_MACRO_START                                                    
\
    cyg_int32 __offset;                                                
\
    cyg_uint32 __base = HAL_DCACHE_DUMMYAREA;                          
\
    for (__offset=0;                                                   
\
         __offset < HAL_DCACHE_SIZE;                                   
\
         __offset+=HAL_DCACHE_LINE_SIZE) {                             
\
        asm volatile ("dcbz 0,%0;sync;" : : "r" (__base + __offset));  
\
    }                                                                  
\
    CYG_MACRO_END
---------------------


-- 
Daniel Kahlin <daniel.kahlin@netinsight.se>
Hardware System Designer
Net Insight AB
URL: http://www.netinsight.se/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]