Flash Controller Memory Module
541
SPRUHE8E – October 2012 – Revised November 2019
Copyright © 2012–2019, Texas Instruments Incorporated
Internal Memory
When Cortex M3 in the master subsystem initiates an ICODE access from an address in program space
in flash:
1. M3-FMC checks the program cache, if enabled, to determine the presence of required data.
2. If data corresponding to the requested address is present in the cache, it is construed as a cache hit
and data will be provided to the CPU from cache. At this time, the prefetch mechanism will fetch 128
bits from the next linear 128-bit aligned address from last address access, and fills the program cache.
3. If data corresponding to the requested address is not present in the cache, it is construed as a cache
miss. Therefore, the prefetch mechanism will fetch 128 bits of the data from the requested address in
bank (the starting address of the access from flash is automatically aligned to a 128-bit boundary such
that the instruction location is within the 128 bits to be fetched) and writes that data on to cache, and
eventually the requested data is sent to the CPU from cache for processing.
If cache mode is enabled, then the last row of 128 bits in bank should not be used, because the prefetch
logic which does a look-ahead prefetch, will try to fetch from outside the bank/OTP and would result in an
ECC error.
The flash prefetch mechanism is aborted only on a PC discontinuity caused by executing an instruction
such as a branch, function call, or loop, and so on. When this occurs, the prefetch is aborted. There are
two possible scenarios when this occurs:
1. If the destination address is within the flash or OTP, then prefetch aborts and then resumes at the
destination address.
2. If the destination address is outside of the flash and OTP, the prefetch is aborted and begins again
only when a branch is made back into the flash or OTP. The flash prefetch mechanism only applies to
instruction fetches (ICODE) from program space. Data space accesses (DCODE) do not utilize the
prefetch mechanism. For data space accesses, the program cache and prefetch mechanism are
bypassed. If an instruction prefetch is already in progress when a data read operation is initiated, then
the data read will be stalled until the prefetch completes.
5.3.8.1.2.2 Data Cache
Along with the program cache, a data cache of 128 bits width is also implemented to improve data space
access (DCODE) performance. This data cache will not be filled by the prefetch mechanism. When any
kind of data space access is made by the CPU from an address in the bank, and if the data corresponding
to the requested address is not in the data cache, then 128 bits of data will be read from the bank and
loaded in the data cache. The data is eventually sent to the CPU for processing. The starting address of
the access from flash is automatically aligned to a 128-bit boundary such that the requested address
location is within the 128 bits to be read from the bank. By default, this data cache is disabled and can be
enabled by setting DATA_CACHE_EN bit in the FRD_INTF_CTRL register.
Some other points to keep in mind when working with M3 flash:
•
Reads of the CSM password locations, GRABRAM, GRABSECT, ECSLKEY and EXEONLY locations
are hardwired for 10 wait states. The RWAIT bits have no effect on these locations.
•
CPU writes to the flash or OTP memory map areas are ignored. They complete in a single cycle.
•
DCODE access to zone-1 and zone-2 password locations would return the data to Code Security
Module (CSM) and return a value of zero to Cortex-M3 when the respective password lock bits are not
all 1s and the respective zone is not unlocked.
•
ICODE accesses to zone-1 and zone-2 password locations return a 0 when the respective password
lock bits are not all 1s and the respective zone is not unlocked.
•
When the Code Security Module (CSM) is secured, reads to the flash/OTP memory map area from
outside the secure zone take the same number of cycles as a normal access. However, the read
operation returns a zero.
•
The arbitration scheme in M3-FMC prioritizes Cortex-M3 accesses in the fixed priority order of data
space access (DCODE), program space access (ICODE)/program space prefetch.
•
When FSM interface is active for erase/program operations, data in the program cache and data cache
in FMC will be invalidated.