SPRUJ79 November 2024 F29H850TU
LINKs form the basis for context-sensitive memory protection. Each LINK represents one or more regions of executable code, and determines what data memory ranges (APRs) can be accessed by that code. Every code instruction that executes on the CPU has an associated LINK ID, which is assigned based on the memory region the instruction was fetched from. Thus, memory protections across the entire SoC can be automatically configured for each instruction at execution time, eliminating the need for software-based MPU reconfiguration.
The APx_CFG.LINKID register defines the execution LINK for all code that the CPU fetches from the APx memory address range. In addition, to enable code execution from an AP range, the user must configure the APx_CFG.XE (execution enable) bit. For data-only LINKs, make sure to set the XE bit to zero to preserve code safety. The SSU inputs the LINKID to the CPU when an instruction is fetched, and the CPU outputs the LINKID to the SSU whenever the CPU performs a data access to a memory location. The SSU compares the requesting LINKID to the access permissions for the APR containing the target memory address by examining the corresponding APx_ACCESS.LINKy register. If the permissions defined in the APx_ACCESS.LINKy do not authorize the requesting LINKID, then the SSU generates a fault to the CPU. If the memory region containing the address is governed by hardcoded protections (e.g. writable by LINK0, LINK1 or LINK2 only), the SSU checks the requested operation against the hardcoded protection, and generates a fault to the CPU if unauthorized. See Figure 10-4 for an illustration of how the SSU filters data access requests from the CPU using associated LINKIDs.
There are 16 LINKs per CPU. The SSU predefines and reserves the following special roles for the first three links:
All other LINKs are secondary user LINKs, and can be defined by the user application as required. LINK0, LINK1 and LINK2 have special hard-coded permissions. For more info, see Section 10.12.