Subject: Acorn32 start.S
To: Richard Earnshaw <rearnsha@arm.com>
From: Reinoud Zandijk <reinoud@13thmonkey.org>
List: port-arm
Date: 07/03/2007 18:00:53
--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Dear Richard, dear folks,

i'm confused about the correct procedure concerning MMU disabling on ARMv3 
and ARMv4. The data sheets i have for ARM610/ARM710 and SA don't mention 
what effect it will have on the instruction fetching. AFAIK its two 
instructions that are in the pipeline before the translation becomes 
effective.

The offending code is in src/sys/arch/acorn32/stand/boot32/start.S around 
line 83. Will the following patch fix the problem? or is something really 
wrong and should i split off ARMv3 and ARMv4 mmu disable code?

Index: start.S
===================================================================
RCS file: /cvsroot/src/sys/arch/acorn32/stand/boot32/start.S,v
retrieving revision 1.1
diff -u -r1.1 start.S
--- start.S     28 Dec 2002 23:57:37 -0000      1.1
+++ start.S     3 Jul 2007 15:51:02 -0000
@@ -81,8 +81,9 @@
        orr     r0, r0, #CPU_CONTROL_LABT_ENABLE | CPU_CONTROL_32BD_ENABLE 
| CPU_CONTROL_32BP_ENABLE
        mov     r13, r0                                                 /* save this control value in r13       */
        cmp     r14, #0
+       mcrne   15, 0, r0, c7, c5, 0                                    /* flush ARMv4 I cache                  */
        mcr     15, 0, r0, c1, c0, 0                                    /* write control register!              */
-/*1*/  mcrne   15, 0, r1, c7, c5, 0                                    /* write zero in ARMv4 MMU disable      */
+/*1*/  mov     r0, r0                                                  /* NOP                                  */
 /*2*/  mov     pc, r9                                                  /* branch to physical address           */
 
 relocate_code_physical_restart:

(r9 contains the physical address of relocate_code_physical_restart)

Would you like to have have a look at the start.S MMU code? i'd be very 
gratefull if we can get this piece of code right for once and for all.

With regards,
Reinoud


--opJtzjQTFsWo+cga
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (NetBSD)

iQEVAwUBRopyroKcNwBDyKpoAQJiwAf/Yj3zPDDDdcNKe6xEKldDRH9xPLANpl02
h4MIHWVuAzMizoMGWEpb3IQ0gsHr6R7CPFHHKhkUt9RlVncA6hvk6DuW9JDM2Zbh
MzJV56sPuNV3+4hi/p+e39sun6aDNMgX/wqSRh3uarqu5v5xLHmuU+p4j635CouL
+IZsi5UBH5sitSPHaEPeBZH6OwHYK0hyghyKh/UhYkaJekVcYa3Dkvr0twYv/Jv4
66SW7yxGb2cOlQXTeLznV7wg/70pE1dLOVUs1nIKWMU17b7KXD+e1Of9ZU8fMgtj
kQ/fm0cJP2VyQMyMo1+1QjPOxYnkWyjhzB6b53B36IJiZo9R6sr4DA==
=1wxa
-----END PGP SIGNATURE-----

--opJtzjQTFsWo+cga--