You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
| 2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
| 2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
| 2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
| 2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
| 2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
| 2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
| 2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
| 2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
| 2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
| 2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
| 2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
| 2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
| 2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
| 2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
| 2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(54) |
Sep
(47) |
Oct
(15) |
Nov
(47) |
Dec
|
|
From: <oh...@ma...> - 2009-05-18 22:21:54
|
Author: oharboe
Date: 2009-05-18 22:21:53 +0200 (Mon, 18 May 2009)
New Revision: 1831
Modified:
trunk/src/jtag/bitbang.c
Log:
use tap_get_tms_path_len() instead of fix # of 7.
Modified: trunk/src/jtag/bitbang.c
===================================================================
--- trunk/src/jtag/bitbang.c 2009-05-18 19:33:00 UTC (rev 1830)
+++ trunk/src/jtag/bitbang.c 2009-05-18 20:21:53 UTC (rev 1831)
@@ -77,8 +77,9 @@
{
int i=0, tms=0;
u8 tms_scan = tap_get_tms_path(tap_get_state(), tap_get_end_state());
-
- for (i = skip; i < 7; i++)
+ int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
+
+ for (i = skip; i < tms_count; i++)
{
tms = (tms_scan >> i) & 1;
bitbang_interface->write(0, tms, 0);
|
|
From: <oh...@ma...> - 2009-05-18 21:33:05
|
Author: oharboe Date: 2009-05-18 21:33:00 +0200 (Mon, 18 May 2009) New Revision: 1830 Modified: trunk/TODO Log: removed solved mem2array problem. Added questions regarding ideas on making tcl-less builds of OpenOCD Modified: trunk/TODO =================================================================== --- trunk/TODO 2009-05-18 19:28:26 UTC (rev 1829) +++ trunk/TODO 2009-05-18 19:33:00 UTC (rev 1830) @@ -98,10 +98,10 @@ - investigate/implement "thin wrapper" to use eCos CFI drivers () - TCL - - mem2array bugs: - - Report: https://lists.berlios.de/pipermail/openocd-development/2009-May/006459.html - Isolate all TCL command support: - - Allow pure C CLI implementations using --disable-builtin-tcl + - Allow pure C CLI implementations using --disable-builtin-tcl. + Ref? How could this be made to work given targets extensive need + for events, etc.? What about the target library? - Allow full TCL support? add --with-tcl=/path/to/installed/tcl - Move TCL support in foo.* to foo_tcl.* (other ideas?) |
|
From: <oh...@ma...> - 2009-05-18 21:28:30
|
Author: oharboe Date: 2009-05-18 21:28:26 +0200 (Mon, 18 May 2009) New Revision: 1829 Modified: trunk/TODO Log: updated w/jtag_add_end_state() note. Modified: trunk/TODO =================================================================== --- trunk/TODO 2009-05-18 19:06:43 UTC (rev 1828) +++ trunk/TODO 2009-05-18 19:28:26 UTC (rev 1829) @@ -27,7 +27,12 @@ - update all drivers to use tap_get_tms_path_len API. - use tap_set_state everywhere to allow logging TAP state transitions - rename other tap_states to use standard JTAG names (suggested by ML) - - add TAP_UNKNOWN to augment TAP_INVALID? (suggested by ML/DH) + - retire jtag_add_end_state() and replace w/global variable. This also + removes TAP_INVALID as an argument to jtag_add_xxxx(). The global variable + as argument to jtag_add_xxxx() should eventually be phased out, but + the global variable is useful in an interim phase where one needs to + be bug by bug compatible before each change can be tested. Suggested + by . Michael Bruck also interested in this. - JTAG Interfaces: - autodetect devices present on the scan chain |
|
From: <zw...@ma...> - 2009-05-18 21:06:47
|
Author: zwelch
Date: 2009-05-18 21:06:43 +0200 (Mon, 18 May 2009)
New Revision: 1828
Modified:
trunk/TODO
Log:
Update The List with recent progress; remove developer list from TODO.
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2009-05-18 17:43:26 UTC (rev 1827)
+++ trunk/TODO 2009-05-18 19:06:43 UTC (rev 1828)
@@ -25,25 +25,21 @@
- JTAG/TAP changes:
- update all drivers to use tap_get_tms_path_len API.
- - link to posted patch: @missing
- - rework TAP state table (started but still needs work)
- - link to posted patch: @missing
- use tap_set_state everywhere to allow logging TAP state transitions
- rename other tap_states to use standard JTAG names (suggested by ML)
- - write script that automate production of the series of 16-17 patches
- - produce and distribute current series against the current trunk
- - distribute script so developers can use on WC through live commits
- - make live commits after giving sufficient notice to others
- add TAP_UNKNOWN to augment TAP_INVALID? (suggested by ML/DH)
- JTAG Interfaces:
- autodetect devices present on the scan chain
- implement 'discover_taps' command
- FT2232 driver: (DH)
- - integrate FTD2XX High-Speed Device Patch
- - link to posted patch: @missing
- - fix non-recoverability of cable connect/reconnect
- - link to posted patch: @missing
+ - integrate FTD2XX High-Speed Device support
+ - PATCH: https://lists.berlios.de/pipermail/openocd-development/2009-April/005479.html
+ - massive set of changes (DH):
+ - fixes non-recoverability of cable connect/reconnect
+ - https://lists.berlios.de/pipermail/openocd-development/2009-May/006011.html
+ - further cleanup (DH):
+ - PATCH: https://lists.berlios.de/pipermail/openocd-development/2009-May/006112.html
- fix outstanding bugs
- J-Link driver: (ZW)
- fix outstanding bugs
@@ -62,6 +58,8 @@
- SWD
- Target Support:
+ - general layer cleanup:
+ - https://lists.berlios.de/pipermail/openocd-development/2009-May/006590.html
- ARM11 improvements (MB?)
- fix single stepping (reported by )
- implement missing functionality (grep FNC_INFO_NOTIMPLEMENTED ...)
@@ -89,15 +87,14 @@
- other targets? (suggestions always welcome)
- CFI:
- - speed enhancements (posted Apr 22 by NC) (??)
- - link to patch: @missing
- finish implementing bus width/chip width handling (suggested by NC)
- - link to patch: @missing
- factor vendor-specific code into separate source files
- add new callback interface for vendor-specific code
- investigate/implement "thin wrapper" to use eCos CFI drivers ()
- TCL
+ - mem2array bugs:
+ - Report: https://lists.berlios.de/pipermail/openocd-development/2009-May/006459.html
- Isolate all TCL command support:
- Allow pure C CLI implementations using --disable-builtin-tcl
- Allow full TCL support? add --with-tcl=/path/to/installed/tcl
@@ -145,32 +142,4 @@
https://developer.berlios.de/patch/?group_id=4148
- use bug tracking? we need something!
-@verbatim
-==================================================================
-OpenOCD's Active Developers and Testers
-------------------------------------------------------------------
-
-** | Name | Status | Targets | Interfaces
----+-----------------+--------+------------------+----------------
-NC | Nico Coesel | * | AU1100 | *
-DE | Duane Ellis | * | * | *
-DH | Dick Hollenbeck | ? | * | FT2232
- | vind Harboe | * | * | ZY1000
-JK | Joern Keipf | * | * | FT2232H/FT4232HS?
-JW | Jeff Williams | ? | MC1322x | J-Link
-MA | Mariano Alvira | * | MC1322x | J-Link, FTDI
-MB | Michael Bruck | * | ARM11 | *
-ML | Magnus Lundin | * | * | *
-RA | Rick Altherr | * | * | *
-RD | Rene Doss | * | AT91SAM92xx | *
-SQ | Simon Qian | * | AVR | *
-ZW | Zach Welch | * | STR912 | J-Link
-
-Status Key:
-* - Active Contributor
-? - Missing In Action
-V - On Vacation
-
-@endverbatim
-
*/
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:43:28
|
Author: kc8apf
Date: 2009-05-18 19:43:26 +0200 (Mon, 18 May 2009)
New Revision: 1827
Modified:
trunk/src/jtag/jtag.c
Log:
Enable non-7-cycle state table for FT2232 and JLink
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:42:36 UTC (rev 1826)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:43:26 UTC (rev 1827)
@@ -3280,7 +3280,7 @@
#define B8(bits,count) { ((u8)B8__(HEX__(bits))), (count) }
-#if 0 && ((BUILD_FT2232_FTD2XX==1) || (BUILD_FT2232_LIBFTDI==1) || (BUILD_JLINK==1))
+#if 1 && ((BUILD_FT2232_FTD2XX==1) || (BUILD_FT2232_LIBFTDI==1) || (BUILD_JLINK==1))
/* this is the table submitted by Jeff Williams on 3/30/2009 with this comment:
OK, I added Peter's version of the state table, and it works OK for
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:42:37
|
Author: kc8apf
Date: 2009-05-18 19:42:36 +0200 (Mon, 18 May 2009)
New Revision: 1826
Modified:
trunk/src/jtag/jlink.c
Log:
JLink support for non-7-cycle state moves by Dick Hollenbeck <di...@so...>
Modified: trunk/src/jtag/jlink.c
===================================================================
--- trunk/src/jtag/jlink.c 2009-05-18 17:41:27 UTC (rev 1825)
+++ trunk/src/jtag/jlink.c 2009-05-18 17:42:36 UTC (rev 1826)
@@ -39,6 +39,11 @@
#define JLINK_USB_TIMEOUT 1000
// See Section 1.3.2 of the Segger JLink USB protocol manual
+/* 2048 is the max value we can use here */
+//#define JLINK_TAP_BUFFER_SIZE 2048
+#define JLINK_TAP_BUFFER_SIZE 256
+//#define JLINK_TAP_BUFFER_SIZE 384
+
#define JLINK_IN_BUFFER_SIZE 2048
#define JLINK_OUT_BUFFER_SIZE 2*2048+4
#define JLINK_EMU_RESULT_BUFFER_SIZE 64
@@ -412,6 +417,8 @@
tap_state_t saved_end_state = tap_get_end_state();
+ jlink_tap_ensure_space(1,num_cycles + 16);
+
/* only do a state_move when we're not already in IDLE */
if (tap_get_state() != TAP_IDLE)
{
@@ -438,7 +445,7 @@
{
tap_state_t saved_end_state;
- jlink_tap_ensure_space(1, scan_size + 8);
+ jlink_tap_ensure_space(1, scan_size + 16);
saved_end_state = tap_get_end_state();
@@ -604,8 +611,6 @@
/***************************************************************************/
/* J-Link tap functions */
-/* 2048 is the max value we can use here */
-#define JLINK_TAP_BUFFER_SIZE 1024
static unsigned tap_length=0;
static u8 tms_buffer[JLINK_TAP_BUFFER_SIZE];
@@ -634,7 +639,7 @@
static void jlink_tap_ensure_space(int scans, int bits)
{
int available_scans = MAX_PENDING_SCAN_RESULTS - pending_scan_results_length;
- int available_bits = JLINK_TAP_BUFFER_SIZE * 8 - tap_length - 64;
+ int available_bits = JLINK_TAP_BUFFER_SIZE * 8 - tap_length - 32;
if (scans > available_scans || bits > available_bits)
{
@@ -649,6 +654,7 @@
if (index >= JLINK_TAP_BUFFER_SIZE)
{
LOG_ERROR("jlink_tap_append_step: overflow");
+ *(u32 *)0xFFFFFFFF = 0;
exit(-1);
}
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:41:29
|
Author: kc8apf Date: 2009-05-18 19:41:27 +0200 (Mon, 18 May 2009) New Revision: 1825 Modified: trunk/src/jtag/ft2232.c Log: FT2232 support for non-7-cycle state moves by Dick Hollenbeck <di...@so...> Modified: trunk/src/jtag/ft2232.c =================================================================== --- trunk/src/jtag/ft2232.c 2009-05-18 17:40:42 UTC (rev 1824) +++ trunk/src/jtag/ft2232.c 2009-05-18 17:41:27 UTC (rev 1825) @@ -5,6 +5,9 @@ * Copyright (C) 2008 by Spencer Oliver * * sp...@sp... * * * +* Copyright (C) 2009 by SoftPLC Corporation. http://softplc.com * +* Dick Hollenbeck <di...@so...> * +* * * 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 * @@ -26,6 +29,9 @@ * found here: * http://www.ftdichip.com/Documents/AppNotes/AN2232C-01_MPSSE_Cmnd.pdf * Hereafter this is called the "MPSSE Spec". + * + * The datasheet for the ftdichip.com's FT2232D part is here: + * http://www.ftdichip.com/Documents/DataSheets/DS_FT2232D.pdf */ @@ -41,7 +47,14 @@ #include <windows.h> #endif +#include <assert.h> +#if (BUILD_FT2232_FTD2XX==1 && BUILD_FT2232_LIBFTDI==1) +#error "BUILD_FT2232_FTD2XX && BUILD_FT2232_LIBFTDI are mutually exclusive" +#elif(BUILD_FT2232_FTD2XX!=1 && BUILD_FT2232_LIBFTDI!=1) +#error "BUILD_FT2232_FTD2XX || BUILD_FT2232_LIBFTDI must be chosen" +#endif + /* FT2232 access library includes */ #if BUILD_FT2232_FTD2XX == 1 #include <ftd2xx.h> @@ -49,6 +62,9 @@ #include <ftdi.h> #endif +/* max TCK for the high speed devices 30000 kHz */ +#define FTDI_2232H_4232H_MAX_TCK 30000 + static int ft2232_execute_queue(void); static int ft2232_speed(int speed); @@ -76,12 +92,14 @@ static int ft2232_stableclocks(int num_cycles, jtag_command_t* cmd); -static char * ft2232_device_desc_A = NULL; -static char* ft2232_device_desc = NULL; -static char* ft2232_serial = NULL; -static char* ft2232_layout = NULL; -static unsigned char ft2232_latency = 2; +static char * ft2232_device_desc_A = NULL; +static char* ft2232_device_desc = NULL; +static char* ft2232_serial = NULL; +static char* ft2232_layout = NULL; +static u8 ft2232_latency = 2; +static unsigned ft2232_max_tck = 6000; + #define MAX_USB_IDS 8 /* vid = pid = 0 marks the end of the list */ static u16 ft2232_vid[MAX_USB_IDS + 1] = { 0x0403, 0 }; @@ -103,9 +121,9 @@ static int turtle_init(void); static int comstick_init(void); static int stm32stick_init(void); -static int axm0432_jtag_init(void); -static int sheevaplug_init(void); -static int icebear_jtag_init(void); +static int axm0432_jtag_init(void); +static int sheevaplug_init(void); +static int icebear_jtag_init(void); /* reset procedures for supported layouts */ static void usbjtag_reset(int trst, int srst); @@ -124,7 +142,7 @@ static void flyswatter_jtag_blink(void); static void turtle_jtag_blink(void); -ft2232_layout_t ft2232_layouts[] = +ft2232_layout_t ft2232_layouts[] = { { "usbjtag", usbjtag_init, usbjtag_reset, NULL }, { "jtagkey", jtagkey_init, jtagkey_reset, NULL }, @@ -152,7 +170,7 @@ static u8 high_direction = 0x0; #if BUILD_FT2232_FTD2XX == 1 -static FT_HANDLE ftdih = NULL; +static FT_HANDLE ftdih = NULL; #elif BUILD_FT2232_LIBFTDI == 1 static struct ftdi_context ftdic; #endif @@ -161,15 +179,143 @@ static jtag_command_t* first_unsent; /* next command that has to be sent */ static int require_send; + +/* http://urjtag.wiki.sourceforge.net/Cable+FT2232 says: + + "There is a significant difference between libftdi and libftd2xx. The latter + one allows to schedule up to 64*64 bytes of result data while libftdi fails + with more than 4*64. As a consequence, the FT2232 driver is forced to + perform around 16x more USB transactions for long command streams with TDO + capture when running with libftdi." + + No idea how we get + #define FT2232_BUFFER_SIZE 131072 + a comment would have been nice. +*/ + +#define FT2232_BUFFER_SIZE 131072 + static u8* ft2232_buffer = NULL; static int ft2232_buffer_size = 0; static int ft2232_read_pointer = 0; static int ft2232_expect_read = 0; -#define FT2232_BUFFER_SIZE 131072 -#define BUFFER_ADD ft2232_buffer[ft2232_buffer_size++] -#define BUFFER_READ ft2232_buffer[ft2232_read_pointer++] +/** + * Function buffer_write + * writes a byte into the byte buffer, "ft2232_buffer", which must be sent later. + * @param val is the byte to send. + */ +static inline void buffer_write( u8 val ) +{ + assert( ft2232_buffer ); + assert( (unsigned) ft2232_buffer_size < (unsigned) FT2232_BUFFER_SIZE ); + ft2232_buffer[ft2232_buffer_size++] = val; +} +/** + * Function buffer_read + * returns a byte from the byte buffer. + */ +static inline u8 buffer_read(void) +{ + assert( ft2232_buffer ); + assert( ft2232_read_pointer < ft2232_buffer_size ); + return ft2232_buffer[ft2232_read_pointer++]; +} + + +/** + * Function clock_tms + * clocks out \a bit_count bits on the TMS line, starting with the least + * significant bit of tms_bits and progressing to more significant bits. + * Rigorous state transition logging is done here via tap_set_state(). + * + * @param pmsse_cmd is one of the MPSSE TMS oriented commands such as 0x4b or 0x6b. See + * the MPSSE spec referenced above for their functionality. The MPSSE command + * "Clock Data to TMS/CS Pin (no Read)" is often used for this, 0x4b. + * + * @param tms_bits holds the sequence of bits to send. + * @param tms_count tells how many bits in the sequence. + * @param tdi_bit is a single bit which is passed on to TDI before the first TCK cycle + * and is held static for the duration of TMS clocking. See the MPSSE spec referenced above. + */ +static void clock_tms( u8 mpsse_cmd, int tms_bits, int tms_count, bool tdi_bit ) +{ + u8 tms_byte; + int i; + int tms_ndx; /* bit index into tms_byte */ + + assert( tms_count > 0 ); + +// LOG_DEBUG("mpsse cmd=%02x, tms_bits=0x%08x, bit_count=%d", mpsse_cmd, tms_bits, tms_count ); + + for (tms_byte = tms_ndx = i = 0; i < tms_count; ++i, tms_bits>>=1) + { + bool bit = tms_bits & 1; + + if(bit) + tms_byte |= (1<<tms_ndx); + + /* always do state transitions in public view */ + tap_set_state( tap_state_transition(tap_get_state(), bit) ); + + /* we wrote a bit to tms_byte just above, increment bit index. if bit was zero + also increment. + */ + ++tms_ndx; + + if( tms_ndx==7 || i==tms_count-1 ) + { + buffer_write( mpsse_cmd ); + buffer_write( tms_ndx - 1 ); + + /* Bit 7 of the byte is passed on to TDI/DO before the first TCK/SK of + TMS/CS and is held static for the duration of TMS/CS clocking. + */ + buffer_write( tms_byte | (tdi_bit << 7) ); + } + } +} + + +/** + * Function get_tms_buffer_requirements + * returns what clock_tms() will consume if called with + * same \a bit_count. + */ +static inline int get_tms_buffer_requirements( int bit_count ) +{ + return ((bit_count + 6)/7) * 3; +} + + +/** + * Function move_to_state + * moves the TAP controller from the current state to a + * \a goal_state through a path given by tap_get_tms_path(). State transition + * logging is performed by delegation to clock_tms(). + * + * @param goal_state is the destination state for the move. + */ +static void move_to_state( tap_state_t goal_state ) +{ + tap_state_t start_state = tap_get_state(); + + /* goal_state is 1/2 of a tuple/pair of states which allow convenient + lookup of the required TMS pattern to move to this state from the + start state. + */ + + /* do the 2 lookups */ + int tms_bits = tap_get_tms_path(start_state, goal_state); + int tms_count = tap_get_tms_path_len(start_state, goal_state); + + DEBUG_JTAG_IO( "start=%s goal=%s", tap_state_name(start_state), tap_state_name(goal_state) ); + + clock_tms( 0x4b, tms_bits, tms_count, 0 ); +} + + jtag_interface_t ft2232_interface = { .name = "ft2232", @@ -186,7 +332,7 @@ { #if BUILD_FT2232_FTD2XX == 1 FT_STATUS status; - DWORD dw_bytes_written; + DWORD dw_bytes_written; if ( ( status = FT_Write(ftdih, buf, size, &dw_bytes_written) ) != FT_OK ) { *bytes_written = dw_bytes_written; @@ -269,7 +415,7 @@ int retval; u32 bytes_written; - buf[0] = 0x86; /* command "set divisor" */ + buf[0] = 0x86; /* command "set divisor" */ buf[1] = speed & 0xff; /* valueL (0=6MHz, 1=3MHz, 2=2.0MHz, ...*/ buf[2] = (speed >> 8) & 0xff; /* valueH */ @@ -290,7 +436,7 @@ * AN2232C-01 Command Processor for * MPSSE and MCU Host Bus. Chapter 3.8 */ - *khz = 6000 / (1 + speed); + *khz = ft2232_max_tck / (1 + speed); return ERROR_OK; } @@ -311,9 +457,9 @@ * We will calc here with a multiplier * of 10 for better rounding later. */ - /* Calc speed, (6000 / khz) - 1 */ + /* Calc speed, (ft2232_max_tck / khz) - 1 */ /* Use 65000 for better rounding */ - *jtag_speed = (60000 / khz) - 10; + *jtag_speed = ((ft2232_max_tck*10) / khz) - 10; /* Add 0.9 for rounding */ *jtag_speed += 9; @@ -359,7 +505,7 @@ tap_set_end_state(state); else { - LOG_ERROR("BUG: %i is not a valid end state", state); + LOG_ERROR("BUG: %s is not a stable end state", tap_state_name(state)); exit(-1); } } @@ -373,19 +519,19 @@ while (num_bytes-- > 1) { - buffer[cur_byte] = BUFFER_READ; - cur_byte++; + buffer[cur_byte++] = buffer_read(); bits_left -= 8; } buffer[cur_byte] = 0x0; + /* There is one more partial byte left from the clock data in/out instructions */ if (bits_left > 1) { - buffer[cur_byte] = BUFFER_READ >> 1; + buffer[cur_byte] = buffer_read() >> 1; } - - buffer[cur_byte] = ( buffer[cur_byte] | ( (BUFFER_READ & 0x02) << 6 ) ) >> (8 - bits_left); + /* This shift depends on the length of the clock data to tms instruction, insterted at end of the scan, now fixed to a two step transition in ft2232_add_scan */ + buffer[cur_byte] = ( buffer[cur_byte] | ( ( (buffer_read()) << 1 ) & 0x80 )) >> (8 - bits_left); } @@ -529,46 +675,44 @@ } -static void ft2232_add_pathmove(pathmove_command_t* cmd) +/** + * Function ft2232_add_pathmove + * moves the TAP controller from the current state to a new state through the + * given path, where path is an array of tap_state_t's. + * + * @param path is an array of tap_stat_t which gives the states to traverse through + * ending with the last state at path[num_states-1] + * @param num_states is the count of state steps to move through + */ +static void ft2232_add_pathmove( tap_state_t* path, int num_states ) { - int num_states = cmd->num_states; - int state_count = 0; + int tms_bits = 0; + int state_ndx; + tap_state_t walker = tap_get_state(); - while (num_states) + assert( (unsigned) num_states <= 32u ); /* tms_bits only holds 32 bits */ + + /* this loop verifies that the path is legal and logs each state in the path */ + for( state_ndx = 0; state_ndx < num_states; ++state_ndx ) { - u8 tms_byte = 0; /* zero this on each MPSSE batch */ + tap_state_t desired_next_state = path[state_ndx]; - int bit_count = 0; - - int num_states_batch = num_states > 7 ? 7 : num_states; - - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; - - /* number of states remaining */ - BUFFER_ADD = num_states_batch - 1; - - while (num_states_batch--) + if (tap_state_transition(walker, false) == desired_next_state ) + ; /* bit within tms_bits at index state_ndx is already zero */ + else if (tap_state_transition(walker, true) == desired_next_state ) + tms_bits |= (1<<state_ndx); + else { - if (tap_state_transition(tap_get_state(), false) == cmd->path[state_count]) - buf_set_u32(&tms_byte, bit_count++, 1, 0x0); - else if (tap_state_transition(tap_get_state(), true) == cmd->path[state_count]) - buf_set_u32(&tms_byte, bit_count++, 1, 0x1); - else - { - LOG_ERROR( "BUG: %s -> %s isn't a valid TAP transition", tap_state_name( - tap_get_state() ), tap_state_name(cmd->path[state_count]) ); - exit(-1); - } - - tap_set_state(cmd->path[state_count]); - state_count++; - num_states--; + LOG_ERROR( "BUG: %s -> %s isn't a valid TAP transition", + tap_state_name(walker), tap_state_name(desired_next_state) ); + exit(-1); } - BUFFER_ADD = tms_byte; + walker = desired_next_state; } - + + clock_tms( 0x4b, tms_bits, num_states, 0 ); + tap_set_end_state(tap_get_state()); } @@ -580,26 +724,19 @@ int cur_byte = 0; int last_bit; - if ( !( ( !ir_scan && (tap_get_state() == TAP_DRSHIFT) ) - || ( ir_scan && (tap_get_state() == TAP_IRSHIFT) ) ) ) + if ( !ir_scan ) { - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; - - BUFFER_ADD = 0x6; /* scan 7 bits */ - - /* TMS data bits */ - if (ir_scan) + if (tap_get_state() != TAP_DRSHIFT) { - BUFFER_ADD = tap_get_tms_path(tap_get_state(), TAP_IRSHIFT); - tap_set_state(TAP_IRSHIFT); + move_to_state( TAP_DRSHIFT ); } - else + } + else + { + if (tap_get_state() != TAP_IRSHIFT) { - BUFFER_ADD = tap_get_tms_path(tap_get_state(), TAP_DRSHIFT); - tap_set_state(TAP_DRSHIFT); + move_to_state( TAP_IRSHIFT ); } - /* LOG_DEBUG("added TMS scan (no read)"); */ } /* add command for complete bytes */ @@ -609,34 +746,34 @@ if (type == SCAN_IO) { /* Clock Data Bytes In and Out LSB First */ - BUFFER_ADD = 0x39; + buffer_write( 0x39 ); /* LOG_DEBUG("added TDI bytes (io %i)", num_bytes); */ } else if (type == SCAN_OUT) { /* Clock Data Bytes Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x19; + buffer_write( 0x19 ); /* LOG_DEBUG("added TDI bytes (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bytes In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x28; + buffer_write( 0x28 ); /* LOG_DEBUG("added TDI bytes (i %i)", num_bytes); */ } thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1); num_bytes -= thisrun_bytes; - BUFFER_ADD = (thisrun_bytes - 1) & 0xff; - BUFFER_ADD = ( (thisrun_bytes - 1) >> 8 ) & 0xff; + buffer_write( (u8) (thisrun_bytes - 1) ); + buffer_write( (u8) ((thisrun_bytes - 1) >> 8) ); + if (type != SCAN_IN) { /* add complete bytes */ while (thisrun_bytes-- > 0) { - BUFFER_ADD = buffer[cur_byte]; - cur_byte++; + buffer_write( buffer[cur_byte++] ); bits_left -= 8; } } @@ -658,24 +795,25 @@ if (type == SCAN_IO) { /* Clock Data Bits In and Out LSB First */ - BUFFER_ADD = 0x3b; + buffer_write( 0x3b ); /* LOG_DEBUG("added TDI bits (io) %i", bits_left - 1); */ } else if (type == SCAN_OUT) { /* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x1b; + buffer_write( 0x1b ); /* LOG_DEBUG("added TDI bits (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x2a; + buffer_write( 0x2a ); /* LOG_DEBUG("added TDI bits (i %i)", bits_left - 1); */ } - BUFFER_ADD = bits_left - 2; + + buffer_write( bits_left - 2 ); if (type != SCAN_IN) - BUFFER_ADD = buffer[cur_byte]; + buffer_write( buffer[cur_byte] ); } if ( ( ir_scan && (tap_get_end_state() == TAP_IRSHIFT) ) @@ -684,44 +822,57 @@ if (type == SCAN_IO) { /* Clock Data Bits In and Out LSB First */ - BUFFER_ADD = 0x3b; + buffer_write( 0x3b ); /* LOG_DEBUG("added TDI bits (io) %i", bits_left - 1); */ } else if (type == SCAN_OUT) { /* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x1b; + buffer_write( 0x1b ); /* LOG_DEBUG("added TDI bits (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x2a; + buffer_write( 0x2a ); /* LOG_DEBUG("added TDI bits (i %i)", bits_left - 1); */ } - BUFFER_ADD = 0x0; - BUFFER_ADD = last_bit; + buffer_write( 0x0 ); + buffer_write( last_bit ); } else { + int tms_bits; + int tms_count; + u8 mpsse_cmd; + /* move from Shift-IR/DR to end state */ if (type != SCAN_OUT) { + /* We always go to the PAUSE state in two step at the end of an IN or IO scan */ + /* This must be coordinated with the bit shifts in ft2232_read_scan */ + tms_bits = 0x01; + tms_count = 2; /* Clock Data to TMS/CS Pin with Read */ - BUFFER_ADD = 0x6b; + mpsse_cmd = 0x6b; /* LOG_DEBUG("added TMS scan (read)"); */ } else { + tms_bits = tap_get_tms_path( tap_get_state(), tap_get_end_state() ); + tms_count = tap_get_tms_path_len( tap_get_state(), tap_get_end_state() ); /* Clock Data to TMS/CS Pin (no Read) */ - BUFFER_ADD = 0x4b; + mpsse_cmd = 0x4b; /* LOG_DEBUG("added TMS scan (no read)"); */ } - BUFFER_ADD = 0x6; /* scan 7 bits */ - BUFFER_ADD = tap_get_tms_path( tap_get_state(), tap_get_end_state() ) | (last_bit << 7); - tap_set_state( tap_get_end_state() ); + clock_tms( mpsse_cmd, tms_bits, tms_count, last_bit ); } + + if (tap_get_state() != tap_get_end_state()) + { + move_to_state( tap_get_end_state() ); + } } @@ -746,14 +897,7 @@ if (tap_get_state() != TAP_DRSHIFT) { - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; - - BUFFER_ADD = 0x6; /* scan 7 bits */ - - /* TMS data bits */ - BUFFER_ADD = tap_get_tms_path(tap_get_state(), TAP_DRSHIFT); - tap_set_state(TAP_DRSHIFT); + move_to_state( TAP_DRSHIFT ); } if ( ( retval = ft2232_write(ft2232_buffer, ft2232_buffer_size, &bytes_written) ) != ERROR_OK ) @@ -772,34 +916,34 @@ if (type == SCAN_IO) { /* Clock Data Bytes In and Out LSB First */ - BUFFER_ADD = 0x39; + buffer_write( 0x39 ); /* LOG_DEBUG("added TDI bytes (io %i)", num_bytes); */ } else if (type == SCAN_OUT) { /* Clock Data Bytes Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x19; + buffer_write( 0x19 ); /* LOG_DEBUG("added TDI bytes (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bytes In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x28; + buffer_write( 0x28 ); /* LOG_DEBUG("added TDI bytes (i %i)", num_bytes); */ } thisrun_bytes = (num_bytes > 65537) ? 65536 : (num_bytes - 1); thisrun_read = thisrun_bytes; num_bytes -= thisrun_bytes; - BUFFER_ADD = (thisrun_bytes - 1) & 0xff; - BUFFER_ADD = ( (thisrun_bytes - 1) >> 8 ) & 0xff; + buffer_write( (u8) (thisrun_bytes - 1) ); + buffer_write( (u8) ( (thisrun_bytes - 1) >> 8 )); if (type != SCAN_IN) { /* add complete bytes */ while (thisrun_bytes-- > 0) { - BUFFER_ADD = buffer[cur_byte]; + buffer_write( buffer[cur_byte] ); cur_byte++; bits_left -= 8; } @@ -843,24 +987,24 @@ if (type == SCAN_IO) { /* Clock Data Bits In and Out LSB First */ - BUFFER_ADD = 0x3b; + buffer_write( 0x3b ); /* LOG_DEBUG("added TDI bits (io) %i", bits_left - 1); */ } else if (type == SCAN_OUT) { /* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x1b; + buffer_write( 0x1b ); /* LOG_DEBUG("added TDI bits (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x2a; + buffer_write( 0x2a ); /* LOG_DEBUG("added TDI bits (i %i)", bits_left - 1); */ } - BUFFER_ADD = bits_left - 2; + buffer_write( bits_left - 2 ); if (type != SCAN_IN) - BUFFER_ADD = buffer[cur_byte]; + buffer_write( buffer[cur_byte] ); if (type != SCAN_OUT) thisrun_read += 2; @@ -871,42 +1015,45 @@ if (type == SCAN_IO) { /* Clock Data Bits In and Out LSB First */ - BUFFER_ADD = 0x3b; + buffer_write( 0x3b ); /* LOG_DEBUG("added TDI bits (io) %i", bits_left - 1); */ } else if (type == SCAN_OUT) { /* Clock Data Bits Out on -ve Clock Edge LSB First (no Read) */ - BUFFER_ADD = 0x1b; + buffer_write( 0x1b ); /* LOG_DEBUG("added TDI bits (o)"); */ } else if (type == SCAN_IN) { /* Clock Data Bits In on +ve Clock Edge LSB First (no Write) */ - BUFFER_ADD = 0x2a; + buffer_write( 0x2a ); /* LOG_DEBUG("added TDI bits (i %i)", bits_left - 1); */ } - BUFFER_ADD = 0x0; - BUFFER_ADD = last_bit; + buffer_write( 0x0 ); + buffer_write( last_bit ); } else { + int tms_bits = tap_get_tms_path( tap_get_state(), tap_get_end_state() ); + int tms_count = tap_get_tms_path_len( tap_get_state(), tap_get_end_state() ); + u8 mpsse_cmd; + /* move from Shift-IR/DR to end state */ if (type != SCAN_OUT) { /* Clock Data to TMS/CS Pin with Read */ - BUFFER_ADD = 0x6b; + mpsse_cmd = 0x6b; /* LOG_DEBUG("added TMS scan (read)"); */ } else { /* Clock Data to TMS/CS Pin (no Read) */ - BUFFER_ADD = 0x4b; + mpsse_cmd = 0x4b; /* LOG_DEBUG("added TMS scan (no read)"); */ } - BUFFER_ADD = 0x6; - BUFFER_ADD = tap_get_tms_path( tap_get_state(), tap_get_end_state() ) | (last_bit << 7); - tap_set_state( tap_get_end_state() ); + + clock_tms( mpsse_cmd, tms_bits, tms_count, last_bit ); } if (type != SCAN_OUT) @@ -941,12 +1088,13 @@ int num_bytes = (scan_size - 1) / 8; if (tap_get_state() != TAP_DRSHIFT) - predicted_size += 3; + predicted_size += get_tms_buffer_requirements( tap_get_tms_path_len( tap_get_state(), TAP_DRSHIFT) ); if (type == SCAN_IN) /* only from device to host */ { /* complete bytes */ predicted_size += CEIL(num_bytes, 65536) * 3; + /* remaining bits - 1 (up to 7) */ predicted_size += ( (scan_size - 1) % 8 ) ? 2 : 0; } @@ -954,6 +1102,7 @@ { /* complete bytes */ predicted_size += num_bytes + CEIL(num_bytes, 65536) * 3; + /* remaining bits -1 (up to 7) */ predicted_size += ( (scan_size - 1) % 8 ) ? 3 : 0; } @@ -1017,9 +1166,9 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x80; - BUFFER_ADD = low_output; - BUFFER_ADD = low_direction; + buffer_write( 0x80 ); + buffer_write( low_output ); + buffer_write( low_direction ); } @@ -1056,9 +1205,9 @@ } /* command "set data bits high byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1091,9 +1240,9 @@ } /* command "set data bits high byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1121,9 +1270,9 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1150,9 +1299,9 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x80; - BUFFER_ADD = low_output; - BUFFER_ADD = low_direction; + buffer_write( 0x80 ); + buffer_write( low_output ); + buffer_write( low_direction ); LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction); } @@ -1171,9 +1320,9 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x80; - BUFFER_ADD = low_output; - BUFFER_ADD = low_direction; + buffer_write( 0x80 ); + buffer_write( low_output ); + buffer_write( low_direction ); LOG_DEBUG("srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", srst, low_output, low_direction); } @@ -1199,9 +1348,9 @@ } /* command "set data bits high byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1228,14 +1377,14 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x80; - BUFFER_ADD = low_output; - BUFFER_ADD = low_direction; + buffer_write( 0x80 ); + buffer_write( low_output ); + buffer_write( low_direction ); /* command "set data bits high byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1255,9 +1404,9 @@ high_output |= nSRSTnOE; /* command "set data bits high byte" */ - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } @@ -1266,7 +1415,7 @@ int retval; retval = ERROR_OK; - DEBUG_JTAG_IO("end_state: %i", cmd->cmd.end_state->end_state); + DEBUG_JTAG_IO("execute_end_state: %s", tap_state_name(cmd->cmd.end_state->end_state) ); if (cmd->cmd.end_state->end_state != TAP_INVALID) ft2232_end_state(cmd->cmd.end_state->end_state); @@ -1282,9 +1431,10 @@ int predicted_size = 0; retval = ERROR_OK; - DEBUG_JTAG_IO("runtest %i cycles, end in %i", + DEBUG_JTAG_IO("runtest %i cycles, end in %s", cmd->cmd.runtest->num_cycles, - cmd->cmd.runtest->end_state); + tap_state_name(cmd->cmd.runtest->end_state)); + /* only send the maximum buffer size that FT2232C can handle */ predicted_size = 0; if (tap_get_state() != TAP_IDLE) @@ -1303,27 +1453,24 @@ } if (tap_get_state() != TAP_IDLE) { - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; - BUFFER_ADD = 0x6; /* scan 7 bits */ - - /* TMS data bits */ - BUFFER_ADD = tap_get_tms_path(tap_get_state(), TAP_IDLE); - tap_set_state(TAP_IDLE); + move_to_state( TAP_IDLE ); require_send = 1; } i = cmd->cmd.runtest->num_cycles; while (i > 0) { + /* there are no state transitions in this code, so omit state tracking */ + /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; + buffer_write( 0x4b ); /* scan 7 bits */ - BUFFER_ADD = (i > 7) ? 6 : (i - 1); + buffer_write( (i > 7) ? 6 : (i - 1) ); /* TMS data bits */ - BUFFER_ADD = 0x0; + buffer_write( 0x0 ); tap_set_state(TAP_IDLE); + i -= (i > 7) ? 7 : i; /* LOG_DEBUG("added TMS scan (no read)"); */ } @@ -1333,15 +1480,9 @@ if ( tap_get_state() != tap_get_end_state() ) { - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; - /* scan 7 bit */ - BUFFER_ADD = 0x6; - /* TMS data bits */ - BUFFER_ADD = tap_get_tms_path( tap_get_state(), tap_get_end_state() ); - tap_set_state( tap_get_end_state() ); - /* LOG_DEBUG("added TMS scan (no read)"); */ + move_to_state( tap_get_end_state() ); } + require_send = 1; #ifdef _DEBUG_JTAG_IO_ LOG_DEBUG( "runtest: %i, end in %s", cmd->cmd.runtest->num_cycles, tap_state_name( tap_get_end_state() ) ); @@ -1350,11 +1491,11 @@ return retval; } + static int ft2232_execute_statemove(jtag_command_t *cmd) { - int retval; - int predicted_size = 0; - retval = ERROR_OK; + int predicted_size = 0; + int retval = ERROR_OK; DEBUG_JTAG_IO("statemove end in %i", cmd->cmd.statemove->end_state); @@ -1370,61 +1511,60 @@ if (cmd->cmd.statemove->end_state != TAP_INVALID) ft2232_end_state(cmd->cmd.statemove->end_state); - /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; + /* move to end state */ + if ( tap_get_state() != tap_get_end_state() ) + { + move_to_state( tap_get_end_state() ); + require_send = 1; + } - BUFFER_ADD = 0x6; /* scan 7 bits */ - - /* TMS data bits */ - BUFFER_ADD = tap_get_tms_path( tap_get_state(), tap_get_end_state() ); - /* LOG_DEBUG("added TMS scan (no read)"); */ - tap_set_state( tap_get_end_state() ); - require_send = 1; -#ifdef _DEBUG_JTAG_IO_ - LOG_DEBUG( "statemove: %s", tap_state_name( tap_get_end_state() ) ); -#endif - return retval; } static int ft2232_execute_pathmove(jtag_command_t *cmd) { - int retval; - int predicted_size = 0; - retval = ERROR_OK; + int predicted_size = 0; + int retval = ERROR_OK; - DEBUG_JTAG_IO("pathmove: %i states, end in %i", - cmd->cmd.pathmove->num_states, - cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]); + tap_state_t* path = cmd->cmd.pathmove->path; + int num_states = cmd->cmd.pathmove->num_states; + + DEBUG_JTAG_IO("pathmove: %i states, current: %s end: %s", num_states, + tap_state_name( tap_get_state() ), + tap_state_name( path[num_states-1] ) + ); + /* only send the maximum buffer size that FT2232C can handle */ - predicted_size = 3 * CEIL(cmd->cmd.pathmove->num_states, 7); + predicted_size = 3 * CEIL(num_states, 7); if (ft2232_buffer_size + predicted_size + 1 > FT2232_BUFFER_SIZE) { if (ft2232_send_and_recv(first_unsent, cmd) != ERROR_OK) - retval = ERROR_JTAG_QUEUE_FAILED; + retval = ERROR_JTAG_QUEUE_FAILED; + require_send = 0; first_unsent = cmd; } - ft2232_add_pathmove(cmd->cmd.pathmove); + + ft2232_add_pathmove( path, num_states ); require_send = 1; -#ifdef _DEBUG_JTAG_IO_ - LOG_DEBUG( "pathmove: %i states, end in %s", cmd->cmd.pathmove->num_states, - tap_state_name(cmd->cmd.pathmove->path[cmd->cmd.pathmove->num_states - 1]) ); -#endif + return retval; } + static int ft2232_execute_scan(jtag_command_t *cmd) { - int retval; u8* buffer; int scan_size; /* size of IR or DR scan */ - enum scan_type type; int predicted_size = 0; - retval = ERROR_OK; + int retval = ERROR_OK; + enum scan_type type = jtag_scan_type(cmd->cmd.scan); + + DEBUG_JTAG_IO( "%s type:%d", cmd->cmd.scan->ir_scan ? "IRSCAN" : "DRSCAN", type ); + scan_size = jtag_build_buffer(cmd->cmd.scan, &buffer); - type = jtag_scan_type(cmd->cmd.scan); + predicted_size = ft2232_predict_scan_out(scan_size, type); if ( (predicted_size + 1) > FT2232_BUFFER_SIZE ) { @@ -1544,17 +1684,17 @@ switch (cmd->type) { - case JTAG_END_STATE: retval = ft2232_execute_end_state(cmd); break; - case JTAG_RESET: retval = ft2232_execute_reset(cmd); break; - case JTAG_RUNTEST: retval = ft2232_execute_runtest(cmd); break; - case JTAG_STATEMOVE: retval = ft2232_execute_statemove(cmd); break; - case JTAG_PATHMOVE: retval = ft2232_execute_pathmove(cmd); break; - case JTAG_SCAN: retval = ft2232_execute_scan(cmd); break; - case JTAG_SLEEP: retval = ft2232_execute_sleep(cmd); break; - case JTAG_STABLECLOCKS: retval = ft2232_execute_stableclocks(cmd); break; - default: - LOG_ERROR("BUG: unknown JTAG command type encountered"); - exit(-1); + case JTAG_END_STATE: retval = ft2232_execute_end_state(cmd); break; + case JTAG_RESET: retval = ft2232_execute_reset(cmd); break; + case JTAG_RUNTEST: retval = ft2232_execute_runtest(cmd); break; + case JTAG_STATEMOVE: retval = ft2232_execute_statemove(cmd); break; + case JTAG_PATHMOVE: retval = ft2232_execute_pathmove(cmd); break; + case JTAG_SCAN: retval = ft2232_execute_scan(cmd); break; + case JTAG_SLEEP: retval = ft2232_execute_sleep(cmd); break; + case JTAG_STABLECLOCKS: retval = ft2232_execute_stableclocks(cmd); break; + default: + LOG_ERROR("BUG: unknown JTAG command type encountered"); + exit(-1); } return retval; } @@ -1604,10 +1744,10 @@ #if BUILD_FT2232_FTD2XX == 1 static int ft2232_init_ftd2xx(u16 vid, u16 pid, int more, int* try_more) { - FT_STATUS status; - DWORD openex_flags = 0; - char* openex_string = NULL; - u8 latency_timer; + FT_STATUS status; + DWORD openex_flags = 0; + char* openex_string = NULL; + u8 latency_timer; LOG_DEBUG("'ft2232' interface using FTD2XX with '%s' layout (%4.4x:%4.4x)", ft2232_layout, vid, pid); @@ -1785,6 +1925,7 @@ return ERROR_JTAG_INIT_FAILED; } + /* There is already a reset in ftdi_usb_open_desc, this should be redundant */ if (ftdi_usb_reset(&ftdic) < 0) { LOG_ERROR("unable to reset ftdi device"); @@ -1835,6 +1976,15 @@ ft2232_layout_t* cur_layout = ft2232_layouts; int i; + if (tap_get_tms_path_len(TAP_IRPAUSE,TAP_IRPAUSE)==7) + { + LOG_DEBUG("ft2232 interface using 7 step jtag state transitions"); + } + else + { + LOG_DEBUG("ft2232 interface using shortest path jtag state transitions"); + + } if ( (ft2232_layout == NULL) || (ft2232_layout[0] == 0) ) { ft2232_layout = "usbjtag"; @@ -2395,7 +2545,7 @@ if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) { - LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); + LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); return ERROR_JTAG_INIT_FAILED; } @@ -2423,7 +2573,7 @@ if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) { - LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); + LOG_ERROR("couldn't initialize FT2232 with 'sheevaplug' layout"); return ERROR_JTAG_INIT_FAILED; } @@ -2446,9 +2596,9 @@ high_output |= 0x08; } - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); } @@ -2459,9 +2609,9 @@ */ high_output ^= 0x0c; - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); } @@ -2479,9 +2629,9 @@ high_output = 0x08; } - BUFFER_ADD = 0x82; - BUFFER_ADD = high_output; - BUFFER_ADD = high_direction; + buffer_write( 0x82 ); + buffer_write( high_output ); + buffer_write( high_direction ); } @@ -2639,14 +2789,16 @@ first_unsent = cmd; } + /* there are no state transitions in this code, so omit state tracking */ + /* command "Clock Data to TMS/CS Pin (no Read)" */ - BUFFER_ADD = 0x4b; + buffer_write( 0x4b ); /* scan 7 bit */ - BUFFER_ADD = bitcount_per_command - 1; + buffer_write( bitcount_per_command - 1 ); /* TMS data bits are either all zeros or ones to stay in the current stable state */ - BUFFER_ADD = tms; + buffer_write( tms ); require_send = 1; @@ -2656,6 +2808,7 @@ return retval; } + /* --------------------------------------------------------------------- * Support for IceBear JTAG adapter from Section5: * http://section5.ch/icebear @@ -2752,8 +2905,9 @@ } /* command "set data bits low byte" */ - BUFFER_ADD = 0x80; - BUFFER_ADD = low_output; - BUFFER_ADD = low_direction; + buffer_write( 0x80 ); + buffer_write( low_output ); + buffer_write( low_direction ); + LOG_DEBUG("trst: %i, srst: %i, low_output: 0x%2.2x, low_direction: 0x%2.2x", trst, srst, low_output, low_direction); } |
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:40:44
|
Author: kc8apf Date: 2009-05-18 19:40:42 +0200 (Mon, 18 May 2009) New Revision: 1824 Modified: trunk/src/jtag/jtag.c Log: Fix fallout from r1818 Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-05-18 17:29:59 UTC (rev 1823) +++ trunk/src/jtag/jtag.c 2009-05-18 17:40:42 UTC (rev 1824) @@ -868,7 +868,7 @@ } /* field_count represents the true number of fields setup*/ - (*last_cmd)->cmd.scan->num_fields = field_count; + cmd->cmd.scan->num_fields = field_count; return ERROR_OK; } |
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:30:01
|
Author: kc8apf Date: 2009-05-18 19:29:59 +0200 (Mon, 18 May 2009) New Revision: 1823 Modified: trunk/src/jtag/jtag.c Log: Change last_comand_pointer to last_command_pointer by Michael Bruck <mb...@di...> Modified: trunk/src/jtag/jtag.c =================================================================== --- trunk/src/jtag/jtag.c 2009-05-18 17:29:18 UTC (rev 1822) +++ trunk/src/jtag/jtag.c 2009-05-18 17:29:59 UTC (rev 1823) @@ -89,7 +89,7 @@ jtag_command_t *jtag_command_queue = NULL; -jtag_command_t **last_comand_pointer = &jtag_command_queue; +jtag_command_t **last_command_pointer = &jtag_command_queue; static jtag_tap_t *jtag_all_taps = NULL; enum reset_types jtag_reset_config = RESET_NONE; @@ -436,7 +436,7 @@ return &cmd->next;*/ - return last_comand_pointer; + return last_command_pointer; } @@ -450,7 +450,7 @@ (*last_cmd)->next = NULL; - last_comand_pointer = &((*last_cmd)->next); + last_command_pointer = &((*last_cmd)->next); } @@ -1557,7 +1557,7 @@ jtag_callback_queue_tail = NULL; jtag_command_queue = NULL; - last_comand_pointer = &jtag_command_queue; + last_command_pointer = &jtag_command_queue; return retval; } |
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:29:20
|
Author: kc8apf
Date: 2009-05-18 19:29:18 +0200 (Mon, 18 May 2009)
New Revision: 1822
Modified:
trunk/src/svf/svf.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [8/8]
Modified: trunk/src/svf/svf.c
===================================================================
--- trunk/src/svf/svf.c 2009-05-18 17:29:01 UTC (rev 1821)
+++ trunk/src/svf/svf.c 2009-05-18 17:29:18 UTC (rev 1822)
@@ -695,9 +695,8 @@
}
// not good to use this
-extern jtag_command_t** jtag_get_last_command_p(void);
extern void* cmd_queue_alloc(size_t size);
-extern jtag_command_t **last_comand_pointer;
+extern void jtag_queue_command(jtag_command_t * cmd);
static int svf_run_command(struct command_context_s *cmd_ctx, char *cmd_str)
{
@@ -707,9 +706,6 @@
// tmp variable
int i_tmp;
- // not good to use this
- jtag_command_t **last_cmd;
-
// for RUNTEST
int run_count;
float min_time, max_time;
@@ -1180,15 +1176,15 @@
// enter into run_state if necessary
if (last_state != svf_para.runtest_run_state)
{
- last_cmd = jtag_get_last_command_p();
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_STATEMOVE;
- (*last_cmd)->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
- (*last_cmd)->cmd.statemove->end_state = svf_para.runtest_run_state;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_STATEMOVE;
+ cmd->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
+ cmd->cmd.statemove->end_state = svf_para.runtest_run_state;
- cmd_queue_end_state = cmd_queue_cur_state = (*last_cmd)->cmd.statemove->end_state;
+ cmd_queue_end_state = cmd_queue_cur_state = cmd->cmd.statemove->end_state;
}
// call jtag_add_clocks
@@ -1197,15 +1193,14 @@
if (svf_para.runtest_end_state != svf_para.runtest_run_state)
{
// move to end_state
- last_cmd = jtag_get_last_command_p();
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_STATEMOVE;
- (*last_cmd)->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
- (*last_cmd)->cmd.statemove->end_state = svf_para.runtest_end_state;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
+ cmd->type = JTAG_STATEMOVE;
+ cmd->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
+ cmd->cmd.statemove->end_state = svf_para.runtest_end_state;
- cmd_queue_end_state = cmd_queue_cur_state = (*last_cmd)->cmd.statemove->end_state;
+ cmd_queue_end_state = cmd_queue_cur_state = cmd->cmd.statemove->end_state;
}
last_state = svf_para.runtest_end_state;
#else
@@ -1294,15 +1289,15 @@
if (svf_tap_state_is_stable(state))
{
// TODO: move to state
- last_cmd = jtag_get_last_command_p();
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_STATEMOVE;
- (*last_cmd)->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
- (*last_cmd)->cmd.statemove->end_state = state;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_STATEMOVE;
+ cmd->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
+ cmd->cmd.statemove->end_state = state;
- cmd_queue_end_state = cmd_queue_cur_state = (*last_cmd)->cmd.statemove->end_state;
+ cmd_queue_end_state = cmd_queue_cur_state = cmd->cmd.statemove->end_state;
last_state = state;
LOG_DEBUG("\tmove to %s by state_move", svf_tap_state_name[state]);
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:29:02
|
Author: kc8apf
Date: 2009-05-18 19:29:01 +0200 (Mon, 18 May 2009)
New Revision: 1821
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [7/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:28:42 UTC (rev 1820)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:29:01 UTC (rev 1821)
@@ -1015,17 +1015,17 @@
int MINIDRIVER(interface_jtag_add_tlr)(void)
{
tap_state_t state = TAP_RESET;
- jtag_command_t **last_cmd = jtag_get_last_command_p();
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_STATEMOVE;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
- (*last_cmd)->cmd.statemove->end_state = state;
+ jtag_queue_command(cmd);
+ cmd->type = JTAG_STATEMOVE;
+
+ cmd->cmd.statemove = cmd_queue_alloc(sizeof(statemove_command_t));
+ cmd->cmd.statemove->end_state = state;
+
return ERROR_OK;
}
@@ -1069,39 +1069,36 @@
int MINIDRIVER(interface_jtag_add_pathmove)(int num_states, tap_state_t *path)
{
- jtag_command_t **last_cmd = jtag_get_last_command_p();
- int i;
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_PATHMOVE;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t));
- (*last_cmd)->cmd.pathmove->num_states = num_states;
- (*last_cmd)->cmd.pathmove->path = cmd_queue_alloc(sizeof(tap_state_t) * num_states);
+ jtag_queue_command(cmd);
- for (i = 0; i < num_states; i++)
- (*last_cmd)->cmd.pathmove->path[i] = path[i];
+ cmd->type = JTAG_PATHMOVE;
+ cmd->cmd.pathmove = cmd_queue_alloc(sizeof(pathmove_command_t));
+ cmd->cmd.pathmove->num_states = num_states;
+ cmd->cmd.pathmove->path = cmd_queue_alloc(sizeof(tap_state_t) * num_states);
+
+ for (int i = 0; i < num_states; i++)
+ cmd->cmd.pathmove->path[i] = path[i];
+
return ERROR_OK;
}
int MINIDRIVER(interface_jtag_add_runtest)(int num_cycles, tap_state_t state)
{
- jtag_command_t **last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_RUNTEST;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.runtest = cmd_queue_alloc(sizeof(runtest_command_t));
- (*last_cmd)->cmd.runtest->num_cycles = num_cycles;
- (*last_cmd)->cmd.runtest->end_state = state;
+ jtag_queue_command(cmd);
+ cmd->type = JTAG_RUNTEST;
+
+ cmd->cmd.runtest = cmd_queue_alloc(sizeof(runtest_command_t));
+ cmd->cmd.runtest->num_cycles = num_cycles;
+ cmd->cmd.runtest->end_state = state;
+
return ERROR_OK;
}
@@ -1120,16 +1117,16 @@
int MINIDRIVER(interface_jtag_add_clocks)( int num_cycles )
{
- jtag_command_t **last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_STABLECLOCKS;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.stableclocks = cmd_queue_alloc(sizeof(stableclocks_command_t));
- (*last_cmd)->cmd.stableclocks->num_cycles = num_cycles;
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_STABLECLOCKS;
+
+ cmd->cmd.stableclocks = cmd_queue_alloc(sizeof(stableclocks_command_t));
+ cmd->cmd.stableclocks->num_cycles = num_cycles;
+
return ERROR_OK;
}
@@ -1260,18 +1257,17 @@
int MINIDRIVER(interface_jtag_add_reset)(int req_trst, int req_srst)
{
- jtag_command_t **last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_RESET;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.reset = cmd_queue_alloc(sizeof(reset_command_t));
- (*last_cmd)->cmd.reset->trst = req_trst;
- (*last_cmd)->cmd.reset->srst = req_srst;
+ jtag_queue_command(cmd);
+ cmd->type = JTAG_RESET;
+
+ cmd->cmd.reset = cmd_queue_alloc(sizeof(reset_command_t));
+ cmd->cmd.reset->trst = req_trst;
+ cmd->cmd.reset->srst = req_srst;
+
return ERROR_OK;
}
@@ -1286,17 +1282,16 @@
int MINIDRIVER(interface_jtag_add_sleep)(u32 us)
{
- jtag_command_t **last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_SLEEP;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->cmd.sleep = cmd_queue_alloc(sizeof(sleep_command_t));
- (*last_cmd)->cmd.sleep->us = us;
+ jtag_queue_command(cmd);
+ cmd->type = JTAG_SLEEP;
+
+ cmd->cmd.sleep = cmd_queue_alloc(sizeof(sleep_command_t));
+ cmd->cmd.sleep->us = us;
+
return ERROR_OK;
}
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:28:44
|
Author: kc8apf
Date: 2009-05-18 19:28:42 +0200 (Mon, 18 May 2009)
New Revision: 1820
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [6/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:28:21 UTC (rev 1819)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:28:42 UTC (rev 1820)
@@ -975,30 +975,28 @@
int MINIDRIVER(interface_jtag_add_plain_dr_scan)(int num_fields, scan_field_t *fields, tap_state_t state)
{
- int i;
- jtag_command_t **last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_SCAN;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_SCAN;
+
/* allocate memory for scan command */
- (*last_cmd)->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
- (*last_cmd)->cmd.scan->ir_scan = false;
- (*last_cmd)->cmd.scan->num_fields = num_fields;
- (*last_cmd)->cmd.scan->fields = cmd_queue_alloc(num_fields * sizeof(scan_field_t));
- (*last_cmd)->cmd.scan->end_state = state;
+ cmd->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
+ cmd->cmd.scan->ir_scan = false;
+ cmd->cmd.scan->num_fields = num_fields;
+ cmd->cmd.scan->fields = cmd_queue_alloc(num_fields * sizeof(scan_field_t));
+ cmd->cmd.scan->end_state = state;
- for (i = 0; i < num_fields; i++)
+ for (int i = 0; i < num_fields; i++)
{
int num_bits = fields[i].num_bits;
int num_bytes = CEIL(fields[i].num_bits, 8);
- (*last_cmd)->cmd.scan->fields[i].tap = fields[i].tap;
- (*last_cmd)->cmd.scan->fields[i].num_bits = num_bits;
- (*last_cmd)->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits);
- (*last_cmd)->cmd.scan->fields[i].in_value = fields[i].in_value;
+ cmd->cmd.scan->fields[i].tap = fields[i].tap;
+ cmd->cmd.scan->fields[i].num_bits = num_bits;
+ cmd->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits);
+ cmd->cmd.scan->fields[i].in_value = fields[i].in_value;
}
return ERROR_OK;
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:28:28
|
Author: kc8apf
Date: 2009-05-18 19:28:21 +0200 (Mon, 18 May 2009)
New Revision: 1819
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [5/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:28:00 UTC (rev 1818)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:28:21 UTC (rev 1819)
@@ -883,7 +883,6 @@
int scan_size;
int bypass_devices = 0;
- jtag_command_t **last_cmd = jtag_get_last_command_p();
jtag_tap_t *tap;
/* count devices in bypass */
@@ -900,17 +899,18 @@
}
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_SCAN;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_SCAN;
+
/* allocate memory for dr scan command */
- (*last_cmd)->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
- (*last_cmd)->cmd.scan->ir_scan = false;
- (*last_cmd)->cmd.scan->num_fields = num_fields + bypass_devices;
- (*last_cmd)->cmd.scan->fields = cmd_queue_alloc((num_fields + bypass_devices) * sizeof(scan_field_t));
- (*last_cmd)->cmd.scan->end_state = end_state;
+ cmd->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
+ cmd->cmd.scan->ir_scan = false;
+ cmd->cmd.scan->num_fields = num_fields + bypass_devices;
+ cmd->cmd.scan->fields = cmd_queue_alloc((num_fields + bypass_devices) * sizeof(scan_field_t));
+ cmd->cmd.scan->end_state = end_state;
tap = NULL;
nth_tap = -1;
@@ -920,7 +920,7 @@
break;
}
nth_tap++;
- (*last_cmd)->cmd.scan->fields[field_count].tap = tap;
+ cmd->cmd.scan->fields[field_count].tap = tap;
if (tap == target_tap)
{
@@ -938,9 +938,9 @@
u8 out_value[4];
scan_size = num_bits[j];
buf_set_u32(out_value, 0, scan_size, value[j]);
- (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size;
- (*last_cmd)->cmd.scan->fields[field_count].out_value = buf_cpy(out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
- (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL;
+ cmd->cmd.scan->fields[field_count].num_bits = scan_size;
+ cmd->cmd.scan->fields[field_count].out_value = buf_cpy(out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
+ cmd->cmd.scan->fields[field_count].in_value = NULL;
field_count++;
}
} else
@@ -954,9 +954,9 @@
}
#endif
/* program the scan field to 1 bit length, and ignore it's value */
- (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1;
- (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL;
- (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL;
+ cmd->cmd.scan->fields[field_count].num_bits = 1;
+ cmd->cmd.scan->fields[field_count].out_value = NULL;
+ cmd->cmd.scan->fields[field_count].in_value = NULL;
field_count++;
}
}
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:28:09
|
Author: kc8apf
Date: 2009-05-18 19:28:00 +0200 (Mon, 18 May 2009)
New Revision: 1818
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [4/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:27:46 UTC (rev 1817)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:28:00 UTC (rev 1818)
@@ -785,7 +785,6 @@
int field_count = 0;
int scan_size;
- jtag_command_t **last_cmd = jtag_get_last_command_p();
jtag_tap_t *tap;
/* count devices in bypass */
@@ -802,17 +801,19 @@
}
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->next = NULL;
- (*last_cmd)->type = JTAG_SCAN;
+
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_SCAN;
/* allocate memory for dr scan command */
- (*last_cmd)->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
- (*last_cmd)->cmd.scan->ir_scan = false;
- (*last_cmd)->cmd.scan->num_fields = num_fields + bypass_devices;
- (*last_cmd)->cmd.scan->fields = cmd_queue_alloc((num_fields + bypass_devices) * sizeof(scan_field_t));
- (*last_cmd)->cmd.scan->end_state = state;
+ cmd->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
+ cmd->cmd.scan->ir_scan = false;
+ cmd->cmd.scan->num_fields = num_fields + bypass_devices;
+ cmd->cmd.scan->fields = cmd_queue_alloc((num_fields + bypass_devices) * sizeof(scan_field_t));
+ cmd->cmd.scan->end_state = state;
tap = NULL;
nth_tap = -1;
@@ -823,7 +824,7 @@
break;
}
int found = 0;
- (*last_cmd)->cmd.scan->fields[field_count].tap = tap;
+ cmd->cmd.scan->fields[field_count].tap = tap;
for (j = 0; j < num_fields; j++)
{
@@ -831,9 +832,9 @@
{
found = 1;
scan_size = fields[j].num_bits;
- (*last_cmd)->cmd.scan->fields[field_count].num_bits = scan_size;
- (*last_cmd)->cmd.scan->fields[field_count].out_value = buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
- (*last_cmd)->cmd.scan->fields[field_count].in_value = fields[j].in_value;
+ cmd->cmd.scan->fields[field_count].num_bits = scan_size;
+ cmd->cmd.scan->fields[field_count].out_value = buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
+ cmd->cmd.scan->fields[field_count].in_value = fields[j].in_value;
field_count++;
}
}
@@ -848,9 +849,9 @@
}
#endif
/* program the scan field to 1 bit length, and ignore it's value */
- (*last_cmd)->cmd.scan->fields[field_count].num_bits = 1;
- (*last_cmd)->cmd.scan->fields[field_count].out_value = NULL;
- (*last_cmd)->cmd.scan->fields[field_count].in_value = NULL;
+ cmd->cmd.scan->fields[field_count].num_bits = 1;
+ cmd->cmd.scan->fields[field_count].out_value = NULL;
+ cmd->cmd.scan->fields[field_count].in_value = NULL;
field_count++;
}
else
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:27:48
|
Author: kc8apf
Date: 2009-05-18 19:27:46 +0200 (Mon, 18 May 2009)
New Revision: 1817
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [3/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:27:30 UTC (rev 1816)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:27:46 UTC (rev 1817)
@@ -672,32 +672,31 @@
int MINIDRIVER(interface_jtag_add_plain_ir_scan)(int num_fields, scan_field_t *fields, tap_state_t state)
{
- int i;
- jtag_command_t **last_cmd;
+ /* allocate memory for a new list member */
- last_cmd = jtag_get_last_command_p();
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
- /* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_SCAN;
+ cmd->type = JTAG_SCAN;
/* allocate memory for ir scan command */
- (*last_cmd)->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
- (*last_cmd)->cmd.scan->ir_scan = true;
- (*last_cmd)->cmd.scan->num_fields = num_fields;
- (*last_cmd)->cmd.scan->fields = cmd_queue_alloc(num_fields * sizeof(scan_field_t));
- (*last_cmd)->cmd.scan->end_state = state;
+ cmd->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
+ cmd->cmd.scan->ir_scan = true;
+ cmd->cmd.scan->num_fields = num_fields;
+ cmd->cmd.scan->fields = cmd_queue_alloc(num_fields * sizeof(scan_field_t));
+ cmd->cmd.scan->end_state = state;
- for( i = 0 ; i < num_fields ; i++ ){
+ for (int i = 0; i < num_fields; i++)
+ {
int num_bits = fields[i].num_bits;
int num_bytes = CEIL(fields[i].num_bits, 8);
- (*last_cmd)->cmd.scan->fields[i].tap = fields[i].tap;
- (*last_cmd)->cmd.scan->fields[i].num_bits = num_bits;
- (*last_cmd)->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits);
- (*last_cmd)->cmd.scan->fields[i].in_value = fields[i].in_value;
+ cmd->cmd.scan->fields[i].tap = fields[i].tap;
+ cmd->cmd.scan->fields[i].num_bits = num_bits;
+ cmd->cmd.scan->fields[i].out_value = buf_cpy(fields[i].out_value, cmd_queue_alloc(num_bytes), num_bits);
+ cmd->cmd.scan->fields[i].in_value = fields[i].in_value;
}
+
return ERROR_OK;
}
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:27:33
|
Author: kc8apf
Date: 2009-05-18 19:27:30 +0200 (Mon, 18 May 2009)
New Revision: 1816
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...> [2/8]
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:27:00 UTC (rev 1815)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:27:30 UTC (rev 1816)
@@ -590,28 +590,26 @@
int MINIDRIVER(interface_jtag_add_ir_scan)(int num_fields, scan_field_t *fields, tap_state_t state)
{
- jtag_command_t **last_cmd;
jtag_tap_t *tap;
int j;
int x;
int nth_tap;
int scan_size = 0;
- last_cmd = jtag_get_last_command_p();
-
/* allocate memory for a new list member */
- *last_cmd = cmd_queue_alloc(sizeof(jtag_command_t));
- (*last_cmd)->next = NULL;
- last_comand_pointer = &((*last_cmd)->next);
- (*last_cmd)->type = JTAG_SCAN;
+ jtag_command_t * cmd = cmd_queue_alloc(sizeof(jtag_command_t));
+
+ jtag_queue_command(cmd);
+
+ cmd->type = JTAG_SCAN;
/* allocate memory for ir scan command */
- (*last_cmd)->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
- (*last_cmd)->cmd.scan->ir_scan = true;
+ cmd->cmd.scan = cmd_queue_alloc(sizeof(scan_command_t));
+ cmd->cmd.scan->ir_scan = true;
x = jtag_NumEnabledTaps();
- (*last_cmd)->cmd.scan->num_fields = x; /* one field per device */
- (*last_cmd)->cmd.scan->fields = cmd_queue_alloc(x * sizeof(scan_field_t));
- (*last_cmd)->cmd.scan->end_state = state;
+ cmd->cmd.scan->num_fields = x; /* one field per device */
+ cmd->cmd.scan->fields = cmd_queue_alloc(x * sizeof(scan_field_t));
+ cmd->cmd.scan->end_state = state;
nth_tap = -1;
tap = NULL;
@@ -628,9 +626,9 @@
assert(nth_tap < x );
scan_size = tap->ir_length;
- (*last_cmd)->cmd.scan->fields[nth_tap].tap = tap;
- (*last_cmd)->cmd.scan->fields[nth_tap].num_bits = scan_size;
- (*last_cmd)->cmd.scan->fields[nth_tap].in_value = NULL; /* do not collect input for tap's in bypass */
+ cmd->cmd.scan->fields[nth_tap].tap = tap;
+ cmd->cmd.scan->fields[nth_tap].num_bits = scan_size;
+ cmd->cmd.scan->fields[nth_tap].in_value = NULL; /* do not collect input for tap's in bypass */
/* search the list */
for (j = 0; j < num_fields; j++)
@@ -638,8 +636,8 @@
if (tap == fields[j].tap)
{
found = 1;
- (*last_cmd)->cmd.scan->fields[nth_tap].in_value = fields[j].in_value;
- (*last_cmd)->cmd.scan->fields[nth_tap].out_value = buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
+ cmd->cmd.scan->fields[nth_tap].in_value = fields[j].in_value;
+ cmd->cmd.scan->fields[nth_tap].out_value = buf_cpy(fields[j].out_value, cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
tap->bypass = 0;
break;
@@ -649,12 +647,12 @@
if (!found)
{
/* if a tap isn't listed, set it to BYPASS */
- (*last_cmd)->cmd.scan->fields[nth_tap].out_value = buf_set_ones(cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
+ cmd->cmd.scan->fields[nth_tap].out_value = buf_set_ones(cmd_queue_alloc(CEIL(scan_size, 8)), scan_size);
tap->bypass = 1;
}
/* update device information */
- buf_cpy((*last_cmd)->cmd.scan->fields[nth_tap].out_value, tap->cur_instr, scan_size);
+ buf_cpy(cmd->cmd.scan->fields[nth_tap].out_value, tap->cur_instr, scan_size);
}
assert(nth_tap == (x-1));
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:27:03
|
Author: kc8apf
Date: 2009-05-18 19:27:00 +0200 (Mon, 18 May 2009)
New Revision: 1815
Modified:
trunk/src/jtag/jtag.c
Log:
Add jtag_queue_command() by Michael Bruck <mb...@di...>
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 17:23:52 UTC (rev 1814)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:27:00 UTC (rev 1815)
@@ -439,6 +439,21 @@
return last_comand_pointer;
}
+
+void jtag_queue_command(jtag_command_t * cmd)
+{
+ jtag_command_t **last_cmd;
+
+ last_cmd = jtag_get_last_command_p();
+
+ *last_cmd = cmd;
+
+ (*last_cmd)->next = NULL;
+
+ last_comand_pointer = &((*last_cmd)->next);
+}
+
+
void* cmd_queue_alloc(size_t size)
{
cmd_queue_page_t **p_page = &cmd_queue_pages;
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:24:03
|
Author: kc8apf
Date: 2009-05-18 19:23:52 +0200 (Mon, 18 May 2009)
New Revision: 1814
Modified:
trunk/src/jtag/ft2232.c
Log:
ftdi_set_interface correctness by Strontium <str...@gm...>
Modified: trunk/src/jtag/ft2232.c
===================================================================
--- trunk/src/jtag/ft2232.c 2009-05-18 17:20:51 UTC (rev 1813)
+++ trunk/src/jtag/ft2232.c 2009-05-18 17:23:52 UTC (rev 1814)
@@ -1766,6 +1766,12 @@
if (ftdi_init(&ftdic) < 0)
return ERROR_JTAG_INIT_FAILED;
+ if (ftdi_set_interface(&ftdic, INTERFACE_A) < 0)
+ {
+ LOG_ERROR("unable to select FT2232 channel A: %s", ftdic.error_str);
+ return ERROR_JTAG_INIT_FAILED;
+ }
+
/* context, vendor id, product id */
if (ftdi_usb_open_desc(&ftdic, vid, pid, ft2232_device_desc,
ft2232_serial) < 0)
@@ -1779,12 +1785,6 @@
return ERROR_JTAG_INIT_FAILED;
}
- if (ftdi_set_interface(&ftdic, INTERFACE_A) < 0)
- {
- LOG_ERROR("unable to select FT2232 channel A: %s", ftdic.error_str);
- return ERROR_JTAG_INIT_FAILED;
- }
-
if (ftdi_usb_reset(&ftdic) < 0)
{
LOG_ERROR("unable to reset ftdi device");
|
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:20:58
|
Author: kc8apf Date: 2009-05-18 19:20:51 +0200 (Mon, 18 May 2009) New Revision: 1813 Modified: trunk/PATCHES Log: PATCHES updates from David Brownell <da...@pa...> Modified: trunk/PATCHES =================================================================== --- trunk/PATCHES 2009-05-18 17:06:36 UTC (rev 1812) +++ trunk/PATCHES 2009-05-18 17:20:51 UTC (rev 1813) @@ -2,6 +2,9 @@ ope...@li... +Note that you can't send patches to that list unless +you're a member, despite what the list info page says. + The patch should be against svn trunk using an SVN diff. @@ -9,6 +12,10 @@ also write a short change log entry that maintainers can copy and paste into the commit message +(However, don't expect the maintainers to actually +include such entries in their commit messages if +they're longer than a single $SUBJECT line.) + Add yourself to the GPL copyright for non-trivial changes. To create a patch from the command line: |
|
From: kc8apf at B. <kc...@ma...> - 2009-05-18 19:06:38
|
Author: kc8apf
Date: 2009-05-18 19:06:36 +0200 (Mon, 18 May 2009)
New Revision: 1812
Modified:
trunk/src/jtag/jtag.c
Log:
JTAG state table updates (short table still disabled). Provided by Dick Hollenbeck <di...@so...>
Modified: trunk/src/jtag/jtag.c
===================================================================
--- trunk/src/jtag/jtag.c 2009-05-18 13:55:38 UTC (rev 1811)
+++ trunk/src/jtag/jtag.c 2009-05-18 17:06:36 UTC (rev 1812)
@@ -853,6 +853,9 @@
#endif
}
}
+
+ /* field_count represents the true number of fields setup*/
+ (*last_cmd)->cmd.scan->num_fields = field_count;
return ERROR_OK;
}
@@ -1315,7 +1318,7 @@
int i;
bit_count = jtag_scan_size(cmd);
- *buffer = malloc(CEIL(bit_count, 8));
+ *buffer = calloc(1,CEIL(bit_count, 8));
bit_count = 0;
@@ -3298,23 +3301,23 @@
/* to state: */
/* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */ /* from state: */
- { B8(1111111,7), B8(0,1), B8(00101,5), B8(01010,5), B8(001101,6), B8(010110,6) }, /* RESET */
- { B8(1111111,7), B8(0,1), B8(001,3), B8(0101,4), B8(0011,4), B8(01011,5) }, /* IDLE */
+ { B8(1111111,7), B8(0000000,7), B8(00101,5), B8(01010,5), B8(001101,6), B8(010110,6) }, /* RESET */
+ { B8(1111111,7), B8(0000000,7), B8(001,3), B8(0101,4), B8(0011,4), B8(01011,5) }, /* IDLE */
{ B8(1111111,7), B8(011,3), B8(00111,5), B8(01,2), B8(001111,6), B8(0101111,7) }, /* DRSHIFT */
- { B8(1111111,7), B8(011,3), B8(01,2), B8(0,1), B8(001111,6), B8(0101111,7) }, /* DRPAUSE */
+ { B8(1111111,7), B8(011,3), B8(01,2), B8(0,1), B8(001111,6), B8(0101111,7) }, /* DRPAUSE */
{ B8(1111111,7), B8(011,3), B8(00111,5), B8(010111,6), B8(001111,6), B8(01,2) }, /* IRSHIFT */
{ B8(1111111,7), B8(011,3), B8(00111,5), B8(010111,6), B8(01,2), B8(0,1) } /* IRPAUSE */
#else /* this is the old table, converted from hex and with the bit_count set to 7 for each combo, like before */
/* to state: */
- /* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */ /* from state: */
- { B8(1111111,7), B8(0000000,7), B8(0010111,7), B8(0001010,7), B8(0011011,7), B8(0010110,7) }, /* RESET */
- { B8(1111111,7), B8(0000000,7), B8(0100101,7), B8(0000101,7), B8(0101011,7), B8(0001011,7) }, /* IDLE */
- { B8(1111111,7), B8(0110001,7), B8(0000000,7), B8(0000001,7), B8(0001111,7), B8(0101111,7) }, /* DRSHIFT */
- { B8(1111111,7), B8(0110000,7), B8(0100000,7), B8(0010111,7), B8(0011110,7), B8(0101111,7) }, /* DRPAUSE */
- { B8(1111111,7), B8(0110001,7), B8(0000111,7), B8(0010111,7), B8(0000000,7), B8(0000001,7) }, /* IRSHIFT */
- { B8(1111111,7), B8(0110000,7), B8(0011100,7), B8(0010111,7), B8(0100000,7), B8(0101111,7) } /* IRPAUSE */
+ /* RESET IDLE DRSHIFT DRPAUSE IRSHIFT IRPAUSE */ /* from state: */
+ { B8(1111111,7), B8(0000000,7), B8(0010111,7), B8(0001010,7), B8(0011011,7), B8(0010110,7) }, /* RESET */
+ { B8(1111111,7), B8(0000000,7), B8(0100101,7), B8(0000101,7), B8(0101011,7), B8(0001011,7) }, /* IDLE */
+ { B8(1111111,7), B8(0110001,7), B8(0000000,7), B8(0000001,7), B8(0001111,7), B8(0101111,7) }, /* DRSHIFT */
+ { B8(1111111,7), B8(0110000,7), B8(0100000,7), B8(0010111,7), B8(0011110,7), B8(0101111,7) }, /* DRPAUSE */
+ { B8(1111111,7), B8(0110001,7), B8(0000111,7), B8(0010111,7), B8(0000000,7), B8(0000001,7) }, /* IRSHIFT */
+ { B8(1111111,7), B8(0110000,7), B8(0011100,7), B8(0010111,7), B8(0011110,7), B8(0101111,7) }, /* IRPAUSE */
#endif
|
|
From: oharboe at B. <oh...@ma...> - 2009-05-18 15:55:41
|
Author: oharboe
Date: 2009-05-18 15:55:38 +0200 (Mon, 18 May 2009)
New Revision: 1811
Modified:
trunk/src/helper/command.c
Log:
Remove unecessary(and poptentially harmful?) "" around arguments
passed in to "eval" in command.c
Modified: trunk/src/helper/command.c
===================================================================
--- trunk/src/helper/command.c 2009-05-18 13:07:37 UTC (rev 1810)
+++ trunk/src/helper/command.c 2009-05-18 13:55:38 UTC (rev 1811)
@@ -221,7 +221,7 @@
free((void *)full_name);
/* we now need to add an overrideable proc */
- const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval \"ocd_%s%s%s $args\"}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
+ const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval ocd_%s%s%s $args}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__ );
free((void *)override_name);
|
|
From: oharboe at B. <oh...@ma...> - 2009-05-18 15:07:38
|
Author: oharboe
Date: 2009-05-18 15:07:37 +0200 (Mon, 18 May 2009)
New Revision: 1810
Modified:
trunk/src/helper/startup.tcl
Log:
less weird error messages for unknown commands. Check if command exists before trying it.
Modified: trunk/src/helper/startup.tcl
===================================================================
--- trunk/src/helper/startup.tcl 2009-05-18 07:10:48 UTC (rev 1809)
+++ trunk/src/helper/startup.tcl 2009-05-18 13:07:37 UTC (rev 1810)
@@ -88,9 +88,10 @@
# do the name mangling from "flash banks" to "flash_banks"
if {[llength $args]>=2} {
set cmd_name "[lindex $args 0]_[lindex $args 1]"
- # Fix?? add a check here if this is a command?
- # we'll strip away args until we fail anyway...
- return [eval "$cmd_name [lrange $args 2 end]"]
+ if {[catch {info body $cmd_name}]==0} {
+ # the command exists, try it...
+ return [eval "$cmd_name [lrange $args 2 end]"]
+ }
}
# This really is an unknown command.
return -code error "Unknown command: $args"
|
|
From: oharboe at B. <oh...@ma...> - 2009-05-18 09:10:57
|
Author: oharboe
Date: 2009-05-18 09:10:48 +0200 (Mon, 18 May 2009)
New Revision: 1809
Modified:
trunk/src/target/arm7_9_common.c
Log:
Dean Glazeski <dn...@gm...> fixed bug in checking of clocked back data in arm7_9_execute_fast_sys_speed. Not reported. There is a chance that this bug hid a deeper problem since it only partially disabled the check(mask & value were equal).
Modified: trunk/src/target/arm7_9_common.c
===================================================================
--- trunk/src/target/arm7_9_common.c 2009-05-18 07:04:58 UTC (rev 1808)
+++ trunk/src/target/arm7_9_common.c 2009-05-18 07:10:48 UTC (rev 1809)
@@ -50,6 +50,12 @@
int handle_arm7_9_dcc_downloads_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
int handle_arm7_9_etm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+/**
+ * Clear watchpoints for an ARM7/9 target.
+ *
+ * @param arm7_9 Pointer to the common struct for an ARM7/9 target
+ * @return JTAG error status after executing queue
+ */
static int arm7_9_clear_watchpoints(arm7_9_common_t *arm7_9)
{
embeddedice_write_reg(&arm7_9->eice_cache->reg_list[EICE_W0_CONTROL_VALUE], 0x0);
@@ -62,6 +68,13 @@
return jtag_execute_queue();
}
+/**
+ * Assign a watchpoint to one of the two available hardware comparators in an
+ * ARM7 or ARM9 target.
+ *
+ * @param arm7_9 Pointer to the common struct for an ARM7/9 target
+ * @param breakpoint Pointer to the breakpoint to be used as a watchpoint
+ */
static void arm7_9_assign_wp(arm7_9_common_t *arm7_9, breakpoint_t *breakpoint)
{
if (!arm7_9->wp0_used)
@@ -82,7 +95,13 @@
}
}
-/* set up embedded ice registers */
+/**
+ * Setup an ARM7/9 target's embedded ICE registers for software breakpoints.
+ *
+ * @param arm7_9 Pointer to common struct for ARM7/9 targets
+ * @return Error codes if there is a problem finding a watchpoint or the result
+ * of executing the JTAG queue
+ */
static int arm7_9_set_software_breakpoints(arm7_9_common_t *arm7_9)
{
if (arm7_9->sw_breakpoints_added)
@@ -137,7 +156,12 @@
return jtag_execute_queue();
}
-/* set things up after a reset / on startup */
+/**
+ * Setup the common pieces for an ARM7/9 target after reset or on startup.
+ *
+ * @param target Pointer to an ARM7/9 target to setup
+ * @return Result of clearing the watchpoints on the target
+ */
int arm7_9_setup(target_t *target)
{
armv4_5_common_t *armv4_5 = target->arch_info;
@@ -146,6 +170,18 @@
return arm7_9_clear_watchpoints(arm7_9);
}
+/**
+ * Retrieves the architecture information pointers for ARMv4/5 and ARM7/9
+ * targets. A return of ERROR_OK signifies that the target is a valid target
+ * and that the pointers have been set properly.
+ *
+ * @param target Pointer to the target device to get the pointers from
+ * @param armv4_5_p Pointer to be filled in with the common struct for ARMV4/5
+ * targets
+ * @param arm7_9_p Pointer to be filled in with the common struct for ARM7/9
+ * targets
+ * @return ERROR_OK if successful
+ */
int arm7_9_get_arch_pointers(target_t *target, armv4_5_common_t **armv4_5_p, arm7_9_common_t **arm7_9_p)
{
armv4_5_common_t *armv4_5 = target->arch_info;
@@ -167,8 +203,16 @@
return ERROR_OK;
}
-/* we set up the breakpoint even if it is already set. Some action, e.g. reset
- * might have erased the values in embedded ice
+/**
+ * Set either a hardware or software breakpoint on an ARM7/9 target. The
+ * breakpoint is set up even if it is already set. Some actions, e.g. reset,
+ * might have erased the values in Embedded ICE.
+ *
+ * @param target Pointer to the target device to set the breakpoints on
+ * @param breakpoint Pointer to the breakpoint to be set
+ * @return For hardware breakpoints, this is the result of executing the JTAG
+ * queue. For software breakpoints, this will be the status of the
+ * required memory reads and writes
*/
int arm7_9_set_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
@@ -280,6 +324,18 @@
return retval;
}
+/**
+ * Unsets an existing breakpoint on an ARM7/9 target. If it is a hardware
+ * breakpoint, the watchpoint used will be freed and the Embedded ICE registers
+ * will be updated. Otherwise, the software breakpoint will be restored to its
+ * original instruction if it hasn't already been modified.
+ *
+ * @param target Pointer to ARM7/9 target to unset the breakpoint from
+ * @param breakpoint Pointer to breakpoint to be unset
+ * @return For hardware breakpoints, this is the result of executing the JTAG
+ * queue. For software breakpoints, this will be the status of the
+ * required memory reads and writes
+ */
int arm7_9_unset_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
int retval = ERROR_OK;
@@ -347,6 +403,15 @@
return retval;
}
+/**
+ * Add a breakpoint to an ARM7/9 target. This makes sure that there are no
+ * dangling breakpoints and that the desired breakpoint can be added.
+ *
+ * @param target Pointer to the target ARM7/9 device to add a breakpoint to
+ * @param breakpoint Pointer to the breakpoint to be added
+ * @return An error status if there is a problem adding the breakpoint or the
+ * result of setting the breakpoint
+ */
int arm7_9_add_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
armv4_5_common_t *armv4_5 = target->arch_info;
@@ -388,6 +453,16 @@
return arm7_9_set_breakpoint(target, breakpoint);
}
+/**
+ * Removes a breakpoint from an ARM7/9 target. This will make sure there are no
+ * dangling breakpoints and updates available watchpoints if it is a hardware
+ * breakpoint.
+ *
+ * @param target Pointer to the target to have a breakpoint removed
+ * @param breakpoint Pointer to the breakpoint to be removed
+ * @return Error status if there was a problem unsetting the breakpoint or the
+ * watchpoints could not be cleared
+ */
int arm7_9_remove_breakpoint(struct target_s *target, breakpoint_t *breakpoint)
{
int retval = ERROR_OK;
@@ -415,6 +490,16 @@
return ERROR_OK;
}
+/**
+ * Sets a watchpoint for an ARM7/9 target in one of the watchpoint units. It is
+ * considered a bug to call this function when there are no available watchpoint
+ * units.
+ *
+ * @param target Pointer to an ARM7/9 target to set a watchpoint on
+ * @param watchpoint Pointer to the watchpoint to be set
+ * @return Error status if watchpoint set fails or the result of executing the
+ * JTAG queue
+ */
int arm7_9_set_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
{
int retval = ERROR_OK;
@@ -479,6 +564,14 @@
return ERROR_OK;
}
+/**
+ * Unset an existing watchpoint and clear the used watchpoint unit.
+ *
+ * @param target Pointer to the target to have the watchpoint removed
+ * @param watchpoint Pointer to the watchpoint to be removed
+ * @return Error status while trying to unset the watchpoint or the result of
+ * executing the JTAG queue
+ */
int arm7_9_unset_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
{
int retval = ERROR_OK;
@@ -520,6 +613,14 @@
return ERROR_OK;
}
+/**
+ * Add a watchpoint to an ARM7/9 target. If there are no watchpoint units
+ * available, an error response is returned.
+ *
+ * @param target Pointer to the ARM7/9 target to add a watchpoint to
+ * @param watchpoint Pointer to the watchpoint to be added
+ * @return Error status while trying to add the watchpoint
+ */
int arm7_9_add_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
{
armv4_5_common_t *armv4_5 = target->arch_info;
@@ -546,6 +647,14 @@
return ERROR_OK;
}
+/**
+ * Remove a watchpoint from an ARM7/9 target. The watchpoint will be unset and
+ * the used watchpoint unit will be reopened.
+ *
+ * @param target Pointer to the target to remove a watchpoint from
+ * @param watchpoint Pointer to the watchpoint to be removed
+ * @return Result of trying to unset the watchpoint
+ */
int arm7_9_remove_watchpoint(struct target_s *target, watchpoint_t *watchpoint)
{
int retval = ERROR_OK;
@@ -565,6 +674,15 @@
return ERROR_OK;
}
+/**
+ * Restarts the target by sending a RESTART instruction and moving the JTAG
+ * state to IDLE. This includes a timeout waiting for DBGACK and SYSCOMP to be
+ * asserted by the processor.
+ *
+ * @param target Pointer to target to issue commands to
+ * @return Error status if there is a timeout or a problem while executing the
+ * JTAG queue
+ */
int arm7_9_execute_sys_speed(struct target_s *target)
{
int retval;
@@ -610,6 +728,14 @@
return ERROR_OK;
}
+/**
+ * Restarts the target by sending a RESTART instruction and moving the JTAG
+ * state to IDLE. This validates that DBGACK and SYSCOMP are set without
+ * waiting until they are.
+ *
+ * @param target Pointer to the target to issue commands to
+ * @return Always ERROR_OK
+ */
int arm7_9_execute_fast_sys_speed(struct target_s *target)
{
static int set=0;
@@ -642,7 +768,7 @@
}
/* read debug status register */
- embeddedice_read_reg_w_check(dbg_stat, check_value, check_value);
+ embeddedice_read_reg_w_check(dbg_stat, check_value, check_mask);
return ERROR_OK;
}
|
|
From: ntfreak at B. <nt...@ma...> - 2009-05-18 09:05:01
|
Author: ntfreak
Date: 2009-05-18 09:04:58 +0200 (Mon, 18 May 2009)
New Revision: 1808
Modified:
trunk/src/target/board/crossbow_tech_imote2.cfg
trunk/src/target/board/digi_connectcore_wi-9c.cfg
trunk/src/target/board/hitex_stm32-performancestick.cfg
trunk/src/target/board/hitex_str9-comstick.cfg
trunk/src/target/board/linksys_nslu2.cfg
trunk/src/target/board/pxa255_sst.cfg
trunk/src/target/board/str910-eval.cfg
trunk/src/target/board/zy1000.cfg
trunk/src/target/interface/hitex_str9-comstick.cfg
Log:
- add missing svn props from svn 1798 commit
Modified: trunk/src/target/board/crossbow_tech_imote2.cfg
===================================================================
--- trunk/src/target/board/crossbow_tech_imote2.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/crossbow_tech_imote2.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,46 +1,46 @@
-# Crossbow Technology iMote2
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME imote2
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- # force an error till we get a good number
- set _CPUTAPID 0xffffffff
-}
-
-# PXA271 and an Intel Strataflash of 32 Megabytes (p30)
-#
-# Marvell/Intel PXA270 Script
-# set jtag_nsrst_delay to the delay introduced by your reset circuit
-# the rest of the needed delays are built into the openocd program
-jtag_nsrst_delay 800
-# set the jtag_ntrst_delay to the delay introduced by a reset circuit
-# the rest of the needed delays are built into the openocd program
-jtag_ntrst_delay 0
-#use combined on interfaces or targets that can't set TRST/SRST separately
-reset_config trst_and_srst separate
-#jtag scan chain
-
-jtag newtap $_CHIPNAME cpu -irlen 7 -ircapture 0x1 -irmask 0x7f -expected-id $_CPUTAPID
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-target create $_TARGETNAME xscale -endian $_ENDIAN -chain-position $_TARGETNAME -variant pxa27x
-$_TARGETNAME configure -work-area-virt 0x0x5c000000 -work-area-phys 0x0x5c000000 -work-area-size 0x10000 -work-area-backup 1
-# maps to PXA internal RAM. If you are using a PXA255
-# you must initialize SDRAM or leave this option off
-
-
-#flash bank <driver> <base> <size> <chip_width> <bus_width>
-# works for P30 flash
-flash bank cfi 0x00000000 0x2000000 2 2 0
+# Crossbow Technology iMote2
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME imote2
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ # force an error till we get a good number
+ set _CPUTAPID 0xffffffff
+}
+
+# PXA271 and an Intel Strataflash of 32 Megabytes (p30)
+#
+# Marvell/Intel PXA270 Script
+# set jtag_nsrst_delay to the delay introduced by your reset circuit
+# the rest of the needed delays are built into the openocd program
+jtag_nsrst_delay 800
+# set the jtag_ntrst_delay to the delay introduced by a reset circuit
+# the rest of the needed delays are built into the openocd program
+jtag_ntrst_delay 0
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst separate
+#jtag scan chain
+
+jtag newtap $_CHIPNAME cpu -irlen 7 -ircapture 0x1 -irmask 0x7f -expected-id $_CPUTAPID
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+target create $_TARGETNAME xscale -endian $_ENDIAN -chain-position $_TARGETNAME -variant pxa27x
+$_TARGETNAME configure -work-area-virt 0x0x5c000000 -work-area-phys 0x0x5c000000 -work-area-size 0x10000 -work-area-backup 1
+# maps to PXA internal RAM. If you are using a PXA255
+# you must initialize SDRAM or leave this option off
+
+
+#flash bank <driver> <base> <size> <chip_width> <bus_width>
+# works for P30 flash
+flash bank cfi 0x00000000 0x2000000 2 2 0
Property changes on: trunk/src/target/board/crossbow_tech_imote2.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/digi_connectcore_wi-9c.cfg
===================================================================
--- trunk/src/target/board/digi_connectcore_wi-9c.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/digi_connectcore_wi-9c.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,127 +1,127 @@
-######################################
-# Target: DIGI ConnectCore Wi-9C
-######################################
-
-reset_config trst_and_srst
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME ns9360
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- # This config file was defaulting to big endian..
- set _ENDIAN big
-}
-
-
-# What's a good fallback frequency for this board if RCLK is
-# not available??
-jtag_rclk 1000
-
-
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- set _CPUTAPID 0xFFFFFFFF
-}
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-jtag_nsrst_delay 200
-jtag_ntrst_delay 0
-
-
-######################
-# Target configuration
-######################
-
-target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs
-$_TARGETNAME configure -event reset-init {
- mww 0x90600104 0x33313333
- mww 0xA0700000 0x00000001 # Enable the memory controller.
- mww 0xA0700024 0x00000006 # Set the refresh counter 6
- mww 0xA0700028 0x00000001 #
- mww 0xA0700030 0x00000001 # Set the precharge period
- mww 0xA0700034 0x00000004 # Active to precharge command period is 16 clock cycles
- mww 0xA070003C 0x00000001 # tAPR
- mww 0xA0700040 0x00000005 # tDAL
- mww 0xA0700044 0x00000001 # tWR
- mww 0xA0700048 0x00000006 # tRC 32 clock cycles
- mww 0xA070004C 0x00000006 # tRFC 32 clock cycles
- mww 0xA0700054 0x00000001 # tRRD
- mww 0xA0700058 0x00000001 # tMRD
- mww 0xA0700100 0x00004280 # Dynamic Config 0 (cs4)
- mww 0xA0700120 0x00004280 # Dynamic Config 1 (cs5)
- mww 0xA0700140 0x00004280 # Dynamic Config 2 (cs6)
- mww 0xA0700160 0x00004280 # Dynamic Config 3 (cs7)
- #
- mww 0xA0700104 0x00000203 # CAS latency is 2 at 100 MHz
- mww 0xA0700124 0x00000203 # CAS latency is 2 at 100 MHz
- mww 0xA0700144 0x00000203 # CAS latency is 2 at 100 MHz
- mww 0xA0700164 0x00000203 # CAS latency is 2 at 100 MHz
- #
- mww 0xA0700020 0x00000103 # issue SDRAM PALL command
- #
- mww 0xA0700024 0x00000001 # Set the refresh counter to be as small as possible
- #
- # Add some dummy writes to give the SDRAM time to settle, it needs two
- # AHB clock cycles, here we poke in the debugger flag, this lets
- # the software know that we are in the debugger
- mww 0xA0900000 0x00000002
- mww 0xA0900000 0x00000002
- mww 0xA0900000 0x00000002
- mww 0xA0900000 0x00000002
- mww 0xA0900000 0x00000002
- #
- mdw 0xA0900000
- mdw 0xA0900000
- mdw 0xA0900000
- mdw 0xA0900000
- mdw 0xA0900000
- #
- mww 0xA0700024 0x00000030 # Set the refresh counter to 30
- mww 0xA0700020 0x00000083 # Issue SDRAM MODE command
- #
- # Next we perform a read of RAM.
- # mw = move word.
- mdw 0x00022000
- # mw 0x00022000:P, r3 # 22000 for cas2 latency, 32000 for cas 3
- #
- mww 0xA0700020 0x00000003 # issue SDRAM NORMAL command
- mww 0xA0700100 0x00084280 # Enable buffer access
- mww 0xA0700120 0x00084280 # Enable buffer access
- mww 0xA0700140 0x00084280 # Enable buffer access
- mww 0xA0700160 0x00084280 # Enable buffer access
-
- #Set byte lane state (static mem 1)"
- mww 0xA0700220, 0x00000082
- #Flash Start
- mww 0xA09001F8, 0x50000000
- #Flash Mask Reg
- mww 0xA09001FC, 0xFF000001
- mww 0xA0700028, 0x00000001
-
- # RAMAddr = 0x00020000
- # RAMSize = 0x00004000
-
- # Set the processor mode
- reg cpsr 0xd3
-}
-
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00000000 -work-area-size 0x1000 -work-area-backup 1
-
-#####################
-# Flash configuration
-#####################
-
-#M29DW323DB - not working
-#flash bank cfi <base> <size> <chip width> <bus width> <target#>
-flash bank cfi 0x50000000 0x0400000 2 2 0
-
-
-
+######################################
+# Target: DIGI ConnectCore Wi-9C
+######################################
+
+reset_config trst_and_srst
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME ns9360
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ # This config file was defaulting to big endian..
+ set _ENDIAN big
+}
+
+
+# What's a good fallback frequency for this board if RCLK is
+# not available??
+jtag_rclk 1000
+
+
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0xFFFFFFFF
+}
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+jtag_nsrst_delay 200
+jtag_ntrst_delay 0
+
+
+######################
+# Target configuration
+######################
+
+target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm926ejs
+$_TARGETNAME configure -event reset-init {
+ mww 0x90600104 0x33313333
+ mww 0xA0700000 0x00000001 # Enable the memory controller.
+ mww 0xA0700024 0x00000006 # Set the refresh counter 6
+ mww 0xA0700028 0x00000001 #
+ mww 0xA0700030 0x00000001 # Set the precharge period
+ mww 0xA0700034 0x00000004 # Active to precharge command period is 16 clock cycles
+ mww 0xA070003C 0x00000001 # tAPR
+ mww 0xA0700040 0x00000005 # tDAL
+ mww 0xA0700044 0x00000001 # tWR
+ mww 0xA0700048 0x00000006 # tRC 32 clock cycles
+ mww 0xA070004C 0x00000006 # tRFC 32 clock cycles
+ mww 0xA0700054 0x00000001 # tRRD
+ mww 0xA0700058 0x00000001 # tMRD
+ mww 0xA0700100 0x00004280 # Dynamic Config 0 (cs4)
+ mww 0xA0700120 0x00004280 # Dynamic Config 1 (cs5)
+ mww 0xA0700140 0x00004280 # Dynamic Config 2 (cs6)
+ mww 0xA0700160 0x00004280 # Dynamic Config 3 (cs7)
+ #
+ mww 0xA0700104 0x00000203 # CAS latency is 2 at 100 MHz
+ mww 0xA0700124 0x00000203 # CAS latency is 2 at 100 MHz
+ mww 0xA0700144 0x00000203 # CAS latency is 2 at 100 MHz
+ mww 0xA0700164 0x00000203 # CAS latency is 2 at 100 MHz
+ #
+ mww 0xA0700020 0x00000103 # issue SDRAM PALL command
+ #
+ mww 0xA0700024 0x00000001 # Set the refresh counter to be as small as possible
+ #
+ # Add some dummy writes to give the SDRAM time to settle, it needs two
+ # AHB clock cycles, here we poke in the debugger flag, this lets
+ # the software know that we are in the debugger
+ mww 0xA0900000 0x00000002
+ mww 0xA0900000 0x00000002
+ mww 0xA0900000 0x00000002
+ mww 0xA0900000 0x00000002
+ mww 0xA0900000 0x00000002
+ #
+ mdw 0xA0900000
+ mdw 0xA0900000
+ mdw 0xA0900000
+ mdw 0xA0900000
+ mdw 0xA0900000
+ #
+ mww 0xA0700024 0x00000030 # Set the refresh counter to 30
+ mww 0xA0700020 0x00000083 # Issue SDRAM MODE command
+ #
+ # Next we perform a read of RAM.
+ # mw = move word.
+ mdw 0x00022000
+ # mw 0x00022000:P, r3 # 22000 for cas2 latency, 32000 for cas 3
+ #
+ mww 0xA0700020 0x00000003 # issue SDRAM NORMAL command
+ mww 0xA0700100 0x00084280 # Enable buffer access
+ mww 0xA0700120 0x00084280 # Enable buffer access
+ mww 0xA0700140 0x00084280 # Enable buffer access
+ mww 0xA0700160 0x00084280 # Enable buffer access
+
+ #Set byte lane state (static mem 1)"
+ mww 0xA0700220, 0x00000082
+ #Flash Start
+ mww 0xA09001F8, 0x50000000
+ #Flash Mask Reg
+ mww 0xA09001FC, 0xFF000001
+ mww 0xA0700028, 0x00000001
+
+ # RAMAddr = 0x00020000
+ # RAMSize = 0x00004000
+
+ # Set the processor mode
+ reg cpsr 0xd3
+}
+
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00000000 -work-area-size 0x1000 -work-area-backup 1
+
+#####################
+# Flash configuration
+#####################
+
+#M29DW323DB - not working
+#flash bank cfi <base> <size> <chip width> <bus width> <target#>
+flash bank cfi 0x50000000 0x0400000 2 2 0
+
+
+
Property changes on: trunk/src/target/board/digi_connectcore_wi-9c.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/hitex_stm32-performancestick.cfg
===================================================================
--- trunk/src/target/board/hitex_stm32-performancestick.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/hitex_stm32-performancestick.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,50 +1,50 @@
-# Hitex stm32 performance stick
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME stm32_hitex
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-# set jtag speed
-jtag_khz 500
-
-jtag_nsrst_delay 100
-jtag_ntrst_delay 100
-
-#use combined on interfaces or targets that can't set TRST/SRST separately
-reset_config trst_and_srst
-
-#jtag scan chain
-# The CPU
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- # See STM Document RM0008
- # Section 26.6.3
- set _CPUTAPID 0x3ba00477
-}
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-# The boundery scan register, leave the "expected-id" undefined.
-jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1
-
-# configure str750 connected to jtag chain
-jtag newtap $_CHIPNAME unknown -irlen 4 -ircapture 0x1 -irmask 0x0f
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
-
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0
-
-#
-flash bank stm32x 0 0 0 0 0
-
-# For more information about the configuration files, take a look at:
-# openocd.texi
+# Hitex stm32 performance stick
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME stm32_hitex
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+# set jtag speed
+jtag_khz 500
+
+jtag_nsrst_delay 100
+jtag_ntrst_delay 100
+
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst
+
+#jtag scan chain
+# The CPU
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ # See STM Document RM0008
+ # Section 26.6.3
+ set _CPUTAPID 0x3ba00477
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+# The boundery scan register, leave the "expected-id" undefined.
+jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1
+
+# configure str750 connected to jtag chain
+jtag newtap $_CHIPNAME unknown -irlen 4 -ircapture 0x1 -irmask 0x0f
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
+
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0
+
+#
+flash bank stm32x 0 0 0 0 0
+
+# For more information about the configuration files, take a look at:
+# openocd.texi
Property changes on: trunk/src/target/board/hitex_stm32-performancestick.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/hitex_str9-comstick.cfg
===================================================================
--- trunk/src/target/board/hitex_str9-comstick.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/hitex_str9-comstick.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,72 +1,72 @@
-# Hitex STR9-comStick
-# http://www.hitex.com/index.php?id=383
-# This works for the STR9-comStick revisions STR912CS-A1 and STR912CS-A2.
-
-source [find interface/hitex_str9-comstick.cfg]
-
-# set jtag speed
-jtag_khz 3000
-
-jtag_nsrst_delay 100
-jtag_ntrst_delay 100
-#use combined on interfaces or targets that can't set TRST/SRST separately
-reset_config trst_and_srst
-#jtag scan chain
-#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME str912
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-if { [info exists FLASHTAPID ] } {
- set _FLASHTAPID $FLASHTAPID
-} else {
- set _FLASHTAPID 0x04570041
-}
-jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
-
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- set _CPUTAPID 0x25966041
-}
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-if { [info exists BSTAPID ] } {
- set _BSTAPID $BSTAPID
-} else {
- # Found on STR9-comStick, revision STR912CS-A1
- set _BSTAPID1 0x1457f041
- # Found on STR9-comStick, revision STR912CS-A2
- set _BSTAPID2 0x2457f041
-}
-jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID1 -expected-id $_BSTAPID2
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm966e
-
-$_TARGETNAME configure -event reset-init {
- # We can increase speed now that we know the target is halted.
- #jtag_rclk 3000
-
- # -- Enable 96K RAM
- # PFQBC enabled / DTCM & AHB wait-states disabled
- mww 0x5C002034 0x0191
-
- str9x flash_config 0 4 2 0 0x80000
- flash protect 0 0 7 off
-}
-
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0
-
-#flash bank <driver> <base> <size> <chip_width> <bus_width>
-flash bank str9x 0x00000000 0x00080000 0 0 0
-flash bank str9x 0x00080000 0x00008000 0 0 0
+# Hitex STR9-comStick
+# http://www.hitex.com/index.php?id=383
+# This works for the STR9-comStick revisions STR912CS-A1 and STR912CS-A2.
+
+source [find interface/hitex_str9-comstick.cfg]
+
+# set jtag speed
+jtag_khz 3000
+
+jtag_nsrst_delay 100
+jtag_ntrst_delay 100
+#use combined on interfaces or targets that can't set TRST/SRST separately
+reset_config trst_and_srst
+#jtag scan chain
+#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME str912
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+if { [info exists FLASHTAPID ] } {
+ set _FLASHTAPID $FLASHTAPID
+} else {
+ set _FLASHTAPID 0x04570041
+}
+jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
+
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0x25966041
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+if { [info exists BSTAPID ] } {
+ set _BSTAPID $BSTAPID
+} else {
+ # Found on STR9-comStick, revision STR912CS-A1
+ set _BSTAPID1 0x1457f041
+ # Found on STR9-comStick, revision STR912CS-A2
+ set _BSTAPID2 0x2457f041
+}
+jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID1 -expected-id $_BSTAPID2
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm966e
+
+$_TARGETNAME configure -event reset-init {
+ # We can increase speed now that we know the target is halted.
+ #jtag_rclk 3000
+
+ # -- Enable 96K RAM
+ # PFQBC enabled / DTCM & AHB wait-states disabled
+ mww 0x5C002034 0x0191
+
+ str9x flash_config 0 4 2 0 0x80000
+ flash protect 0 0 7 off
+}
+
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x50000000 -work-area-size 16384 -work-area-backup 0
+
+#flash bank <driver> <base> <size> <chip_width> <bus_width>
+flash bank str9x 0x00000000 0x00080000 0 0 0
+flash bank str9x 0x00080000 0x00008000 0 0 0
Property changes on: trunk/src/target/board/hitex_str9-comstick.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/linksys_nslu2.cfg
===================================================================
--- trunk/src/target/board/linksys_nslu2.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/linksys_nslu2.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,8 +1,8 @@
-# This is for the LinkSys (CISCO) NSLU2 board
-# It is an Intel XSCALE IXP420 CPU.
-
-source [find target/ixp42x.cfg]
-# The _TARGETNAME is set by the above.
-
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00020000 -work-area-size 0x10000 -work-area-backup 0
-
+# This is for the LinkSys (CISCO) NSLU2 board
+# It is an Intel XSCALE IXP420 CPU.
+
+source [find target/ixp42x.cfg]
+# The _TARGETNAME is set by the above.
+
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00020000 -work-area-size 0x10000 -work-area-backup 0
+
Property changes on: trunk/src/target/board/linksys_nslu2.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/pxa255_sst.cfg
===================================================================
--- trunk/src/target/board/pxa255_sst.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/pxa255_sst.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,15 +1,15 @@
-# A PXA255 test board with SST 39LF400A flash
-#
-# At reset the memory map is as follows. Note that
-# the memory map changes later on as the application
-# starts...
-#
-# RAM at 0x4000000
-# Flash at 0x00000000
-#
-source [find target/pxa255.cfg]
-# Target name is set by above
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x4000000 -work-area-size 0x4000 -work-area-backup 0
-# flash bank <driver> <base> <size> <chip_width> <bus_width> <targetNum> [options]
-flash bank cfi 0x00000000 0x80000 2 2 0 jedec_probe
-
+# A PXA255 test board with SST 39LF400A flash
+#
+# At reset the memory map is as follows. Note that
+# the memory map changes later on as the application
+# starts...
+#
+# RAM at 0x4000000
+# Flash at 0x00000000
+#
+source [find target/pxa255.cfg]
+# Target name is set by above
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x4000000 -work-area-size 0x4000 -work-area-backup 0
+# flash bank <driver> <base> <size> <chip_width> <bus_width> <targetNum> [options]
+flash bank cfi 0x00000000 0x80000 2 2 0 jedec_probe
+
Property changes on: trunk/src/target/board/pxa255_sst.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/str910-eval.cfg
===================================================================
--- trunk/src/target/board/str910-eval.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/str910-eval.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,61 +1,61 @@
-# str910-eval eval board
-#
-# Need reset scripts
-reset_config trst_and_srst
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME str912
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-if { [info exists FLASHTAPID ] } {
- set _FLASHTAPID $FLASHTAPID
-} else {
- set _FLASHTAPID 0x04570041
-}
-jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
-
-
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- set _CPUTAPID 0x25966041
-}
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-if { [info exists BSTAPID ] } {
- set _BSTAPID $BSTAPID
-} else {
- set _BSTAPID 0x1457f041
-}
-jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm966e
-$_TARGETNAME configure -work-area-phys 0x50000000 -work-area-virt 0x50000000 -work-area-size 16384 -work-area-backup 1
-
-$_TARGETNAME configure -event reset-init {
- # We can increase speed now that we know the target is halted.
- #jtag_rclk 3000
-
- # -- Enable 96K RAM
- # PFQBC enabled / DTCM & AHB wait-states disabled
- mww 0x5C002034 0x0191
-
- str9x flash_config 0 4 2 0 0x80000
- flash protect 0 0 7 off
-}
-
-#flash bank str9x <base> <size> 0 0 <target#> <variant>
-flash bank str9x 0x00000000 0x00080000 0 0 0
-flash bank str9x 0x00080000 0x00008000 0 0 0
-
-# For more information about the configuration files, take a look at:
-# openocd.texi
+# str910-eval eval board
+#
+# Need reset scripts
+reset_config trst_and_srst
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME str912
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+if { [info exists FLASHTAPID ] } {
+ set _FLASHTAPID $FLASHTAPID
+} else {
+ set _FLASHTAPID 0x04570041
+}
+jtag newtap $_CHIPNAME flash -irlen 8 -ircapture 0x1 -irmask 0x1 -expected-id $_FLASHTAPID
+
+
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0x25966041
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+if { [info exists BSTAPID ] } {
+ set _BSTAPID $BSTAPID
+} else {
+ set _BSTAPID 0x1457f041
+}
+jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 -expected-id $_BSTAPID
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm966e
+$_TARGETNAME configure -work-area-phys 0x50000000 -work-area-virt 0x50000000 -work-area-size 16384 -work-area-backup 1
+
+$_TARGETNAME configure -event reset-init {
+ # We can increase speed now that we know the target is halted.
+ #jtag_rclk 3000
+
+ # -- Enable 96K RAM
+ # PFQBC enabled / DTCM & AHB wait-states disabled
+ mww 0x5C002034 0x0191
+
+ str9x flash_config 0 4 2 0 0x80000
+ flash protect 0 0 7 off
+}
+
+#flash bank str9x <base> <size> 0 0 <target#> <variant>
+flash bank str9x 0x00000000 0x00080000 0 0 0
+flash bank str9x 0x00080000 0x00008000 0 0 0
+
+# For more information about the configuration files, take a look at:
+# openocd.texi
Property changes on: trunk/src/target/board/str910-eval.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/board/zy1000.cfg
===================================================================
--- trunk/src/target/board/zy1000.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/board/zy1000.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,110 +1,110 @@
-#Script for ZY1000
-
-#Atmel ties SRST & TRST together, at which point it makes
-#no sense to use TRST, but use TMS instead.
-#
-#The annoying thing with tying SRST & TRST together is that
-#there is no way to halt the CPU *before and during* the
-#SRST reset, which means that the CPU will run a number
-#of cycles before it can be halted(as much as milliseconds).
-reset_config srst_only srst_pulls_trst
-
-
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME zy1000
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-
-#jtag scan chain
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- set _CPUTAPID 0x1f0f0f0f
-}
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
-target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4
-
-# at CPU CLK <32kHz this must be disabled
-arm7_9 fast_memory_access enable
-arm7_9 dcc_downloads enable
-
-flash bank ecosflash 0x01000000 0x200000 2 2 0 ecos/at91eb40a.elf
-$_TARGETNAME configure -event reset-init {
- # Set up chip selects & timings
- mww 0xFFE00000 0x0100273D
- mww 0xFFE00004 0x08002125
- mww 0xFFEe0008 0x02002125
- mww 0xFFE0000c 0x03002125
- mww 0xFFE00010 0x40000000
- mww 0xFFE00014 0x50000000
- mww 0xFFE00018 0x60000000
- mww 0xFFE0001c 0x70000000
- mww 0xFFE00020 0x00000001
- mww 0xFFE00024 0x00000000
-
- # remap
- mww 0xFFFFF124 0xFFFFFFFF
- mww 0xffff0010 0x100
- mww 0xffff0034 0x100
-
- #disable 16x5x UART interrupts
- mww 0x08020004 0
-}
-
-# required for usable performance. Used for lots of
-# other things than flash programming.
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00020000 -work-area-size 0x20000 -work-area-backup 0
-
-jtag_khz 16000
-
-
-proc production_info {} {
- return "Serial number is official MAC number. Format XXXXXXXXXXXX"
-}
-
-# There is no return value from this procedure. If it is
-# successful it does not throw an exception
-#
-# Progress messages are output via puts
-proc production {firmwarefile serialnumber} {
- if {[string length $serialnumber]!=12} {
- puts "Invalid serial number"
- return
- }
-
- puts "Power cycling target"
- power off
- sleep 3000
- power on
- sleep 1000
- reset init
- flash write_image erase $firmwarefile 0x1000000 bin
- verify_image $firmwarefile 0x1000000 bin
-
- # Big endian... weee!!!!
- puts "Setting MAC number to $serialnumber"
- flash fillw [expr 0x1030000-0x8] "0x[string range $serialnumber 2 3][string range $serialnumber 0 1]0000" 1
- flash fillw [expr 0x1030000-0x4] "0x[string range $serialnumber 10 11][string range $serialnumber 8 9][string range $serialnumber 6 7][string range $serialnumber 4 5]" 1
- puts "Production successful"
-}
-
-
-proc production_test {} {
- power on
- sleep 1000
- target_request debugmsgs enable
- reset run
- sleep 25000
- target_request debugmsgs disable
- return "See IP address above..."
-}
+#Script for ZY1000
+
+#Atmel ties SRST & TRST together, at which point it makes
+#no sense to use TRST, but use TMS instead.
+#
+#The annoying thing with tying SRST & TRST together is that
+#there is no way to halt the CPU *before and during* the
+#SRST reset, which means that the CPU will run a number
+#of cycles before it can be halted(as much as milliseconds).
+reset_config srst_only srst_pulls_trst
+
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME zy1000
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+
+#jtag scan chain
+if { [info exists CPUTAPID ] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ set _CPUTAPID 0x1f0f0f0f
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
+target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4
+
+# at CPU CLK <32kHz this must be disabled
+arm7_9 fast_memory_access enable
+arm7_9 dcc_downloads enable
+
+flash bank ecosflash 0x01000000 0x200000 2 2 0 ecos/at91eb40a.elf
+$_TARGETNAME configure -event reset-init {
+ # Set up chip selects & timings
+ mww 0xFFE00000 0x0100273D
+ mww 0xFFE00004 0x08002125
+ mww 0xFFEe0008 0x02002125
+ mww 0xFFE0000c 0x03002125
+ mww 0xFFE00010 0x40000000
+ mww 0xFFE00014 0x50000000
+ mww 0xFFE00018 0x60000000
+ mww 0xFFE0001c 0x70000000
+ mww 0xFFE00020 0x00000001
+ mww 0xFFE00024 0x00000000
+
+ # remap
+ mww 0xFFFFF124 0xFFFFFFFF
+ mww 0xffff0010 0x100
+ mww 0xffff0034 0x100
+
+ #disable 16x5x UART interrupts
+ mww 0x08020004 0
+}
+
+# required for usable performance. Used for lots of
+# other things than flash programming.
+$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00020000 -work-area-size 0x20000 -work-area-backup 0
+
+jtag_khz 16000
+
+
+proc production_info {} {
+ return "Serial number is official MAC number. Format XXXXXXXXXXXX"
+}
+
+# There is no return value from this procedure. If it is
+# successful it does not throw an exception
+#
+# Progress messages are output via puts
+proc production {firmwarefile serialnumber} {
+ if {[string length $serialnumber]!=12} {
+ puts "Invalid serial number"
+ return
+ }
+
+ puts "Power cycling target"
+ power off
+ sleep 3000
+ power on
+ sleep 1000
+ reset init
+ flash write_image erase $firmwarefile 0x1000000 bin
+ verify_image $firmwarefile 0x1000000 bin
+
+ # Big endian... weee!!!!
+ puts "Setting MAC number to $serialnumber"
+ flash fillw [expr 0x1030000-0x8] "0x[string range $serialnumber 2 3][string range $serialnumber 0 1]0000" 1
+ flash fillw [expr 0x1030000-0x4] "0x[string range $serialnumber 10 11][string range $serialnumber 8 9][string range $serialnumber 6 7][string range $serialnumber 4 5]" 1
+ puts "Production successful"
+}
+
+
+proc production_test {} {
+ power on
+ sleep 1000
+ target_request debugmsgs enable
+ reset run
+ sleep 25000
+ target_request debugmsgs disable
+ return "See IP address above..."
+}
Property changes on: trunk/src/target/board/zy1000.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/src/target/interface/hitex_str9-comstick.cfg
===================================================================
--- trunk/src/target/interface/hitex_str9-comstick.cfg 2009-05-18 07:02:12 UTC (rev 1807)
+++ trunk/src/target/interface/hitex_str9-comstick.cfg 2009-05-18 07:04:58 UTC (rev 1808)
@@ -1,11 +1,11 @@
-#
-# Hitex STR9-comStick
-#
-# http://www.hitex.com/index.php?id=383
-#
-
-interface ft2232
-ft2232_device_desc "STR9-comStick A"
-ft2232_layout comstick
-ft2232_vid_pid 0x0640 0x002c
-
+#
+# Hitex STR9-comStick
+#
+# http://www.hitex.com/index.php?id=383
+#
+
+interface ft2232
+ft2232_device_desc "STR9-comStick A"
+ft2232_layout comstick
+ft2232_vid_pid 0x0640 0x002c
+
Property changes on: trunk/src/target/interface/hitex_str9-comstick.cfg
___________________________________________________________________
Name: svn:eol-style
+ native
|
|
From: oharboe at B. <oh...@ma...> - 2009-05-18 09:02:21
|
Author: oharboe
Date: 2009-05-18 09:02:12 +0200 (Mon, 18 May 2009)
New Revision: 1807
Modified:
trunk/src/target/arm11.c
trunk/src/target/arm11.h
trunk/src/target/arm11_dbgtap.c
Log:
Michael Bruck <mb...@di...> ARM11 cleanup stale dependencies with generic arm code; added comments and whitespace fixes
Modified: trunk/src/target/arm11.c
===================================================================
--- trunk/src/target/arm11.c 2009-05-18 04:47:06 UTC (rev 1806)
+++ trunk/src/target/arm11.c 2009-05-18 07:02:12 UTC (rev 1807)
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2008 digenius technology GmbH. *
+ * Michael Bruck *
* *
* Copyright (C) 2008 Oyvind Harboe oyv...@zy... *
* *
@@ -336,7 +337,9 @@
if (*dscr & ARM11_DSCR_CORE_HALTED)
{
/** \todo TODO: this needs further scrutiny because
- * arm11_on_enter_debug_state() never gets properly called
+ * arm11_on_enter_debug_state() never gets properly called.
+ * As a result we don't read the actual register states from
+ * the target.
*/
arm11->target->state = TARGET_HALTED;
@@ -389,8 +392,8 @@
scan_field_t chain5_fields[3];
arm11_setup_field(arm11, 32, NULL, &R(WDTR), chain5_fields + 0);
- arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 1);
- arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 2);
+ arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 1);
+ arm11_setup_field(arm11, 1, NULL, NULL, chain5_fields + 2);
arm11_add_dr_scan_vc(asizeof(chain5_fields), chain5_fields, TAP_DRPAUSE);
}
@@ -679,7 +682,7 @@
enum target_state old_state = target->state;
LOG_DEBUG("enter TARGET_HALTED");
- target->state = TARGET_HALTED;
+ target->state = TARGET_HALTED;
target->debug_reason = arm11_get_DSCR_debug_reason(dscr);
arm11_on_enter_debug_state(arm11);
@@ -692,7 +695,7 @@
if (target->state != TARGET_RUNNING && target->state != TARGET_DEBUG_RUNNING)
{
LOG_DEBUG("enter TARGET_RUNNING");
- target->state = TARGET_RUNNING;
+ target->state = TARGET_RUNNING;
target->debug_reason = DBG_REASON_NOTHALTED;
}
}
@@ -1369,7 +1372,6 @@
int timeout_ms, void *arch_info)
{
arm11_common_t *arm11 = target->arch_info;
- armv4_5_algorithm_t *arm11_algorithm_info = arch_info;
// enum armv4_5_state core_state = arm11->core_state;
// enum armv4_5_mode core_mode = arm11->core_mode;
u32 context[16];
@@ -1378,11 +1380,6 @@
int retval = ERROR_OK;
LOG_DEBUG("Running algorithm");
- if (arm11_algorithm_info->common_magic != ARMV4_5_COMMON_MAGIC)
- {
- LOG_ERROR("current target isn't an ARMV4/5 target");
- return ERROR_TARGET_INVALID;
- }
if (target->state != TARGET_HALTED)
{
@@ -1441,6 +1438,12 @@
exit(-1);
}
*/
+
+
+/* arm11 at this point only supports ARM not THUMB mode
+ however if this test needs to be reactivated the current state can be read back
+ from CPSR */
+#if 0
if (arm11_algorithm_info->core_mode != ARMV4_5_MODE_ANY)
{
LOG_DEBUG("setting core_mode: 0x%2.2x", arm11_algorithm_info->core_mode);
@@ -1448,6 +1451,7 @@
arm11->reg_list[ARM11_RC_CPSR].dirty = 1;
arm11->reg_list[ARM11_RC_CPSR].valid = 1;
}
+#endif
if ((retval = breakpoint_add(target, exit_point, exit_breakpoint_size, BKPT_HARD)) != ERROR_OK)
{
@@ -1535,12 +1539,6 @@
arm11->target = target;
- /* prepare JTAG information for the new target */
- arm11->jtag_info.tap = target->tap;
- arm11->jtag_info.scann_size = 5;
-
- CHECK_RETVAL(arm_jtag_setup_connection(&arm11->jtag_info));
-
if (target->tap==NULL)
return ERROR_FAIL;
@@ -1956,7 +1954,7 @@
RC_FINAL_BOOL( "error_fatal", "Terminate program if transfer error was found (default: enabled)",
memwrite_error_fatal)
- )
+ ) /* memwrite */
RC_FINAL_BOOL( "no_increment", "Don't increment address on multi-read/-write (default: disabled)",
memrw_no_increment)
@@ -1972,7 +1970,7 @@
RC_FINAL( "mcr", "Write Coprocessor register",
arm11_handle_mcr)
- )
+ ) /* arm11 */
return ERROR_OK;
}
Modified: trunk/src/target/arm11.h
===================================================================
--- trunk/src/target/arm11.h 2009-05-18 04:47:06 UTC (rev 1806)
+++ trunk/src/target/arm11.h 2009-05-18 07:02:12 UTC (rev 1807)
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2008 digenius technology GmbH. *
+ * Michael Bruck *
* *
* Copyright (C) 2008 Georg Acher <ac...@in...> *
* *
@@ -22,7 +23,9 @@
#ifndef ARM11_H
#define ARM11_H
-#include "embeddedice.h"
+#include "target.h"
+#include "register.h"
+#include "jtag.h"
#define asizeof(x) (sizeof(x) / sizeof((x)[0]))
@@ -78,8 +81,6 @@
{
target_t * target; /**< Reference back to the owner */
- arm_jtag_t jtag_info; /**< Handler to access assigned JTAG device */
-
/** \name Processor type detection */
/*@{*/
Modified: trunk/src/target/arm11_dbgtap.c
===================================================================
--- trunk/src/target/arm11_dbgtap.c 2009-05-18 04:47:06 UTC (rev 1806)
+++ trunk/src/target/arm11_dbgtap.c 2009-05-18 07:02:12 UTC (rev 1807)
@@ -1,5 +1,6 @@
/***************************************************************************
* Copyright (C) 2008 digenius technology GmbH. *
+ * Michael Bruck *
* *
* Copyright (C) 2008 Oyvind Harboe oyv...@zy... *
* *
@@ -81,7 +82,7 @@
*/
void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, void * in_data, scan_field_t * field)
{
- field->tap = arm11->jtag_info.tap;
+ field->tap = arm11->target->tap;
field->num_bits = num_bits;
field->out_value = out_data;
field->in_value = in_data;
@@ -99,7 +100,7 @@
void arm11_add_IR(arm11_common_t * arm11, u8 instr, tap_state_t state)
{
jtag_tap_t *tap;
- tap = arm11->jtag_info.tap;
+ tap = arm11->target->tap;
if (buf_get_u32(tap->cur_instr, 0, 5) == instr)
{
@@ -211,7 +212,8 @@
* same as CP14 c1
*
* \param arm11 Target state variable.
- * \return DSCR content
+ * \param value DSCR content
+ * \return Error status
*
* \remarks This is a stand-alone function that executes the JTAG command queue.
*/
|