summaryrefslogtreecommitdiff
path: root/src/jtag
diff options
context:
space:
mode:
authorntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-19 13:58:15 +0000
committerntfreak <ntfreak@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-12-19 13:58:15 +0000
commit9d1f95e01a4d273bd0e82a98719a4ea5ff435647 (patch)
treec860d08155ef6c3b4c6808dccc8d671a1f749758 /src/jtag
parente2c2b2d926e7827e4177d4c760ca76f22ab49241 (diff)
downloadopenocd+libswd-9d1f95e01a4d273bd0e82a98719a4ea5ff435647.tar.gz
openocd+libswd-9d1f95e01a4d273bd0e82a98719a4ea5ff435647.tar.bz2
openocd+libswd-9d1f95e01a4d273bd0e82a98719a4ea5ff435647.tar.xz
openocd+libswd-9d1f95e01a4d273bd0e82a98719a4ea5ff435647.zip
- fix rlink build under native win32 (mingw)
- remove rlink build warnings - add usb_set_configuration to rlink_init, win32 requires this - add win32 ETIMEDOUT define git-svn-id: svn://svn.berlios.de/openocd/trunk@1260 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/jtag')
-rw-r--r--src/jtag/rlink/init.m4148
-rw-r--r--src/jtag/rlink/rlink.c7
2 files changed, 79 insertions, 76 deletions
diff --git a/src/jtag/rlink/init.m4 b/src/jtag/rlink/init.m4
index 268462ff..3e64523c 100644
--- a/src/jtag/rlink/init.m4
+++ b/src/jtag/rlink/init.m4
@@ -1,74 +1,74 @@
-m4_divert(`-1')
-/***************************************************************************
- * Copyright (C) 2008 Lou Deluxe *
- * lou.openocd012@fixit.nospammail.net *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- ***************************************************************************/
-
-m4_undefine(`CTRL_MPEG_L')
-m4_undefine(`CTRL_CARD_L')
-
-m4_ifelse(SHIFTER_PRESCALER, 1, `
- m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x0')')
-')
-m4_ifelse(SHIFTER_PRESCALER, 2, `
- m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x2')')
- m4_define(`CTRL_CARD_L', `m4_eval(`0x8 | 0x1')')
-')
-m4_ifelse(SHIFTER_PRESCALER, 8, `
- m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x3')')
-')
-m4_ifelse(SHIFTER_PRESCALER, 11, `
- m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x4')')
-')
-m4_ifelse(SHIFTER_PRESCALER, 64, `
- m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x7')')
-')
-
-m4_ifdef(`CTRL_MPEG_L',,`
- m4_errprint(`SHIFTER_PRESCALER was not defined with a supported value
-') m4_m4exit(`1')
-')
-
-m4_divert(`0')m4_dnl
-
-init:
- A.H = 0
-
- A.L = 0
-
- DR_MPEG = A ; TDI and TCK start out low
- DR_CARD = A ; TMS starts out low
-
- A.L = 0x6
-
- CTRL_FCI = A ; MPEG and CARD driven by FCI
- DDR_MPEG = A ; TDI and TCK are outputs
-
- A.L = 0x1
-
- X = A ; X == 1
- DDR_CARD = A ; TMS is output
-
- A.L = CTRL_MPEG_L
- CTRL_MPEG = A
-m4_ifdef(`CTRL_CARD_L',
-` A.L = 'CTRL_CARD_L`
-')m4_dnl
- CTRL_CARD = A
-
- STATUS STOP
+m4_divert(`-1')
+/***************************************************************************
+ * Copyright (C) 2008 Lou Deluxe *
+ * lou.openocd012@fixit.nospammail.net *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+m4_undefine(`CTRL_MPEG_L')
+m4_undefine(`CTRL_CARD_L')
+
+m4_ifelse(SHIFTER_PRESCALER, 1, `
+ m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x0')')
+')
+m4_ifelse(SHIFTER_PRESCALER, 2, `
+ m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x2')')
+ m4_define(`CTRL_CARD_L', `m4_eval(`0x8 | 0x1')')
+')
+m4_ifelse(SHIFTER_PRESCALER, 8, `
+ m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x3')')
+')
+m4_ifelse(SHIFTER_PRESCALER, 11, `
+ m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x4')')
+')
+m4_ifelse(SHIFTER_PRESCALER, 64, `
+ m4_define(`CTRL_MPEG_L', `m4_eval(`0x8 | 0x7')')
+')
+
+m4_ifdef(`CTRL_MPEG_L',,`
+ m4_errprint(`SHIFTER_PRESCALER was not defined with a supported value
+') m4_m4exit(`1')
+')
+
+m4_divert(`0')m4_dnl
+
+init:
+ A.H = 0
+
+ A.L = 0
+
+ DR_MPEG = A ; TDI and TCK start out low
+ DR_CARD = A ; TMS starts out low
+
+ A.L = 0x6
+
+ CTRL_FCI = A ; MPEG and CARD driven by FCI
+ DDR_MPEG = A ; TDI and TCK are outputs
+
+ A.L = 0x1
+
+ X = A ; X == 1
+ DDR_CARD = A ; TMS is output
+
+ A.L = CTRL_MPEG_L
+ CTRL_MPEG = A
+m4_ifdef(`CTRL_CARD_L',
+` A.L = 'CTRL_CARD_L`
+')m4_dnl
+ CTRL_CARD = A
+
+ STATUS STOP
diff --git a/src/jtag/rlink/rlink.c b/src/jtag/rlink/rlink.c
index 911cefe7..dc75bdef 100644
--- a/src/jtag/rlink/rlink.c
+++ b/src/jtag/rlink/rlink.c
@@ -31,6 +31,7 @@
#include <errno.h>
#include <string.h>
#include <usb.h>
+#include <stdint.h>
/* project specific includes */
#include "log.h"
@@ -1034,7 +1035,6 @@ rlink_scan(
int tdi_bit_offset;
u8 tdi_mask, *tdi_p;
u8 dtc_mask;
- dtc_reply_queue_entry_t *rq_entry;
if(scan_size < 1) {
LOG_ERROR("scan_size cannot be less than 1 bit\n");
@@ -1555,7 +1555,7 @@ int rlink_init(void)
{
struct usb_bus *busses;
struct usb_bus *bus;
- int c, i, a, j, retries,len;
+ int i, j, retries;
int found=0;
int success=0;
u8 reply_buffer[USB_EP1IN_SIZE];
@@ -1597,6 +1597,9 @@ int rlink_init(void)
{
LOG_DEBUG("Opened device, pHDev = %p\n",pHDev);
+ /* usb_set_configuration required under win32 */
+ usb_set_configuration(pHDev, dev->config[0].bConfigurationValue);
+
retries = 3;
do
{