25 assert(addr_end >=
addr || addr_end == 0);
34 uint32_t
count,
void *buf)
61 uint32_t
count,
void *buf)
66 uint8_t buffer_te[
sizeof(uint32_t)];
67 uint8_t halfword_te[
sizeof(uint16_t)];
81 for (i = 0; i <
count; i++) {
93 (
addr + i *
sizeof(uint16_t)) & ~3u, 4, 1);
95 (
addr + i *
sizeof(uint16_t)) & ~3u, 1, &buffer_he,
102 memcpy(buffer_te + ((
addr + i *
sizeof(uint16_t)) & 3u),
103 halfword_te,
sizeof(uint16_t));
108 (
addr + i *
sizeof(uint16_t)) & ~3u, 1, &buffer_he));
119 uint32_t
count,
void *buf)
124 uint8_t buffer_te[
sizeof(uint32_t)];
136 for (i = 0; i <
count; i++) {
143 memcpy(buffer_te + ((
addr + i) & 3), (uint8_t *)buf + i, 1);
177 tunnel = calloc(1,
count *
size *
sizeof(uint8_t));
199 }
else if (
size == 2) {
214 uint32_t
size, uint32_t
count,
void *buf)
238 uint32_t words_to_read, bytes_to_read;
256 words_to_read = bytes_to_read >> 2;
257 tunnel_he = calloc(1, bytes_to_read);
258 tunnel_te = calloc(1, bytes_to_read);
260 if (!tunnel_he || !tunnel_te) {
269 words_to_read, tunnel_he);
282 words_to_read, tunnel_he);
285 count *
sizeof(uint16_t));
289 words_to_read, tunnel_he);
int arc_cache_flush(struct target *target)
int arc_cache_invalidate(struct target *target)
static struct arc_common * target_to_arc(struct target *target)
#define CHECK_RETVAL(action)
int arc_jtag_read_memory(struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, uint32_t *buffer, bool slow_memory)
Read a sequence of 4-byte words from target memory.
int arc_jtag_write_memory(struct arc_jtag *jtag_info, uint32_t addr, uint32_t count, const uint32_t *buffer)
Write a sequence of 4-byte words into target memory.
int arc_mem_read(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int arc_mem_read_block(struct target *target, target_addr_t addr, uint32_t size, uint32_t count, void *buf)
int arc_mem_write(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
static int arc_mem_write_block32(struct target *target, uint32_t addr, uint32_t count, void *buf)
static int arc_mem_write_block16(struct target *target, uint32_t addr, uint32_t count, void *buf)
static bool arc_mem_is_slow_memory(struct arc_common *arc, uint32_t addr, uint32_t size, uint32_t count)
static int arc_mem_write_block8(struct target *target, uint32_t addr, uint32_t count, void *buf)
#define ERROR_COMMAND_SYNTAX_ERROR
uint64_t buffer
Pointer to data buffer to send over SPI.
uint32_t size
Size of dw_spi_transaction::buffer.
uint32_t address
Starting address. Sector aligned.
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_TARGET_DEBUG(target, fmt_str,...)
target_addr_t addr
Start address to search for the control block.
struct arc_jtag jtag_info
void target_buffer_get_u16_array(struct target *target, const uint8_t *buffer, uint32_t count, uint16_t *dstbuf)
void target_buffer_set_u16(struct target *target, uint8_t *buffer, uint16_t value)
void target_buffer_set_u32(struct target *target, uint8_t *buffer, uint32_t value)
void target_buffer_get_u32_array(struct target *target, const uint8_t *buffer, uint32_t count, uint32_t *dstbuf)
void target_buffer_set_u32_array(struct target *target, uint8_t *buffer, uint32_t count, const uint32_t *srcbuf)
uint32_t target_buffer_get_u32(struct target *target, const uint8_t *buffer)
#define ERROR_TARGET_UNALIGNED_ACCESS