diff options
author | Luca Ellero <lroluk@gmail.com> | 2011-02-12 11:54:41 +0000 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2011-02-14 15:29:25 +0100 |
commit | bc404041c0ba1633506412cd1ca5ec6d7c16846a (patch) | |
tree | 941a77fad885b2e36ea93c9bae8c5f7acc7cfa0f /src | |
parent | dcc9624b980a25248d38e07636f7701a46673b5a (diff) | |
download | openocd+libswd-bc404041c0ba1633506412cd1ca5ec6d7c16846a.tar.gz openocd+libswd-bc404041c0ba1633506412cd1ca5ec6d7c16846a.tar.bz2 openocd+libswd-bc404041c0ba1633506412cd1ca5ec6d7c16846a.tar.xz openocd+libswd-bc404041c0ba1633506412cd1ca5ec6d7c16846a.zip |
arm_adi_v5: add wrapping transfer functions with selection of ap
Signed-off-by: Luca Ellero <lroluk@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/arm_adi_v5.c | 74 | ||||
-rw-r--r-- | src/target/arm_adi_v5.h | 2 |
2 files changed, 75 insertions, 1 deletions
diff --git a/src/target/arm_adi_v5.c b/src/target/arm_adi_v5.c index 2695c463..4a3cfbbb 100644 --- a/src/target/arm_adi_v5.c +++ b/src/target/arm_adi_v5.c @@ -882,6 +882,80 @@ int mem_ap_read_buf_u8(struct adiv5_dap *dap, uint8_t *buffer, return retval; } +/*--------------------------------------------------------------------*/ +/* Wrapping function with selection of AP */ +/*--------------------------------------------------------------------*/ +int mem_ap_sel_read_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint32_t address, uint32_t *value) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_read_u32(swjdp, address, value); +} + +int mem_ap_sel_write_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint32_t address, uint32_t value) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_write_u32(swjdp, address, value); +} + +int mem_ap_sel_read_atomic_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint32_t address, uint32_t *value) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_read_atomic_u32(swjdp, address, value); +} + +int mem_ap_sel_write_atomic_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint32_t address, uint32_t value) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_write_atomic_u32(swjdp, address, value); +} + +int mem_ap_sel_read_buf_u8(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_read_buf_u8(swjdp, buffer, count, address); +} + +int mem_ap_sel_read_buf_u16(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_read_buf_u16(swjdp, buffer, count, address); +} + +int mem_ap_sel_read_buf_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_read_buf_u32(swjdp, buffer, count, address); +} + +int mem_ap_sel_write_buf_u8(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_write_buf_u8(swjdp, buffer, count, address); +} + +int mem_ap_sel_write_buf_u16(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_write_buf_u16(swjdp, buffer, count, address); +} + +int mem_ap_sel_write_buf_u32(struct adiv5_dap *swjdp, uint8_t apsel, + uint8_t *buffer, int count, uint32_t address) +{ + dap_ap_select(swjdp, apsel); + return mem_ap_write_buf_u32(swjdp, buffer, count, address); +} + + /*--------------------------------------------------------------------------*/ diff --git a/src/target/arm_adi_v5.h b/src/target/arm_adi_v5.h index 2aefd605..b6c16b79 100644 --- a/src/target/arm_adi_v5.h +++ b/src/target/arm_adi_v5.h @@ -393,7 +393,7 @@ int mem_ap_sel_read_atomic_u32(struct adiv5_dap *swjdp, uint8_t apsel, int mem_ap_sel_write_atomic_u32(struct adiv5_dap *swjdp, uint8_t apsel, uint32_t address, uint32_t value); -/* MEM-AP memory mapped bus block transfers with selection of ap*/ +/* MEM-AP memory mapped bus block transfers with selection of ap */ int mem_ap_sel_read_buf_u8(struct adiv5_dap *swjdp, uint8_t apsel, uint8_t *buffer, int count, uint32_t address); int mem_ap_sel_read_buf_u16(struct adiv5_dap *swjdp, uint8_t apsel, |