From bc404041c0ba1633506412cd1ca5ec6d7c16846a Mon Sep 17 00:00:00 2001 From: Luca Ellero Date: Sat, 12 Feb 2011 11:54:41 +0000 Subject: arm_adi_v5: add wrapping transfer functions with selection of ap Signed-off-by: Luca Ellero --- src/target/arm_adi_v5.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++ src/target/arm_adi_v5.h | 2 +- 2 files changed, 75 insertions(+), 1 deletion(-) (limited to 'src') 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, -- cgit v1.2.3