From: David B. <dbr...@us...> - 2009-11-05 06:21:10
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 2970696e8923248ae84640ed67a3d1e4b50f8629 (commit) via fd108f57375bce392a73a8f9a7b46c74ce0e604e (commit) via 067501b0c79e5350e0a6309523fa27bf882e0e7d (commit) via 1d5a3a6bcd02f6abef710b16a86701e41ecf0a9e (commit) from ecd9c0d8bf27f2a8d626ce535a2e7ee48a61bd28 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2970696e8923248ae84640ed67a3d1e4b50f8629 Author: Krzysztof Kajstura <su...@kr...> Date: Wed Nov 4 21:20:44 2009 -0800 JTAG: support KT-LINK adapter Signed-off-by: David Brownell <dbr...@us...> diff --git a/NEWS b/NEWS index d0f5d70..813ecda 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,8 @@ history for details about what changed, including bugfixes and other issues not mentioned here. JTAG Layer: + Support KT-Link JTAG adapter. + Boundary Scan: Target Layer: Flash Layer: diff --git a/src/jtag/ft2232.c b/src/jtag/ft2232.c index e570cbe..7e8c84f 100644 --- a/src/jtag/ft2232.c +++ b/src/jtag/ft2232.c @@ -149,6 +149,7 @@ static int sheevaplug_init(void); static int icebear_jtag_init(void); static int cortino_jtag_init(void); static int signalyzer_h_init(void); +static int ktlink_init(void); /* reset procedures for supported layouts */ static void usbjtag_reset(int trst, int srst); @@ -162,12 +163,14 @@ static void axm0432_jtag_reset(int trst, int srst); static void sheevaplug_reset(int trst, int srst); static void icebear_jtag_reset(int trst, int srst); static void signalyzer_h_reset(int trst, int srst); +static void ktlink_reset(int trst, int srst); /* blink procedures for layouts that support a blinking led */ static void olimex_jtag_blink(void); static void flyswatter_jtag_blink(void); static void turtle_jtag_blink(void); static void signalyzer_h_blink(void); +static void ktlink_blink(void); static const ft2232_layout_t ft2232_layouts[] = { @@ -188,6 +191,7 @@ static const ft2232_layout_t ft2232_layouts[] = { "icebear", icebear_jtag_init, icebear_jtag_reset, NULL }, { "cortino", cortino_jtag_init, comstick_reset, NULL }, { "signalyzer-h", signalyzer_h_init, signalyzer_h_reset, signalyzer_h_blink }, + { "ktlink", ktlink_init, ktlink_reset, ktlink_blink }, { NULL, NULL, NULL, NULL }, }; @@ -3897,3 +3901,130 @@ static void signalyzer_h_blink(void) { signalyzer_h_led_set(signalyzer_h_side, SIGNALYZER_LED_RED, 100, 0, 1); } + +/******************************************************************** + * Support for KT-LINK + * JTAG adapter from KRISTECH + * http://www.kristech.eu + *******************************************************************/ +static int ktlink_init(void) +{ + uint8_t buf[3]; + uint32_t bytes_written; + uint8_t swd_en = 0x20; //0x20 SWD disable, 0x00 SWD enable (ADBUS5) + + low_output = 0x08 | swd_en; // value; TMS=1,TCK=0,TDI=0,SWD=swd_en + low_direction = 0x3B; // out=1; TCK/TDI/TMS=out,TDO=in,SWD=out,RTCK=in,SRSTIN=in + + // initialize low port + buf[0] = 0x80; // command "set data bits low byte" + buf[1] = low_output; + buf[2] = low_direction; + 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 'ktlink' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + nTRST = 0x01; + nSRST = 0x02; + nTRSTnOE = 0x04; + nSRSTnOE = 0x08; + + high_output = 0x80; // turn LED on + high_direction = 0xFF; // all outputs + + enum reset_types jtag_reset_config = jtag_get_reset_config(); + + if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) + { + high_output |= nTRSTnOE; + high_output &= ~nTRST; + } + else + { + high_output &= ~nTRSTnOE; + high_output |= nTRST; + } + + if (jtag_reset_config & RESET_SRST_PUSH_PULL) + { + high_output &= ~nSRSTnOE; + high_output |= nSRST; + } + else + { + high_output |= nSRSTnOE; + high_output &= ~nSRST; + } + + // initialize high port + buf[0] = 0x82; // command "set data bits high byte" + buf[1] = high_output; // value + buf[2] = high_direction; + 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 'ktlink' layout"); + return ERROR_JTAG_INIT_FAILED; + } + + return ERROR_OK; +} + +static void ktlink_reset(int trst, int srst) +{ + enum reset_types jtag_reset_config = jtag_get_reset_config(); + + if (trst == 1) + { + if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) + high_output &= ~nTRSTnOE; + else + high_output &= ~nTRST; + } + else if (trst == 0) + { + if (jtag_reset_config & RESET_TRST_OPEN_DRAIN) + high_output |= nTRSTnOE; + else + high_output |= nTRST; + } + + if (srst == 1) + { + if (jtag_reset_config & RESET_SRST_PUSH_PULL) + high_output &= ~nSRST; + else + high_output &= ~nSRSTnOE; + } + else if (srst == 0) + { + if (jtag_reset_config & RESET_SRST_PUSH_PULL) + high_output |= nSRST; + else + high_output |= nSRSTnOE; + } + + buffer_write(0x82); // command "set data bits high byte" + 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); +} + +static void ktlink_blink(void) +{ + /*LED connected to ACBUS7 */ + if (high_output & 0x80) + high_output &= 0x7F; + else + high_output |= 0x80; + + buffer_write(0x82); // command "set data bits high byte" + buffer_write(high_output); + buffer_write(high_direction); +} + diff --git a/tcl/interface/kt-link.cfg b/tcl/interface/kt-link.cfg new file mode 100644 index 0000000..93af8e4 --- /dev/null +++ b/tcl/interface/kt-link.cfg @@ -0,0 +1,10 @@ +# +# Kristech KT-Link +# +# http://www.kristech.eu +# + +interface ft2232 +ft2232_device_desc "KT-LINK" +ft2232_layout ktlink +ft2232_vid_pid 0x0403 0xBBE2 commit fd108f57375bce392a73a8f9a7b46c74ce0e604e Author: David Brownell <dbr...@us...> Date: Wed Nov 4 21:11:44 2009 -0800 PXA255: support Intel "Lubbock" platform Config for Intel's "Lubbock" PXA255 development board. Even more so than the PXA255 itself, this is obsolete. AFAIK this was the first generally available development platform for PXA255. Intel stopped providing these after other devel boards became available. One interesting thing about this board from the OpenOCD perspective is probably its flash configuration. Each bank is 32 bits wide, built from two 16-bit StrataFlash chips wired in parallel. This doubles throughput ... it reads/writes 32 bits in the time a single chip takes to write just 16 bits. This conf mostly works, given XScale bugfixes, but has some issues (notably: no access to the on-board SDRAM) flagged by FIXMEs. Signed-off-by: David Brownell <dbr...@us...> diff --git a/tcl/board/lubbock.cfg b/tcl/board/lubbock.cfg new file mode 100644 index 0000000..63cc2a4 --- /dev/null +++ b/tcl/board/lubbock.cfg @@ -0,0 +1,110 @@ +# Intel "Lubbock" Development Board with PXA255 (dbpxa255) +# Obsolete; this was Intel's original PXA255 development system +# Board also had CPU cards for SA1100, PXA210, PXA250, and more. + +source [find target/pxa255.cfg] + +jtag_nsrst_delay 250 +jtag_ntrst_delay 250 + +# NOTE: until after pinmux and such are set up, only CS0 is +# available ... not 2nd bank of CFI, or FPGA, SRAM, ENET, etc. + +# CS0, CS1 -- two banks of CFI flash, 32 MBytes each +# each bank is 32-bits wide, two 16-bit chips in parallel +flash bank cfi 0x00000000 0x02000000 2 4 $_TARGETNAME +flash bank cfi 0x04000000 0x02000000 2 4 $_TARGETNAME + +# CS2 low -- FPGA registers +# CS2 high -- 1 MByte SRAM at 0x0a00.0000 ... last 64K for scratch +$_TARGETNAME configure -work-area-phys 0x0a0f0000 + +$_TARGETNAME configure -event reset-assert-pre \ + "$_TARGETNAME configure -work-area-size 0" + +# Make the hex led display a number, assuming CS2 is set up +# and all digits have been enabled through the FPGA. +proc hexled {u32} { + mww 0x08000010 $u32 +} + +# CS3 -- Ethernet +# CS4 -- SA1111 +# CS5 -- PCMCIA + +# NOTE: system console normally uses the FF UART connector + +proc lubbock_init {target} { + + puts "Initialize PXA255 Lubbock board" + + # (1) pinmux + + # GPSR0..GPSR2 + mww 0x40e00018 0x00008000 + mww 0x40e0001c 0x00FC0382 + mww 0x40e00020 0x0001FFFF + # GPDR0..GPDR2 + mww 0x40e0000c 0x0060A800 + mww 0x40e00010 0x00FF0382 + mww 0x40e00014 0x0001C000 + # GAFR0_[LU]..GAFR2_[LU] + mww 0x40e00054 0x98400000 + mww 0x40e00058 0x00002950 + mww 0x40e0005c 0x000A9558 + mww 0x40e00060 0x0005AAAA + mww 0x40e00064 0xA0000000 + mww 0x40e00068 0x00000002 + + # write PSSR, enable GPIOs + mww 0x40f00000 0x00000020 + + # write LED ctrl register ... ones disable + # high byte, 8 hex leds; low byte, 8 discretes + mwh 0x08000040 0xf0ff + + hexled 0x0000 + + # (2) Address space setup + + # MSC0/MSC1/MSC2 + mww 0x48000008 0x23f223f2 + mww 0x4800000c 0x3ff1a441 + mww 0x48000010 0x7ff97ff1 + # pcmcia/cf + mww 0x48000014 0x00000000 + mww 0x48000028 0x00010504 + mww 0x4800002c 0x00010504 + mww 0x48000030 0x00010504 + mww 0x48000034 0x00010504 + mww 0x48000038 0x00004715 + mww 0x4800003c 0x00004715 + + hexled 0x1111 + + # (3) SDRAM setup + # REVISIT this looks dubious ... no refresh cycles + mww 0x48000004 0x03CA4018 + mww 0x48000004 0x004B4018 + mww 0x48000004 0x000B4018 + mww 0x48000004 0x000BC018 + mww 0x48000000 0x00001AC8 + mww 0x48000000 0x00001AC9 + + mww 0x48000040 0x00000000 + + # FIXME -- setup: + # CLOCKS (and faster JTAG) + # enable icache + + # FIXME SRAM isn't working + # $target configure -work-area-size 0x10000 + + hexled 0x2222 + + flash probe 0 + flash probe 1 + + hexled 0xcafe +} +$_TARGETNAME configure -event reset-init "lubbock_init $_TARGETNAME" commit 067501b0c79e5350e0a6309523fa27bf882e0e7d Author: David Brownell <dbr...@us...> Date: Wed Nov 4 19:44:36 2009 -0800 Version 0.4.0-dev Add "-dev" tag. Update minor version number. Archive old NEWS file, start a new one. diff --git a/NEWS b/NEWS index 80e8823..d0f5d70 100644 --- a/NEWS +++ b/NEWS @@ -1,74 +1,15 @@ -This file should include highlights of the changes made in the -OpenOCD openocd-0.3.0 source archive release. See the repository -history for details about what changed, including bugfixes and -other issues not mentioned here. +This file includes highlights of the changes made in the +OpenOCD 0.4.0 source archive release. See the repository +history for details about what changed, including bugfixes +and other issues not mentioned here. JTAG Layer: - FT2232H (high speed USB) support doesn't need separate configuration - New FT2232H JTAG adapters: Amontec, Olimex, Signalyzer - New reset_config options for SRST gating the JTAG clock (or not) - TAP declaration no longer requires ircapture and mask attributes - Scan chain setup should be more robust, with better diagnostics - New TAP events: - "post-reset" for TAP-invariant setup code (TAPs not usable yet) - "setup" for use once TAPs are addressable (e.g. with ICEpick) - Overridable Tcl "init_reset" and "jtag_init" procedures - Simple "autoprobe" mechanism to help simplify server setup - Boundary Scan: - SVF bugfixes ... parsing fixes, better STATE switch conformance - XSVF bugfixes ... be more correct, handle Xilinx tool output - Target Layer: - Warn on use of obsolete numeric target IDs - New commands for use with Cortex-M3 processors: - "cortex_m3 disassemble" ... Thumb2 disassembly (UAL format) - "cortex_m3 vector_catch" ... traps certain hardware faults - without tying up breakpoint resources - If you're willing to help debug it - VERY EARLY Cortex-A8 and ARMv7A support - Updated BeagleBoard.org hardware support - you may need to explicitly "reset" after connect-to-Beagle - New commands for use with XScale processors: "xscale vector_table" - ARM - bugfixes to single-stepping Thumb code - ETM: unavailable registers are not listed - ETB, ETM: report actual hardware status - ARM9 - name change: "arm9 vector_catch" not "arm9tdmi vector_catch" - ARM11 - single stepping support for i.MX31 - bugfix for missing "arm11" prefix on "arm11 memwrite ..." - GDB support - gdb_attach command is gone - Flash Layer: - The lpc2000 driver handles the new NXP LPC1700 (Cortex-M3) chips - New drivers: - lpc2900, for NXP LPC2900 chips (ARM968 based) - mx3_nand, for imx31 - New "last" flag for NOR "flash erase_sector" and "flash protect" - The "nand erase N" command now erases all of bank N - Speed up davinci_nand by about 3x - Board, Target, and Interface Configuration Scripts: - Amontec JTAGkey2 support - Cleanup and additions for the TI/Luminary Stellaris scripts - LPC1768 target (and flash) support - Keil MCB1700 eval board - Samsung s3c2450 - Mini2440 board - Numeric TAP and Target identifiers now trigger warnings - PXA255 partially enumerates - Documentation: - Capture more debugging and setup advice - Notes on target source code changes that may help debugging - Build and Release: - Repository moved from SVN at Berlios to GIT at SourceForge - Clean builds on (32-bit) Cygwin - Clean builds on 64-bit MinGW For more details about what has changed since the last release, see the git repository history. With gitweb, you can browse that diff --git a/NEWS b/NEWS-0.3.0 similarity index 100% copy from NEWS copy to NEWS-0.3.0 diff --git a/configure.in b/configure.in index 08212e8..d7f8d47 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT([openocd], [0.3.0], +AC_INIT([openocd], [0.4.0-dev], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) commit 1d5a3a6bcd02f6abef710b16a86701e41ecf0a9e Author: David Brownell <dbr...@us...> Date: Wed Nov 4 19:39:59 2009 -0800 Version 0.3.0 Remove -dev tag, remove -rc tag. Signed-off-by: David Brownell <dbr...@us...> diff --git a/configure.in b/configure.in index 5772383..08212e8 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_PREREQ(2.60) -AC_INIT([openocd], [0.3.0-rc1-dev], +AC_INIT([openocd], [0.3.0], [OpenOCD Mailing List <ope...@li...>]) AC_CONFIG_SRCDIR([src/openocd.c]) ----------------------------------------------------------------------- Summary of changes: NEWS | 67 ++--------------------- NEWS => NEWS-0.3.0 | 0 configure.in | 2 +- src/jtag/ft2232.c | 131 +++++++++++++++++++++++++++++++++++++++++++++ tcl/board/lubbock.cfg | 110 +++++++++++++++++++++++++++++++++++++ tcl/interface/kt-link.cfg | 10 ++++ 6 files changed, 257 insertions(+), 63 deletions(-) copy NEWS => NEWS-0.3.0 (100%) create mode 100644 tcl/board/lubbock.cfg create mode 100644 tcl/interface/kt-link.cfg hooks/post-receive -- Main OpenOCD repository |