1.23.2.18 CACHE_CacheInit Function

C

void CACHE_CacheInit(CACHE_COHERENCY cacheCoherency)

Summary

Initialize the L1 cache.

Description

Initializes both instruction and data caches. Invalidates all entries and zeroes all tags. Sets coherency attribute for kseg0.

Precondition

The function MUST be called after a hardware reset and before using the caches, otherwise they may be in an inconsistent state.

Parameters

Param Description
CACHE_COHERENCY cacheCoherency L1 cache coherency settings.

Returns

None.

Example

coherency = CACHE_WRITETHROUGH_NO_WRITEALLOCATE
CACHE_CacheInit(coherency);

Remarks

Use with caution. Invalidates all cache lines without writing data back to memory. Any dirty data in the cache will be lost.