diff options
| author | Ian McIntyre <me@mciantyre.dev> | 2026-02-11 16:29:27 -0500 |
|---|---|---|
| committer | Ian McIntyre <me@mciantyre.dev> | 2026-03-08 14:14:31 -0400 |
| commit | a9bb416c822d20c1b94fb7b2bfab282d25e11125 (patch) | |
| tree | 5dcf3e22c65a4422e71a103ca1afbe8b5f5e5e0c /.github | |
| parent | 57978b04a7e141e0f34bc24088771a6fedea634e (diff) | |
Preload RAM for ECC ciphers
Testing shows that we must blow fuses in order to activate either ECC
engine. Once the fuse is blown, NXP's boot ROM will enable the ECC
engine. So by the time the reset handler is running, ECC may already
be enabled.
The 32-bit copy loops won't work for initializing ITCM and OCRAM.
Since these bus widths are 64-bit and the ECC is computed over 64
bits, these 32 bit accesses result in a read-modify-write (RMW) on the
underlying interface. If these RAM regions aren't already initialized,
we'll fail an ECC check; the read in RMW compares bogus RAM contents
against a bogus ECC. This seems to dramatically slow down
initialization, or stall it (I've seen the CPU spinning in the boot
ROM).
If we listen to NXP and use 64-bit writes to preload ECC-protected RAM
regions, the 32-bit copy loops will work as expected. Note that we can
still issue 64-bit accesses towards DTCM; they're scattered across the
two 32-bit interfaces. There's an NXP whitepaper [1] describing that.
Once TCM ECC is enabled, we need to tell the TCM interfaces to RMW
smaller accesses. Otherwise, we won't generate correct ciphers. We
also might need to retry operations if there was a correction by the
RAM controller. We can perform these with predicated instructions.
Tested on an 1010EVK, where I used the debugger to show the control
registers weren't touched; and tested on the 1170EVK, with the same
approach showing the expected set bits.
[1]: https://www.nxp.com/docs/en/white-paper/CORTEXM7WP.pdf
[2]: https://www.nxp.com/docs/en/application-note/AN13204.pdf
Diffstat (limited to '.github')
0 files changed, 0 insertions, 0 deletions
