target/arm_adi_v5,arm_dap: introduce multidrop_targetsel and its configuration
[openocd.git] / src / target / arm_adi_v5.h
index fa0a78a7e7227d3d92abe809d25121b4c9698865..1c96dc87ac8c0952d224c5702ef07473a98e0ef6 100644 (file)
 #define DP_APSEL_MAX        (255)
 #define DP_APSEL_INVALID    (-1)
 
+#define DP_TARGETSEL_INVALID 0xFFFFFFFFU
+#define DP_TARGETSEL_DPID_MASK 0x0FFFFFFFU
+#define DP_TARGETSEL_INSTANCEID_MASK 0xF0000000U
+#define DP_TARGETSEL_INSTANCEID_SHIFT 28
+
 
 /* MEM-AP register addresses */
 #define MEM_AP_REG_CSW         0x00
@@ -324,6 +329,13 @@ struct adiv5_dap {
        /** Flag saying whether to ignore the syspwrupack flag in DAP. Some devices
         *  do not set this bit until later in the bringup sequence */
        bool ignore_syspwrupack;
+
+       /** Value to select DP in SWD multidrop mode or DP_TARGETSEL_INVALID */
+       uint32_t multidrop_targetsel;
+       /** TPARTNO and TDESIGNER fields of multidrop_targetsel have been configured */
+       bool multidrop_dp_id_valid;
+       /** TINSTANCE field of multidrop_targetsel has been configured */
+       bool multidrop_instance_id_valid;
 };
 
 /**
@@ -610,6 +622,12 @@ static inline struct adiv5_ap *dap_ap(struct adiv5_dap *dap, uint8_t ap_num)
        return &dap->ap[ap_num];
 }
 
+/** Check if SWD multidrop configuration is valid */
+static inline bool dap_is_multidrop(struct adiv5_dap *dap)
+{
+       return dap->multidrop_dp_id_valid && dap->multidrop_instance_id_valid;
+}
+
 /* Lookup CoreSight component */
 int dap_lookup_cs_component(struct adiv5_ap *ap,
                        target_addr_t dbgbase, uint8_t type, target_addr_t *addr, int32_t *idx);

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)