Hi Spencer, On Thu, Dec 11, 2008 at 12:13 PM, Spencer Oliver <[EMAIL PROTECTED]> wrote: > >> Yes, we can prove this source code to you.
s/prove/provide :-) > Do you work for freescale? > Yes, just a newcomer ;-) > They have also added a new target - target dsp56374 > Hmm, I am not from DSP division, but AXM0432 layout was developed by a DSP division engineer. > Here is my last reply from Freescale support: > > ==================================== > In reply to your Service Request SR 1-516314907: > > Unfortunately, the source code of openocd.exe is confidential, I can not > give you the source code. > Sorry for not helping you. > ==================================== > > Quite amusing really > Please ignore it! Find attached a patch to add axm0432 layout, this source code was developed by DSP team. Please let me know if it works to soundbite boards since it uses the same layout. > Cheers > Spen > > Best Regards, Alan
--- a/src/jtag/ft2232.c 2008-11-01 14:48:20.000000000 +0000 +++ b/src/jtag/ft2232.c 2008-12-11 13:24:43.000000000 +0000 @@ -102,6 +102,7 @@ int turtle_init(void); int comstick_init(void); int stm32stick_init(void); +int axm0432_jtag_init(void); /* reset procedures for supported layouts */ void usbjtag_reset(int trst, int srst); @@ -111,6 +112,8 @@ void turtle_reset(int trst, int srst); void comstick_reset(int trst, int srst); void stm32stick_reset(int trst, int srst); +void axm0432_jtag_reset(int trst, int srst); + /* blink procedures for layouts that support a blinking led */ void olimex_jtag_blink(void); @@ -129,6 +132,7 @@ {"turtelizer2", turtle_init, turtle_reset, turtle_jtag_blink}, {"comstick", comstick_init, comstick_reset, NULL}, {"stm32stick", stm32stick_init, stm32stick_reset, NULL}, + {"axm0432_jtag", axm0432_jtag_init, axm0432_jtag_reset, NULL}, {NULL, NULL, NULL}, }; @@ -1045,6 +1049,38 @@ LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); } + +void axm0432_jtag_reset(int trst, int srst) +{ + if (trst == 1) + { + cur_state = TAP_TLR; + high_output &= ~nTRST; + } + else if (trst == 0) + { + high_output |= nTRST; + } + + if (srst == 1) + { + high_output &= ~nSRST; + } + else if (srst == 0) + { + high_output |= nSRST; + } + + /* command "set data bits low byte" */ + BUFFER_ADD = 0x82; + BUFFER_ADD = high_output; + BUFFER_ADD = high_direction; + LOG_DEBUG("trst: %i, srst: %i, high_output: 0x%2.2x, high_direction: 0x%2.2x", trst, srst, high_output, high_direction); +} + + + + void flyswatter_reset(int trst, int srst) { if (trst == 1) @@ -1722,6 +1758,82 @@ return ERROR_OK; } + +int axm0432_jtag_init(void) +{ + u8 buf[3]; + u8 buf_read[1]; + u32 bytes_written; + u32 bytes_read; + + low_output = 0x08; + low_direction = 0x2b; + + /* initialize low byte for jtag */ + buf[0] = 0x80; /* command "set data bits low byte" */ + buf[1] = low_output; /* value (TMS=1,TCK=0, TDI=0, nOE=0) */ + buf[2] = low_direction; /* dir (output=1), TCK/TDI/TMS=out, TDO=in, nOE=out */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'JTAGkey' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + + if (strcmp(layout->name, "axm0432_jtag") == 0) + { + nTRST = 0x08; + nTRSTnOE = 0x0; /* No output enable for TRST*/ + nSRST = 0x04; + nSRSTnOE = 0x0; /* No output enable for SRST*/ + } + else + { + LOG_ERROR("BUG: axm0432_jtag_init called for non axm0432 layout"); + exit(-1); + } + + high_output = 0x0; + high_direction = 0x0c; + + if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) + { + LOG_ERROR("can't set nTRSTOE to push-pull on the Dicarlo jtag"); + } + else + { + high_output |= nTRST; + } + + if (jtag_reset_config & RESET_SRST_PUSH_PULL) + { + LOG_ERROR("can't set nSRST to push-pull on the Dicarlo jtag"); + } + else + { + high_output |= nSRST; + } + + /* initialize high port */ + buf[0] = 0x82; /* command "set data bits high byte" */ + buf[1] = high_output; /* value */ + buf[2] = high_direction; /* all outputs (xRST and xRSTnOE) */ + LOG_DEBUG("%2.2x %2.2x %2.2x", buf[0], buf[1], buf[2]); + + if (((ft2232_write(buf, 3, &bytes_written)) != ERROR_OK) || (bytes_written != 3)) + { + LOG_ERROR("couldn't initialize FT2232 with 'Dicarlo' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + return ERROR_OK; +} + + + + int jtagkey_init(void) { u8 buf[3];
_______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development