AnsweredAssumed Answered


Question asked by Bryan O'Donoghue on Oct 18, 2017
Latest reply on Oct 20, 2017 by Bryan O'Donoghue



Looking at u-boot for the i.MX6 we see the following addresses


+#define MX6DQ_PU_IROM_MMU_EN_VAR 0x009024a8
+#define MX6DLS_PU_IROM_MMU_EN_VAR 0x00901dd0
+#define MX6SL_PU_IROM_MMU_EN_VAR 0x00900a18


associated with this code


 * If the MMU is enabled, we have to notify the ROM
 * code, or it won't flush the caches when needed.
 * This is done, by setting the "pu_irom_mmu_enabled"
 * word to 1. You can find its address by looking in
 * the ROM map. This is critical for
 * authenticate_image(). If MMU is enabled, without
 * setting this bit, authentication will fail and may
 * crash.
 /* Check MMU enabled */
 if (get_cr() & CR_M) {
 if (is_cpu_type(MXC_CPU_MX6Q) ||
 is_cpu_type(MXC_CPU_MX6D)) {
 * This won't work on Rev 1.0.0 of
 * i.MX6Q/D, since their ROM doesn't
 * do cache flushes. don't think any
 * exist, so we ignore them.
 writel(1, MX6DQ_PU_IROM_MMU_EN_VAR);
 } else if (is_cpu_type(MXC_CPU_MX6DL) ||
 is_cpu_type(MXC_CPU_MX6SOLO)) {
 writel(1, MX6DLS_PU_IROM_MMU_EN_VAR);
 } else if (is_cpu_type(MXC_CPU_MX6SL)) {
 writel(1, MX6SL_PU_IROM_MMU_EN_VAR);


I'm getting a weird bug on i.MX7 where if I call authenticate_image() with dcache on for a particular image it never returns from ROM - however if I disable dcache before authenticate_image() and re-enable it directly after, the routine authenticates the image trouble free.


Is there a requirement to inform the IROM on i.MX7 in a similar fashion to i.MX6 in terms of writing a register to tell the IROM to perform a flush when MMU is on ?


I don't see the i.MX6 requirement documented nor do I see the above hard-coded addresses document for i.MX6 (perhaps I'm not looking in the right place) - which is why I'm asking for i.MX7.


If the i.MX7 requires a similar write to a register to tell IROM what to-do could NXP share that information - i.e. address location and appropriate bits to write ?


If not any insights as to why disabling dache before authenticate_image() should make a difference to the stability of the authenticate_image() callback would be highly appreciated.