
Cache
5-10
Freescale Semiconductor
Valid cache entries that match during cache-inhibited address accesses are neither pushed nor invalidated.
Such a scenario suggests that the associated cache mode for this address space was changed.
To avoid this,
it is generally recommended to use the CPUSHL instruction to push and/or invalidate the cache entry or
set CACR[CINVA] to invalidate the cache before switching cache modes.
5.3.3
Caching Modes
Caching modes determine how the cache manages an access. An access can be cacheable in write-through
or copyback mode; it can be cache-inhibited in precise or imprecise modes. For normal accesses, the
ACR
n
[CM] bit corresponding to the address of the access specifies the caching modes. If an address does
not match an ACR, the default caching mode is defined by CACR[DCM].
Addresses matching an ACR can also be write-protected using ACR[W]. Addresses that do not match
either ACR can be write-protected using CACR[DW].
Reset disables the cache and clears all CACR bits. As shown in
, reset does not automatically
invalidate cache entries; they must be invalidated through software.
The ACRs allow the defaults selected in the CACR to be overridden. In addition, some instructions (for
example, CPUSHL) and processor core operations perform accesses that have an implicit caching mode
associated with them. The following sections discuss the different caching accesses and their associated
cache modes.
5.3.3.1
Cacheable Accesses
If ACR
n
[CM] or the default field of the CACR indicates write-through or copyback, the access is
cacheable. A read access to a write-through or copyback region is read from the cache if matching data is
found. Otherwise, the data is read from memory and the cache is updated. When a line is being read from
memory for a write-through or copyback read miss, the longword within the line that contains the
core-requested data is loaded first and the requested data is given immediately to the processor, without
waiting for the three remaining longwords to reach the cache.
The following sections describe write-through and copyback modes in detail.
5.3.3.2
Write-Through Mode
Write accesses to regions specified as write-through are always passed on to the external bus, although the
cycle can be buffered, depending on the state of CACR[ESB]. Writes in write-through mode are managed
with a no-write-allocate policy—that is, writes that miss in the cache are written to the external bus but do
not cause the corresponding line in memory to be loaded into the cache. Write accesses that hit always
write through to memory and update matching cache lines. The cache supplies data to data-read accesses
that hit in the cache; read misses cause a new cache line to be loaded into the cache.
5.3.3.3
Copyback Mode
Copyback regions are typically used for local data structures or stacks to minimize external bus use and
reduce write-access latency. Write accesses to regions specified as copyback that hit in the cache update
the cache line and set the corresponding M bit without an external bus access.
MCF5329 Reference Manual, Rev 3
Summary of Contents for MCF5329
Page 106: ...ColdFire Core 3 32 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 148: ...Cache 5 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 154: ...Static RAM SRAM 6 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 184: ...Power Management 8 18 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 204: ...Reset Controller Module 10 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 220: ...System Control Module SCM 11 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 228: ...Crossbar Switch XBS 12 8 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 268: ...General Purpose I O Module 13 40 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 392: ...SDRAM Controller SDRAMC 18 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 436: ...Fast Ethernet Controller FEC 19 44 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 594: ...FlexCAN 23 30 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 678: ...Pulse Width Modulation PWM Module 26 22 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 684: ...Watchdog Timer Module 27 6 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 704: ...DMA Timers DTIM0 DTIM3 29 12 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 754: ...UART Modules 31 34 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 770: ...I2 C Interface 32 16 Freescale Semiconductor MCF5329 Reference Manual Rev 3...
Page 866: ...Debug Module 36 50 Freescale Semiconductor MCF5329 Reference Manual Rev 3...