3.14.3.5 Additional Points Pertaining to LS0/LS1
and D2/D3 RAM Memory Swap
LFU registers can be accessed
from both CPU and CLA.
Only LS0 and LS1 blocks can be
swapped for CPU1 and only D2 and D3 memories can be swapped for CPU2. LS2 to LS9
and DS4, D5 blocks cannot be swapped.
LS0/LS1 and D2/D3 blocks have
parity protection.
For dual core devices, the respective Dx memory (D2, D3, D4,
D5) is mapped to CPU2 address space and the LFUConfig.D23Swap bit can be used to
swap the D2 and D3 blocks when MCUCNF0.DUAL_CORE = '1' and MCUCNF1.MSEL_Dx =
'1'. For other configurations, writing to LFUConfig.D23Swap bit does not have
any effect.
A number of LSx RAM registers are
available to the user application code to configure options such as controller
select (LSxMSEL.MSEL_LS0, LSxMSEL.MSEL_LS1), fetch protect
(LSxACCPROT0.FETCHPROT_LS0, LSxACCPROT0.FETCHPROT_LS1), write protect
(LSxACCPROT0.CPUWRPROT_LS0, LSxACCPROT0.CPUWRPROT_LS1), CLA program memory
LSxCLAPGM.CLAPGM_LS0, LSxCLAPGM.CLAPGM_LS1). These register bits indicate the
status of the memory block that is deemed as LS0 (CPU address 0x8000 to 0x87FF)
and LS1 (CPU address 0x8800 to 0x8FFF) at any point of time. When a LS0/LS1 RAM
memory swap occurs, the corresponding control/status bits are also automatically
swapped.
Service all pending errors
(access violation, ECC, parity) associated with memory before initiating a
LS0/LS1 and D2/D3 RAM memory swap.
LS0/LS1 and D2/D3 RAM memory swap
must be initiated only after completion of RAM initialization for LS0/LS1 or
D2/D3 memories (LSxINITDONE.INITDONE_LS0 = 1, LSxINITDONE.INITDONE_LS1 = 1,
DxINITDONE.INITDONE_D2 = 1, DxINITDONE.INITDONE_D3 = 1).
LS0/LS1 RAM memory swap must not
be initiated when RAM-test (LSxTEST.TEST_LS0 = 1 or LSxTEST.TEST_LS1 = 1) is in
progress for LS0 or LS1 blocks. D2/D3 RAM memory swap must not be initiated when
RAM-test (DxTEST.TEST_D2 = 1 or DxTEST.TEST_D3 = 1) is in progress for D2 or D3
blocks.
With DCSM security on the device,
in general, LS0/LS1 or D2/D3 RAM blocks can be assigned to different security
zones. However, with LS0/LS1 or D2/D3 RAM memory swaps, different physical RAM
blocks can get mapped to the same address space. Application software must
therefore make sure that both LS0/LS1 or D2/D3 have the same security settings
(for example, zone, EXE protection), if there is a plan to implement LS0/LS1 or
D2/D3 RAM memory swap. Hardware logic is implemented on the device to prevent
swap of LS0/LS1 or D2/D3, if the blocks have different security
configurations.
To prevent security
vulnerabilities, LS0/LS1 or D2/D3 RAM memory swap is not allowed if the memory
swap is initiated by code from a different zone. For example,
if LS0 and LS1 are part
of Zone1, swap is not allowed if code that initiates the swap resides in
Zone2 or unsecure zone
if LS0 and LS1 are part
of Zone2, swap is not allowed if code that initiates the swap resides in
Zone1 or unsecure zone
if LS0 and LS1 are part
of the same zone that is unsecure, swap is allowed in all cases
irrespective of where the code that initiates the swap resides
if LS0 and LS1 are part
of the same zone and the zone is unlocked, the swap can be initiated
from code residing anywhere (including from the debugger)
Once swap is initiated, the swap
happens in the next cycle itself, subject to the swap meeting the security
requirements mentioned above. After initiation of a swap, application software
must check if the swap was correctly configured by checking the
LFUStatus.LS01Swap status register. Consistency between LFUStatus.LS01Swap and
LFUConfig.LS01Swap helps determine if the swap was correctly configured. If
LFUStatus.LS01Swap does not match LFUConfig.LS01Swap, LFUConfig.LS01Swap needs
to be cleared by the user application code.
Since the logical address
accessed by BGCRC changes with LS0/LS1 or D2/D3 RAM memory swap, the computed
CRC values for these memories need to be updated after the LS0/LS1 or D2/D3 RAM
memory swap.