arm_adi_v5: let dap_lookup_cs_component() to get AP dbgbase
[openocd.git] / src / target / arm_adi_v5.c
index 54d04abd62a4309ff965efaff2c6623b26f95891..d9544e9ebca68f576b8f66168dcca13174bd187b 100644 (file)
@@ -1002,7 +1002,7 @@ int dap_find_ap(struct adiv5_dap *dap, enum ap_type type_to_find, struct adiv5_a
        return ERROR_FAIL;
 }
 
-int dap_get_debugbase(struct adiv5_ap *ap,
+static int dap_get_debugbase(struct adiv5_ap *ap,
                        target_addr_t *dbgbase, uint32_t *apid)
 {
        struct adiv5_dap *dap = ap->dap;
@@ -1038,7 +1038,7 @@ int dap_get_debugbase(struct adiv5_ap *ap,
        return ERROR_OK;
 }
 
-int dap_lookup_cs_component(struct adiv5_ap *ap,
+static int _dap_lookup_cs_component(struct adiv5_ap *ap,
                        target_addr_t dbgbase, uint8_t type, target_addr_t *addr, int32_t *idx)
 {
        uint32_t romentry, entry_offset = 0, devtype;
@@ -1066,7 +1066,7 @@ int dap_lookup_cs_component(struct adiv5_ap *ap,
                        }
                        unsigned int class = (c_cid1 & ARM_CS_CIDR1_CLASS_MASK) >> ARM_CS_CIDR1_CLASS_SHIFT;
                        if (class == ARM_CS_CLASS_0X1_ROM_TABLE) {
-                               retval = dap_lookup_cs_component(ap, component_base,
+                               retval = _dap_lookup_cs_component(ap, component_base,
                                                        type, addr, idx);
                                if (retval == ERROR_OK)
                                        break;
@@ -1094,6 +1094,20 @@ int dap_lookup_cs_component(struct adiv5_ap *ap,
        return ERROR_OK;
 }
 
+int dap_lookup_cs_component(struct adiv5_ap *ap, uint8_t type,
+               target_addr_t *addr, int32_t core_id)
+{
+       int32_t idx = core_id;
+       target_addr_t dbgbase;
+       uint32_t apid;
+
+       int retval = dap_get_debugbase(ap, &dbgbase, &apid);
+       if (retval != ERROR_OK)
+               return retval;
+
+       return _dap_lookup_cs_component(ap, dbgbase, type, addr, &idx);
+}
+
 /** Holds registers and coordinates of a CoreSight component */
 struct cs_component_vals {
        struct adiv5_ap *ap;

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)