summaryrefslogtreecommitdiff
path: root/src/target/arm_jtag.c
diff options
context:
space:
mode:
authordrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2006-08-31 12:41:49 +0000
committerdrath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2006-08-31 12:41:49 +0000
commit3acb107b9ae4e3d38d3fcfd29b455ebcfb444696 (patch)
treeb44896670fc255dad7c80d20321c3e1e0252f446 /src/target/arm_jtag.c
parentda9eedc0f2c338b8ad136a4436a7781edc4a8884 (diff)
downloadopenocd+libswd-3acb107b9ae4e3d38d3fcfd29b455ebcfb444696.tar.gz
openocd+libswd-3acb107b9ae4e3d38d3fcfd29b455ebcfb444696.tar.bz2
openocd+libswd-3acb107b9ae4e3d38d3fcfd29b455ebcfb444696.tar.xz
openocd+libswd-3acb107b9ae4e3d38d3fcfd29b455ebcfb444696.zip
- endianess fixes everywhere but in the flash code. flashing might still be broken on big-endian targets and/or hosts
- added access to ARM920T vector catch register (via generic register mechanism) - don't disable linefills on ARM920T cores - this lead to lockups when accessing lines already contained in cache - read content of ARM920T cache and tlb into file (arm920t read_flash/read_mmu commands) - memory reading improved on ARM7/9, can be further accelerated with new "arm7_9 fast_memory_access enable" command (renamed from fast_writes) - made in_handler independent from in field (makes the handler more flexible) - added timeout to ft2232 when using D2XX library - fixed STR7x protection bit handling on second bank (thanks to Bernard) - added support for using the OpenOCD on AT91RM9200 systems (thanks to Anders Larsen) - fixed AT91SAM7 flash handling when not running from 32kHz clock (thanks to Anders Larsen) git-svn-id: svn://svn.berlios.de/openocd/trunk@90 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/target/arm_jtag.c')
-rw-r--r--src/target/arm_jtag.c86
1 files changed, 83 insertions, 3 deletions
diff --git a/src/target/arm_jtag.c b/src/target/arm_jtag.c
index ccc1adf4..3bb8a32f 100644
--- a/src/target/arm_jtag.c
+++ b/src/target/arm_jtag.c
@@ -108,11 +108,91 @@ int arm_jtag_setup_connection(arm_jtag_t *jtag_info)
return ERROR_OK;
}
+/* read JTAG buffer into host-endian u32, flipping bit-order */
int arm_jtag_buf_to_u32_flip(u8 *in_buf, void *priv)
{
u32 *dest = priv;
-
- *dest = flip_u32(buf_get_u32(in_buf, 0, 32), 32);
-
+ *dest = flip_u32(le_to_h_u32(in_buf), 32);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into little-endian u32, flipping bit-order */
+int arm_jtag_buf_to_le32_flip(u8 *in_buf, void *priv)
+{
+ h_u32_to_le(((u8*)priv), flip_u32(le_to_h_u32(in_buf), 32));
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into little-endian u16, flipping bit-order */
+int arm_jtag_buf_to_le16_flip(u8 *in_buf, void *priv)
+{
+ h_u16_to_le(((u8*)priv), flip_u32(le_to_h_u32(in_buf), 32) & 0xffff);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into big-endian u32, flipping bit-order */
+int arm_jtag_buf_to_be32_flip(u8 *in_buf, void *priv)
+{
+ h_u32_to_be(((u8*)priv), flip_u32(le_to_h_u32(in_buf), 32));
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into big-endian u16, flipping bit-order */
+int arm_jtag_buf_to_be16_flip(u8 *in_buf, void *priv)
+{
+ h_u16_to_be(((u8*)priv), flip_u32(le_to_h_u32(in_buf), 32) & 0xffff);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into u8, flipping bit-order */
+int arm_jtag_buf_to_8_flip(u8 *in_buf, void *priv)
+{
+ u8 *dest = priv;
+ *dest = flip_u32(le_to_h_u32(in_buf), 32) & 0xff;
+ return ERROR_OK;
+}
+
+/* not-flipping variants */
+/* read JTAG buffer into host-endian u32 */
+int arm_jtag_buf_to_u32(u8 *in_buf, void *priv)
+{
+ u32 *dest = priv;
+ *dest = le_to_h_u32(in_buf);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into little-endian u32 */
+int arm_jtag_buf_to_le32(u8 *in_buf, void *priv)
+{
+ h_u32_to_le(((u8*)priv), le_to_h_u32(in_buf));
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into little-endian u16 */
+int arm_jtag_buf_to_le16(u8 *in_buf, void *priv)
+{
+ h_u16_to_le(((u8*)priv), le_to_h_u32(in_buf) & 0xffff);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into big-endian u32 */
+int arm_jtag_buf_to_be32(u8 *in_buf, void *priv)
+{
+ h_u32_to_be(((u8*)priv), le_to_h_u32(in_buf));
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into big-endian u16 */
+int arm_jtag_buf_to_be16(u8 *in_buf, void *priv)
+{
+ h_u16_to_be(((u8*)priv), le_to_h_u32(in_buf) & 0xffff);
+ return ERROR_OK;
+}
+
+/* read JTAG buffer into u8 */
+int arm_jtag_buf_to_8(u8 *in_buf, void *priv)
+{
+ u8 *dest = priv;
+ *dest = le_to_h_u32(in_buf) & 0xff;
return ERROR_OK;
}