fet: don't send code memory start address with erase request.
Instead, use 0xfffe. This address is always within the range of main memory, and should allow the request to work even if the chip has been misidentified.
This commit is contained in:
parent
9f4bb5f303
commit
239fbb7f94
|
@ -65,9 +65,6 @@ struct fet_device {
|
|||
int flags;
|
||||
int version;
|
||||
|
||||
/* Device-specific information */
|
||||
address_t code_start;
|
||||
|
||||
uint8_t fet_buf[65538];
|
||||
int fet_len;
|
||||
|
||||
|
@ -501,7 +498,6 @@ static int xfer(struct fet_device *dev,
|
|||
static void show_dev_info(const char *name, const struct fet_device *dev)
|
||||
{
|
||||
printc("Device: %s\n", name);
|
||||
printc_dbg("Code memory starts at 0x%04x\n", dev->code_start);
|
||||
printc_dbg("Number of breakpoints: %d\n", dev->base.max_breakpoints);
|
||||
}
|
||||
|
||||
|
@ -520,7 +516,6 @@ static int identify_old(struct fet_device *dev)
|
|||
memcpy(idtext, dev->fet_reply.data + 4, 32);
|
||||
idtext[32] = 0;
|
||||
|
||||
dev->code_start = LE_WORD(dev->fet_reply.data, 0x24);
|
||||
dev->base.max_breakpoints = LE_WORD(dev->fet_reply.data, 0x2a);
|
||||
|
||||
show_dev_info(idtext, dev);
|
||||
|
@ -558,7 +553,6 @@ static int identify_new(struct fet_device *dev, const char *force_id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
dev->code_start = LE_WORD(r->msg29_data, 0);
|
||||
dev->base.max_breakpoints = r->msg29_data[0x14];
|
||||
|
||||
printc_dbg(" Code start address: 0x%x\n",
|
||||
|
@ -646,7 +640,7 @@ static int fet_erase(device_t dev_base, device_erase_type_t type,
|
|||
switch (type) {
|
||||
case DEVICE_ERASE_MAIN:
|
||||
fet_erase_type = FET_ERASE_MAIN;
|
||||
addr = dev->code_start;
|
||||
addr = 0xfffe;
|
||||
break;
|
||||
|
||||
case DEVICE_ERASE_SEGMENT:
|
||||
|
@ -655,7 +649,7 @@ static int fet_erase(device_t dev_base, device_erase_type_t type,
|
|||
|
||||
case DEVICE_ERASE_ALL:
|
||||
fet_erase_type = FET_ERASE_ALL;
|
||||
addr = dev->code_start;
|
||||
addr = 0xfffe;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue