adiv6: read ROM Table address size 58/6458/5
authorKevin Burke <kevinb@os.amperecomputing.com>
Sat, 21 Aug 2021 21:59:38 +0000 (23:59 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Fri, 24 Jun 2022 21:35:08 +0000 (21:35 +0000)
Required for parsing ADIv6 ROM tables.

Split from change https://review.openocd.org/6077/

Change-Id: I849543b7b4a4455b10bd9fc7da38a37849d71700
Signed-off-by: Kevin Burke <kevinb@os.amperecomputing.com>
Signed-off-by: Daniel Goehring <dgoehrin@os.amperecomputing.com>
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/6458
Tested-by: jenkins
src/target/arm_adi_v5.h
src/target/arm_dap.c

index 7706fc935b31e56936f7a48e71bb01c989dc754a..4cba62ae18d8018014a0cb75338751b3d48915cc 100644 (file)
@@ -395,6 +395,9 @@ struct adiv5_dap {
 
        /** Indicates ADI version (5, 6 or 0 for unknown) being used */
        unsigned int adi_version;
+
+       /* ADIv6 only field indicating ROM Table address size */
+       unsigned int asize;
 };
 
 /**
index 59d577e7f0407cfe2b8a45a80950ad3936dc723f..d2e3f99972ab6518d177f975ff61c9c401b0f5fa 100644 (file)
@@ -140,6 +140,23 @@ static int dap_init_all(void)
                retval = dap->ops->connect(dap);
                if (retval != ERROR_OK)
                        return retval;
+
+               /* see if address size of ROM Table is greater than 32-bits */
+               if (is_adiv6(dap)) {
+                       uint32_t dpidr1;
+
+                       retval = dap->ops->queue_dp_read(dap, DP_DPIDR1, &dpidr1);
+                       if (retval != ERROR_OK) {
+                               LOG_ERROR("DAP read of DPIDR1 failed...");
+                               return retval;
+                       }
+                       retval = dap_run(dap);
+                       if (retval != ERROR_OK) {
+                               LOG_ERROR("DAP read of DPIDR1 failed...");
+                               return retval;
+                       }
+                       dap->asize = dpidr1 & DP_DPIDR1_ASIZE_MASK;
+               }
        }
 
        return ERROR_OK;

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)