Chapter 27 Functional Safety
MPC5602P Microcontroller Reference Manual, Rev. 4
748
Freescale Semiconductor
NOTE
The GCR[UAA] bit has no effect on the allowed access modes for the
registers in the Register protection module.
27.2.6
Functional description
27.2.6.1
General
This module provides a generic register (address) write-protection mechanism. The protection size can be:
•
32-bit (address == multiples of 4)
•
16-bit (address == multiples of 2)
•
8-bit (address == multiples of 1)
•
unprotected (address == multiples of 1)
For all addresses that are protected there are SLBR
n
[SLB
m
] bits that specify whether the address is locked.
When an address is locked it can only be read but not written in any mode (supervisor/normal). If an
address is unprotected the corresponding SLBR
n
[SLB
m
] bit is always 0b0 no matter what software is
writing to.
27.2.6.2
Change lock settings
To change the setting whether an address is locked or unlocked, the corresponding SLBR
n
[SLB
m
] bit
needs to be changed. This can be done using the following methods:
•
Modify the SLBR
n
[SLB
m
] bit directly by writing to area #4
•
Set the SLBR
n
[SLB
m
] bit(s) by writing to the mirror module space (area #3)
Both methods are explained in the following sections.
27.2.6.2.1
Change lock settings directly via area #4
In memory area #4 the lock bits are located. They can be modified by writing to them. Each
SLBR
n
[SLB
m
] bit has a corresponding SLBR
n
[WE
m
] mask bit, which protects it from being modified.
This masking makes clear-modify-write operations unnecessary.
shows two modification examples. In the left example there is a write access to the SLBR
n
register specifying a mask value that allows modification of all SLBR
n
[SLB
m
] bits. The example on the
right specifies a mask that only allows modification of the bits SLBR
n
[SLB[3:1]].