6.1.4.2.1 eNVM Remap for Cortex-M3
An eNVM can have multiple firmware images located at any of the possible locations of the eNVM array. But any image can be accessed from the zero or base address location in the virtual view by remapping the eNVM. The AHB bus matrix, under the control of the SYSREG block, handles the eNVM remap, whereby a virtual eNVM view is presented to the AHB bus for accesses in the range from 0x00000000 to 0x1FFFFFFF.
Of all masters in a SmartFusion 2 device, only the Cortex-M3 processor ICode and DCode AHB busses access the eNVM in this range, which corresponds to its code space.
After reset, the AHB bus matrix must address the data at its physical address in the system memory map because it is not visible in the virtual map at this point. At the end of the boot process, the Cortex-M3 processor firmware writes into two SYSREG registers ENVM_CR and ENVM_REPMAP_BSASE_CR, which control eNVM remapping for the Cortex-M3 processor. This causes a specific segment of the eNVM array, of a specified size, to be remapped in the virtual view starting at address 0x00000000. This implies that if multiple firmware images are present, each may be built with the assumption that they are located at 0x00000000.
For example, consider that there are two firmware images: image0 and image1. After remap of image1, the virtual view of this image will be from 0x00000000 even though the physical address of the image starts at 0x60002000. The following figure shows this example representation of an eNVM remap after chip boot.
At the bottom of the remapped firmware image is the user boot code. This can call out to firmware services located at the top of eNVM. However, these services must be addressed by the firmware using the physical address of the firmware services.