cortex_a: Add support for A7 MPCore 44/2344/2
authorAlexander Stein <alexander.stein@systec-electronic.com>
Tue, 14 Oct 2014 09:55:27 +0000 (11:55 +0200)
committerAndreas Fritiofson <andreas.fritiofson@gmail.com>
Sat, 10 Jan 2015 00:57:09 +0000 (00:57 +0000)
A7 MPCore needs unlocking the debug registers same as with A15 MPCore.
Found out by hacking on the code.

Change-Id: I613cb4fb35007b85b4a9a401577b47768bc1a08b
Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com>
Reviewed-on: http://openocd.zylin.com/2344
Tested-by: jenkins
Reviewed-by: Kamal Dasu <kamal.dasu@gmail.com>
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
src/target/cortex_a.c
src/target/cortex_a.h

index 3075055dc925f3ecc9e3aa4846859da05951dd62..6e0e52cfe78705dde6ae61af20eb45da6ed54a20 100644 (file)
@@ -208,6 +208,7 @@ static int cortex_a_init_debug_access(struct target *target)
                CORTEX_A_MIDR_PARTNUM_SHIFT;
 
        switch (cortex_part_num) {
+       case CORTEX_A7_PARTNUM:
        case CORTEX_A15_PARTNUM:
                retval = mem_ap_sel_read_atomic_u32(swjdp, armv7a->debug_ap,
                                                    armv7a->debug_base + CPUDBG_OSLSR,
@@ -2511,6 +2512,18 @@ static int cortex_a_examine_first(struct target *target)
                if (retval != ERROR_OK)
                        return retval;
 
+       }
+       /* Unlocking the debug registers */
+       if ((cpuid & CORTEX_A_MIDR_PARTNUM_MASK) >> CORTEX_A_MIDR_PARTNUM_SHIFT ==
+               CORTEX_A7_PARTNUM) {
+
+               retval = mem_ap_sel_write_atomic_u32(swjdp, armv7a->debug_ap,
+                                                    armv7a->debug_base + CPUDBG_OSLAR,
+                                                    0);
+
+               if (retval != ERROR_OK)
+                       return retval;
+
        }
        retval = mem_ap_sel_read_atomic_u32(swjdp, armv7a->debug_ap,
                                            armv7a->debug_base + CPUDBG_PRSR, &dbg_osreg);
index 043d96f92c183b52edccea0275fab36241d3c9b6..94d80f92bfe5d2493abd4746400b4451c4198f79 100644 (file)
@@ -35,6 +35,7 @@
 #define CORTEX_A_COMMON_MAGIC 0x411fc082
 #define CORTEX_A15_COMMON_MAGIC 0x413fc0f1
 
+#define CORTEX_A7_PARTNUM 0xc07
 #define CORTEX_A8_PARTNUM 0xc08
 #define CORTEX_A9_PARTNUM 0xc09
 #define CORTEX_A15_PARTNUM 0xc0f

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)