diff options
author | Tomas Vanek <vanekt@fbl.cz> | 2021-04-06 13:59:14 +0200 |
---|---|---|
committer | Antonio Borneo <borneo.antonio@gmail.com> | 2021-11-20 14:47:04 +0000 |
commit | b973a76d8663dec254084d0d86d93762a2873805 (patch) | |
tree | e76501e0d447693cb6dfbc4f37806f6e5c208fc0 /src/target/arm_adi_v5.h | |
parent | bb78fa10c77411bbdf665c17eac954b7741f2040 (diff) | |
download | riscv-openocd-b973a76d8663dec254084d0d86d93762a2873805.zip riscv-openocd-b973a76d8663dec254084d0d86d93762a2873805.tar.gz riscv-openocd-b973a76d8663dec254084d0d86d93762a2873805.tar.bz2 |
target/arm_adi_v5,arm_dap: introduce multidrop_targetsel and its configuration
Add multidrop_targetsel to struct adiv5_dap.
Add option -dp-id and -instance-id to dap create command.
Add convenience function dap_is_multidrop()
Change-Id: Ibb93abb5f50b3665c320a10c1497421035762134
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: https://review.openocd.org/c/openocd/+/6140
Tested-by: jenkins
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'src/target/arm_adi_v5.h')
-rw-r--r-- | src/target/arm_adi_v5.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index fa0a78a..1c96dc8 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -97,6 +97,11 @@ #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); |