summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorSpencer Oliver <ntfreak@users.sourceforge.net>2010-03-08 22:54:18 +0000
committerSpencer Oliver <ntfreak@users.sourceforge.net>2010-03-10 21:03:22 +0000
commit257a764582f52235414b5c35717b0ee2b49d4b0d (patch)
treea27fc813a19942d0bee8c58fe170a9f838ea2294 /src/target
parentf10ed95a5ce6be416bcb2ec20826c6e508e4b622 (diff)
downloadopenocd_libswd-257a764582f52235414b5c35717b0ee2b49d4b0d.tar.gz
openocd_libswd-257a764582f52235414b5c35717b0ee2b49d4b0d.tar.bz2
openocd_libswd-257a764582f52235414b5c35717b0ee2b49d4b0d.tar.xz
openocd_libswd-257a764582f52235414b5c35717b0ee2b49d4b0d.zip
PIC32: add flash algorithm support
Add flash algorithm support for the PIC32MX. Still a few things todo but this dramatically decreases the programing time, eg. approx programming for 2.5k test file. - without fastload: 60secs - with fastload: 45secs - with fastload and algorithm: 2secs. Add new devices to supported list. Signed-off-by: Spencer Oliver <ntfreak@users.sourceforge.net>
Diffstat (limited to 'src/target')
-rw-r--r--src/target/mips32_pracc.c4
-rw-r--r--src/target/mips_ejtag.h4
-rw-r--r--src/target/mips_m4k.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/target/mips32_pracc.c b/src/target/mips32_pracc.c
index f20c69eb..bcba0f1d 100644
--- a/src/target/mips32_pracc.c
+++ b/src/target/mips32_pracc.c
@@ -969,7 +969,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
/* write program into RAM */
mips32_pracc_write_mem32(ejtag_info, source->address, ARRAY_SIZE(handler_code), handler_code);
- LOG_DEBUG("%s using 0x%.8" PRIx32 " for write handler\n", __func__, source->address);
+ LOG_DEBUG("%s using 0x%.8" PRIx32 " for write handler", __func__, source->address);
jmp_code[1] |= UPPER16(source->address);
jmp_code[2] |= LOWER16(source->address);
@@ -1030,7 +1030,7 @@ int mips32_pracc_fastdata_xfer(struct mips_ejtag *ejtag_info, struct working_are
mips_ejtag_drscan_32(ejtag_info, &address);
if (address != MIPS32_PRACC_TEXT)
- LOG_ERROR("mini program did not return to start\n");
+ LOG_ERROR("mini program did not return to start");
return retval;
}
diff --git a/src/target/mips_ejtag.h b/src/target/mips_ejtag.h
index 2f62f2be..5c1f2459 100644
--- a/src/target/mips_ejtag.h
+++ b/src/target/mips_ejtag.h
@@ -40,6 +40,10 @@
#define EJTAG_INST_TCBDATA 0x12
#define EJTAG_INST_BYPASS 0xFF
+/* microchip PIC32MX specific instructions */
+#define MTAP_SW_MTAP 0x04
+#define MTAP_SW_ETAP 0x05
+
/* ejtag control register bits ECR */
#define EJTAG_CTRL_TOF (1 << 1)
#define EJTAG_CTRL_TIF (1 << 2)
diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c
index f581ddf1..389daf97 100644
--- a/src/target/mips_m4k.c
+++ b/src/target/mips_m4k.c
@@ -914,7 +914,7 @@ int mips_m4k_examine(struct target *target)
{
/* we are using a pic32mx so select ejtag port
* as it is not selected by default */
- mips_ejtag_set_instr(ejtag_info, 0x05, NULL);
+ mips_ejtag_set_instr(ejtag_info, MTAP_SW_ETAP, NULL);
LOG_DEBUG("PIC32MX Detected - using EJTAG Interface");
}
}