Please note: We are aware of an issue affecting replies on the Arm Community forums, which may not be loading as expected.
We apologize for any inconvenience and appreciate your patience while we investigate and work to resolve the issue.
Thank you for your understanding.
Hi !
In order to call some functionality hard-coded in my board ROM (HAB from NXP i.MX6 board), I need to shut down the MMU: the ROM is not position independent. In particular, it is not always possible to map it and the devices correctly due to restriction in my OS.
I order to shutdown the MMU, I started first to shutdown and invalidate the I-Cache, BP and L1/L2 D cache, then I run the ROM code, and then I re-enable everything.
I was wondering if I could keep the I-Cache and BP activated running ROM code, and what was the correct code sequence ? At the moment I do the following:
I think I still need to invalidate I cache & BP before shutting down the MMU, but could I keep them enabled ? Or should I reenable them before calling the HAB ROM code ?
Best,
Vincent
You can have the I cache and branch predictor enabled when the MMU is disabled. However, ARMv7 requires BP maintenance when you do certain things - including enabling/disabling the MMU. See section B2.2.4 of the ARMv7-A/R Architecture Reference Manual, there is a sub-section called "Requirements for branch predictor maintenance operations".
ARM Architecture Reference Manual ARMv7-A and ARMv7-R edition
Thank you mweidmann for the information !