Skip to content
Snippets Groups Projects
Commit d02dfff4 authored by Jie Zhang's avatar Jie Zhang Committed by Spencer Oliver
Browse files

etb: fix incorrect previous patchset


This corrects two issues found with openocd.
d7f71e7f removed some code that was
being used.

The above then caused even more code to get removed by commit 1cfb2287.

Signed-off-by: default avatarSpencer Oliver <ntfreak@users.sourceforge.net>
parent 69ac20a1
No related branches found
No related tags found
No related merge requests found
...@@ -304,20 +304,32 @@ static int etb_write_reg(struct reg *reg, uint32_t value) ...@@ -304,20 +304,32 @@ static int etb_write_reg(struct reg *reg, uint32_t value)
{ {
struct etb_reg *etb_reg = reg->arch_info; struct etb_reg *etb_reg = reg->arch_info;
uint8_t reg_addr = etb_reg->addr & 0x7f; uint8_t reg_addr = etb_reg->addr & 0x7f;
struct scan_field fields[3];
LOG_DEBUG("%i: 0x%8.8" PRIx32 "", (int)(etb_reg->addr), value); LOG_DEBUG("%i: 0x%8.8" PRIx32 "", (int)(etb_reg->addr), value);
etb_scann(etb_reg->etb, 0x0); etb_scann(etb_reg->etb, 0x0);
etb_set_instr(etb_reg->etb, 0xc); etb_set_instr(etb_reg->etb, 0xc);
fields[0].num_bits = 32;
uint8_t temp0[4]; uint8_t temp0[4];
fields[0].out_value = temp0;
buf_set_u32(&temp0, 0, 32, value); buf_set_u32(&temp0, 0, 32, value);
fields[0].in_value = NULL;
fields[1].num_bits = 7;
uint8_t temp1; uint8_t temp1;
fields[1].out_value = &temp1;
buf_set_u32(&temp1, 0, 7, reg_addr); buf_set_u32(&temp1, 0, 7, reg_addr);
fields[1].in_value = NULL;
fields[2].num_bits = 1;
uint8_t temp2; uint8_t temp2;
fields[2].out_value = &temp2;
buf_set_u32(&temp2, 0, 1, 1); buf_set_u32(&temp2, 0, 1, 1);
fields[2].in_value = NULL;
jtag_add_dr_scan(etb_reg->etb->tap, 3, fields, TAP_IDLE);
return ERROR_OK; return ERROR_OK;
} }
......
...@@ -79,7 +79,7 @@ int gdb_read_smp_packet(struct connection *connection, ...@@ -79,7 +79,7 @@ int gdb_read_smp_packet(struct connection *connection,
hex_buffer[2 * i + 1] = DIGITS[t & 0xf]; hex_buffer[2 * i + 1] = DIGITS[t & 0xf];
} }
gdb_put_packet(connection, hex_buffer, len * 2); retval = gdb_put_packet(connection, hex_buffer, len * 2);
free(hex_buffer); free(hex_buffer);
} }
...@@ -95,6 +95,7 @@ int gdb_write_smp_packet(struct connection *connection, ...@@ -95,6 +95,7 @@ int gdb_write_smp_packet(struct connection *connection,
{ {
char *separator; char *separator;
int coreid = 0; int coreid = 0;
int retval = ERROR_OK;
/* skip command character */ /* skip command character */
if (target->smp) if (target->smp)
...@@ -104,13 +105,13 @@ int gdb_write_smp_packet(struct connection *connection, ...@@ -104,13 +105,13 @@ int gdb_write_smp_packet(struct connection *connection,
packet+=2; packet+=2;
coreid = strtoul(packet, &separator, 16); coreid = strtoul(packet, &separator, 16);
target->gdb_service->core[1] = coreid; target->gdb_service->core[1] = coreid;
gdb_put_packet(connection, "OK", 2); retval = gdb_put_packet(connection, "OK", 2);
} }
} }
else else
{ {
gdb_put_packet(connection,"E01",3); retval = gdb_put_packet(connection,"E01",3);
} }
return ERROR_OK; return retval;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment