summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorUtkarsh Gupta <utkarsh.gupta@nxp.com>2016-08-31 18:41:17 -0500
committerUtkarsh Gupta <utkarsh.gupta@nxp.com>2016-09-01 15:57:15 -0500
commit59dfb4293bab3dd75923ab06e68043603e3dcf4f (patch)
treee7597f4969f879d393b2dbc7e3544e191d1c009b /arch
parent6f7f185664a401f03f6ce6c81b996c1f27fdbe73 (diff)
downloadu-boot-imx-59dfb4293bab3dd75923ab06e68043603e3dcf4f.zip
u-boot-imx-59dfb4293bab3dd75923ab06e68043603e3dcf4f.tar.gz
u-boot-imx-59dfb4293bab3dd75923ab06e68043603e3dcf4f.tar.bz2
Disable MMU and Cache when using plugin
Signed-off-by: Utkarsh Gupta <utkarsh.gupta@nxp.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch-mx6/mx6_plugin.S28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-mx6/mx6_plugin.S b/arch/arm/include/asm/arch-mx6/mx6_plugin.S
index 1560a65..ed0fb58 100644
--- a/arch/arm/include/asm/arch-mx6/mx6_plugin.S
+++ b/arch/arm/include/asm/arch-mx6/mx6_plugin.S
@@ -92,6 +92,34 @@ before_calling_rom___pu_irom_hwcnfg_setup:
blx r4
after_calling_rom___pu_irom_hwcnfg_setup:
+/*
+ * ROM_API_HWCNFG_SETUP function enables MMU & Caches.
+ * Thus disable MMU & Caches.
+ */
+
+#define ENABLE_CACHE 0x01
+
+ MRC p15, 0, r0, c1, c0, 0 /* read CP15 register 1 into r0 */
+ ANDS r0, r0, #0x1 /* check if MMU is enabled */
+ BEQ mmu_disable_notreq /* exit if MMU is already disabled */
+
+/* Disable caches, MMU */
+ MRC p15, 0, r0, c1, c0, 0 /* read CP15 register 1 into r0 */
+ BIC r0, r0, #(ENABLE_CACHE << 2) /* disable D Cache */
+ BIC r0, r0, #0x1 /* clear bit 0 ; MMU off */
+
+ BIC r0, r0, #(0x1 << 11) /* disable Z, branch prediction */
+ BIC r0, r0, #(0x1 << 1) /* disable A, Strict alignment */
+ /* check enabled. */
+
+ MCR p15, 0, r0, c1, c0, 0 /* write CP15 register 1 */
+ MOV r0, r0
+ MOV r0, r0
+ MOV r0, r0
+ MOV r0, r0
+
+mmu_disable_notreq:
+ NOP
/* To return to ROM from plugin, we need to fill in these argument.
* Here is what need to do: